Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: adjustment in welcome panel and perspective switcher in folder container

Ilian Sapundshiev579c5863e713
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index c5f267e71..533f02a7e 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -650,10 +650,11 @@ function FolderContainer(props: Props) {
)}
</div>
</div>
- {props.isDesktopMode && !showWelcomePanel && (
+ {props.isDesktopMode && (
<ToggleButtonGroup
value={currentPerspective}
size="small"
+ disabled={showWelcomePanel}
aria-label="change perspective"
exclusive
style={{
diff --git a/app/components/HelpFeedbackPanel.tsx b/app/components/HelpFeedbackPanel.tsx
index 36965f6fc..568684cc9 100644
--- a/app/components/HelpFeedbackPanel.tsx
+++ b/app/components/HelpFeedbackPanel.tsx
@@ -221,7 +221,10 @@ function HelpFeedbackPanel(props: Props) {
</Typography>
</ListItem>
)}
- <ListItem button onClick={() => openURLExternally(Links.links.twitter)}>
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.twitter, true)}
+ >
<ListItemIcon>
<TwitterIcon />
</ListItemIcon>
@@ -229,17 +232,6 @@ function HelpFeedbackPanel(props: Props) {
{i18n.t('core:followOnTwitter')}
</Typography>
</ListItem>
- {/* <ListItem
- button
- onClick={() => openURLExternally(Links.links.facebook)}
- >
- <ListItemIcon>
- <SocialIcon />
- </ListItemIcon>
- <Typography style={{ color: theme.palette.text.primary }}>
- {i18n.t('core:likeUsOnFacebook')}
- </Typography>
- </ListItem> */}
<Divider />
<ListItem button onClick={toggleProTeaser}>
<ListItemIcon>
diff --git a/app/components/WelcomePanel.tsx b/app/components/WelcomePanel.tsx
index 774d37f8a..11a7bae67 100644
--- a/app/components/WelcomePanel.tsx
+++ b/app/components/WelcomePanel.tsx
@@ -20,11 +20,12 @@ import React, { useReducer } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import withStyles from '@mui/styles/withStyles';
-import Button from '@mui/material/Button';
+import Typography from '@mui/material/Typography';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
+import Box from '@mui/material/Box';
import Grid from '@mui/material/Grid';
import Divider from '@mui/material/Divider';
import ChangeLogIcon from '@mui/icons-material/ImportContacts';
@@ -34,8 +35,8 @@ import IssueIcon from '@mui/icons-material/BugReport';
import TranslationIcon from '@mui/icons-material/Translate';
import NewFeatureIcon from '@mui/icons-material/Gesture';
import TwitterIcon from '@mui/icons-material/Twitter';
-import WelcomeBackground from '../assets/images/background.png';
-import WelcomeLogo from '../assets/images/welcome-logo.png';
+import WelcomeBackground from '-/assets/images/background.png';
+import WelcomeLogo from '-/assets/images/welcome-logo.png';
import {
CreateFileIcon,
LocalLocationIcon,
@@ -43,18 +44,18 @@ import {
KeyShortcutsIcon,
HelpIcon
} from '-/components/CommonIcons';
-import { actions as AppActions, getCurrentLocationId } from '../reducers/app';
-import i18n from '../services/i18n';
+import { actions as AppActions, getCurrentLocationId } from '-/reducers/app';
+import i18n from '-/services/i18n';
import {
isFirstRun,
getDesktopMode,
actions as SettingsActions
-} from '../reducers/settings';
-import Links from '../links';
+} from '-/reducers/settings';
+import Links from '-/links';
import { Pro } from '-/pro';
import { TS } from '-/tagspaces.namespace';
import { renderHistory } from '-/components/RenderHistory';
-import Typography from '@mui/material/Typography';
+import HowToStart from '-/components/HowToStart';
interface Props {
theme: any;
@@ -72,15 +73,19 @@ interface Props {
currentLocationId: string;
}
-const styles: any = (theme: any) => ({
+export const styles: any = (theme: any) => ({
listItem: {
- color: theme.palette.text.primary,
- textTransform: 'uppercase'
+ color: theme.palette.text.primary
},
recentTitle: {
color: theme.palette.text.primary,
textTransform: 'uppercase',
textAlign: 'center'
+ },
+ noRecentItems: {
+ color: theme.palette.text.primary,
+ padding: 30,
+ alignSelf: 'center'
}
});
@@ -122,11 +127,267 @@ function WelcomePanel(props: Props) {
button.click();
}
+ function renderRecentItems() {
+ return (
+ <Box style={{ display: 'flex', flexDirection: 'column' }}>
+ <Typography
+ variant="inherit"
+ style={{
+ paddingTop: 20
+ }}
+ className={classes.recentTitle}
+ noWrap
+ >
+ {i18n.t('core:fileOpenHistory')}
+ </Typography>
+ {fileOpenHistoryItems ? (
+ <List>
+ {renderHistory(
+ historyKeys.fileOpenKey,
+ fileOpenHistoryItems,
+ forceUpdate,
+ currentLocationId,
+ openLink,
+ openLocationById,
+ openFsEntry,
+ maxRecentItems,
+ showDelete
+ )}
+ </List>
+ ) : (
+ <Typography className={classes.noRecentItems} variant="caption">
+ {i18n.t('noItems')}
+ </Typography>
+ )}
+ <Typography variant="inherit" className={classes.recentTitle} noWrap>
+ {i18n.t('core:fileEditHistory')}
+ </Typography>
+ {fileEditHistoryItems ? (
+ <List>
+ {renderHistory(
+ historyKeys.fileEditKey,
+ fileEditHistoryItems,
+ forceUpdate,
+ props.currentLocationId,
+ props.openLink,
+ props.openLocationById,
+ props.openFsEntry,
+ maxRecentItems,
+ showDelete
+ )}
+ </List>
+ ) : (
+ <Typography className={classes.noRecentItems} variant="caption">
+ {i18n.t('noItems')}
+ </Typography>
+ )}
+ <Typography variant="inherit" className={classes.recentTitle} noWrap>
+ {i18n.t('core:folderOpenHistory')}
+ </Typography>
+ {folderOpenHistoryItems ? (
+ <List>
+ {renderHistory(
+ historyKeys.folderOpenKey,
+ folderOpenHistoryItems,
+ forceUpdate,
+ props.currentLocationId,
+ props.openLink,
+ props.openLocationById,
+ props.openFsEntry,
+ maxRecentItems,
+ showDelete
+ )}
+ </List>
+ ) : (
+ <Typography className={classes.noRecentItems} variant="caption">
+ {i18n.t('noItems')}
+ </Typography>
+ )}
+ </Box>
+ );
+ }
+
+ function renderQuickLinks() {
+ return (
+ <List
+ dense={false}
+ component="nav"
+ aria-label="main help area"
+ style={{
+ width: 300,
+ height: 'calc(100% - 70px)',
+ margin: 'auto',
+ marginTop: 15,
+ marginBottom: 15,
+ // @ts-ignore
+ overflowY: 'overlay',
+ backgroundColor: theme.palette.background.default
+ }}
+ >
+ <div
+ role="button"
+ aria-hidden="true"
+ tabIndex={0}
+ onClick={props.toggleAboutDialog}
+ >
+ <img src={WelcomeLogo} alt="Organize your files" />
+ </div>
+ <ListItem button onClick={triggerOpenLocation}>
+ <ListItemIcon>
+ <LocalLocationIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('chooseLocation')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem button onClick={toggleCreateFileDialog}>
+ <ListItemIcon>
+ <CreateFileIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('createFileTitle')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem button onClick={toggleLocationDialog}>
+ <ListItemIcon>
+ <LocalLocationIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('createLocationTitle')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem button onClick={toggleOpenLinkDialog}>
+ <ListItemIcon>
+ <OpenLinkIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('openLink')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <Divider />
+ <ListItem
+ button
+ onClick={() =>
+ openURLExternally(Links.documentationLinks.general, true)
+ }
+ >
+ <ListItemIcon>
+ <HelpIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('documentation')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem button onClick={toggleKeysDialog}>
+ <ListItemIcon>
+ <KeyShortcutsIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('shortcutKeys')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.changelogURL, true)}
+ >
+ <ListItemIcon>
+ <ChangeLogIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('core:whatsNew')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.webClipper, true)}
+ >
+ <ListItemIcon>
+ <WebClipperIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('core:webClipper')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <Divider />
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.suggestFeature, true)}
+ >
+ <ListItemIcon>
+ <NewFeatureIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('core:suggestNewFeatures')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.reportIssue, true)}
+ >
+ <ListItemIcon>
+ <IssueIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('core:reportIssues')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.helpTranslating, true)}
+ >
+ <ListItemIcon>
+ <TranslationIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('core:helpWithTranslation')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <Divider />
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.emailContact, true)}
+ >
+ <ListItemIcon>
+ <EmailIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('core:emailContact')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ <ListItem
+ button
+ onClick={() => openURLExternally(Links.links.twitter, true)}
+ >
+ <ListItemIcon>
+ <TwitterIcon />
+ </ListItemIcon>
+ <ListItemText
+ primary={i18n.t('core:followOnTwitter')}
+ className={classes.listItem}
+ />
+ </ListItem>
+ </List>
+ );
+ }
+
return (
<div
style={{
overflow: 'hidden',
position: 'relative',
+ paddingLeft: 20,
height: '100%'
}}
>
@@ -151,305 +412,44 @@ function WelcomePanel(props: Props) {
container
spacing={3}
>
- <Grid item xs={isDesktopMode ? 4 : 12} style={{ height: '100%' }}>
- <List
- dense={false}
- component="nav"
- aria-label="main help area"
+ <Grid
+ item
+ xs="auto"
+ style={{ height: '100%', zIndex: 1, minWidth: 300 }}
+ >
+ {renderQuickLinks()}
+ </Grid>
+ <Grid item xs="auto" style={{ height: '100%' }}>
+ <div
style={{
- width: 300,
- height: 'calc(100% - 70px)',
margin: 'auto',
marginTop: 15,
marginBottom: 15,
// @ts-ignore
overflowY: 'overlay',
+ height: 'calc(100% - 50px)',
backgroundColor: theme.palette.background.default
}}
>
+ <HowToStart openURLExternally={openURLExternally} />
+ </div>
+ </Grid>
+ {Pro && (
+ <Grid item xs={3} style={{ height: '100%', width: 300 }}>
<div
- role="button"
- aria-hidden="true"
- tabIndex={0}
- onClick={props.toggleAboutDialog}
+ style={{
+ margin: 'auto',
+ marginTop: 15,
+ marginBottom: 15,
+ // @ts-ignore
+ overflowY: 'overlay',
+ height: 'calc(100% - 50px)',
+ backgroundColor: theme.palette.background.default
+ }}
>
- <img src={WelcomeLogo} alt="Organize your files" />
+ {renderRecentItems()}
</div>
- <ListItem button onClick={triggerOpenLocation}>
- <ListItemIcon>
- <LocalLocationIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('chooseLocation')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem button onClick={toggleCreateFileDialog}>
- <ListItemIcon>
- <CreateFileIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('createFileTitle')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem button onClick={toggleLocationDialog}>
- <ListItemIcon>
- <LocalLocationIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('createLocationTitle')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem button onClick={toggleOpenLinkDialog}>
- <ListItemIcon>
- <OpenLinkIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('openLink')}
- className={classes.listItem}
- />
- </ListItem>
- <Divider />
- <ListItem
- button
- onClick={() =>
- openURLExternally(Links.documentationLinks.general, true)
- }
- >
- <ListItemIcon>
- <HelpIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('documentation')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem button onClick={toggleKeysDialog}>
- <ListItemIcon>
- <KeyShortcutsIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('shortcutKeys')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem
- button
- onClick={() => openURLExternally(Links.links.changelogURL, true)}
- >
- <ListItemIcon>
- <ChangeLogIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('core:whatsNew')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem
- button
- onClick={() => openURLExternally(Links.links.webClipper, true)}
- >
- <ListItemIcon>
- <WebClipperIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('core:webClipper')}
- className={classes.listItem}
- />
- </ListItem>
- <Divider />
- <ListItem
- button
- onClick={() =>
- openURLExternally(Links.links.suggestFeature, true)
- }
- >
- <ListItemIcon>
- <NewFeatureIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('core:suggestNewFeatures')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem
- button
- onClick={() => openURLExternally(Links.links.reportIssue, true)}
- >
- <ListItemIcon>
- <IssueIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('core:reportIssues')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem
- button
- onClick={() =>
- openURLExternally(Links.links.helpTranslating, true)
- }
- >
- <ListItemIcon>
- <TranslationIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('core:helpWithTranslation')}
- className={classes.listItem}
- />
- </ListItem>
- <Divider />
- <ListItem
- button
- onClick={() => openURLExternally(Links.links.emailContact, true)}
- >
- <ListItemIcon>
- <EmailIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('core:emailContact')}
- className={classes.listItem}
- />
- </ListItem>
- <ListItem
- button
- onClick={() => openURLExternally(Links.links.twitter, true)}
- >
- <ListItemIcon>
- <TwitterIcon />
- </ListItemIcon>
- <ListItemText
- primary={i18n.t('core:followOnTwitter')}
- className={classes.listItem}
- />
- </ListItem>
- </List>
- </Grid>
- {isDesktopMode && (
- <>
- <Grid item xs={4} style={{ height: '100%' }}>
- <div
- style={{
- width: 300,
- margin: 'auto',
- marginTop: 15,
- marginBottom: 15,
- // @ts-ignore
- overflowY: 'overlay',
- height: 'calc(100% - 50px)',
- backgroundColor: theme.palette.background.default
- }}
- >
- <div>
- <Typography
- variant="inherit"
- style={{
- paddingTop: 20
- }}
- className={classes.recentTitle}
- noWrap
- >
- {i18n.t('How to start')}
- </Typography>
- <div style={{ height: 400 }}></div>
- </div>
- </div>
- </Grid>
- <Grid item xs={4} style={{ height: '100%' }}>
- <div
- style={{
- width: 300,
- margin: 'auto',
- marginTop: 15,
- marginBottom: 15,
- // @ts-ignore
- overflowY: 'overlay',
- height: 'calc(100% - 50px)',
- backgroundColor: theme.palette.background.default
- }}
- >
- <div>
- {fileOpenHistoryItems && (
- <>
- <Typography
- variant="inherit"
- style={{
- paddingTop: 20
- }}
- className={classes.recentTitle}
- noWrap
- >
- {i18n.t('core:fileOpenHistory')}
- </Typography>
- <List>
- {renderHistory(
- historyKeys.fileOpenKey,
- fileOpenHistoryItems,
- forceUpdate,
- currentLocationId,
- openLink,
- openLocationById,
- openFsEntry,
- maxRecentItems,
- showDelete
- )}
- </List>
- </>
- )}
- {fileEditHistoryItems && (
- <>
- <Typography
- variant="inherit"
- className={classes.recentTitle}
- noWrap
- >
- {i18n.t('core:fileEditHistory')}
- </Typography>
- <List>
- {renderHistory(
- historyKeys.fileEditKey,
- fileEditHistoryItems,
- forceUpdate,
- props.currentLocationId,
- props.openLink,
- props.openLocationById,
- props.openFsEntry,
- maxRecentItems,
- showDelete
- )}
- </List>
- </>
- )}
- {folderOpenHistoryItems && (
- <>
- <Typography
- variant="inherit"
- className={classes.recentTitle}
- noWrap
- >
- {i18n.t('core:folderOpenHistory')}
- </Typography>
- <List>
- {renderHistory(
- historyKeys.folderOpenKey,
- folderOpenHistoryItems,
- forceUpdate,
- props.currentLocationId,
- props.openLink,
- props.openLocationById,
- props.openFsEntry,
- maxRecentItems,
- showDelete
- )}
- </List>
- </>
- )}
- </div>
- </div>
- </Grid>
- </>
+ </Grid>
)}
</Grid>
</div>
diff --git a/app/components/dialogs/OnboardingDialog.tsx b/app/components/dialogs/OnboardingDialog.tsx
index 9a43a3f9b..0ba63228b 100644
--- a/app/components/dialogs/OnboardingDialog.tsx
+++ b/app/components/dialogs/OnboardingDialog.tsx
@@ -245,14 +245,17 @@ function OnboardingDialog(props: Props) {
textAlign: 'center'
}}
>
- <Typography variant="h5">And... you&apos;re done</Typography>
+ <Typography variant="h5">
+ We hope you will love TagSpaces as much as we do!
+ </Typography>
<img
style={{ maxHeight: 300, marginTop: 100 }}
src={WizardFinished}
alt=""
/>
<Typography variant="h6">
- We hope you will love TagSpaces as much as we love it!
+ If you want to learn more about the application, you can start the
+ introduction from the welcome screen.
</Typography>
</div>
</SwipeableViews>
diff --git a/app/links.ts b/app/links.ts
index a566817a9..88924abf9 100644
--- a/app/links.ts
+++ b/app/links.ts
@@ -40,6 +40,7 @@ const Links = {
productEnterprise:
'https://www.tagspaces.org/products/enterprise/' + urlParams,
downloadURL: 'https://www.tagspaces.org/downloads/' + urlParams,
+ howToStart: 'https://www.tagspaces.org/products/howtostart/' + urlParams,
changelogURL: 'https://www.tagspaces.org/whatsnew/' + urlParams,
imprintURL: 'https://www.tagspaces.org/about/imprint/' + urlParams,
privacyURL: 'https://www.tagspaces.org/legal/privacy-app/' + urlParams,