TagSpaces is an offline, open source, document manager with tagging support
polish: improving user profile area
Ilian Sapundshiev76d477c31534
diff --git a/app/components/HelpFeedbackPanel.tsx b/app/components/HelpFeedbackPanel.tsxindex 6ec7567c4..1f21d5eb7 100644--- a/app/components/HelpFeedbackPanel.tsx+++ b/app/components/HelpFeedbackPanel.tsx@@ -23,6 +23,8 @@ import Typography from '@material-ui/core/Typography';import CardActions from '@material-ui/core/CardActions';import CardContent from '@material-ui/core/CardContent';import Button from '@material-ui/core/Button';+import Avatar from '@material-ui/core/Avatar';+import Box from '@material-ui/core/Box';import List from '@material-ui/core/List';import ListItem from '@material-ui/core/ListItem';import ListItemIcon from '@material-ui/core/ListItemIcon';@@ -32,6 +34,7 @@ import AboutIcon from '@material-ui/icons/BlurOn';import ChangeLogIcon from '@material-ui/icons/ImportContacts';import OnboardingIcon from '@material-ui/icons/Explore';import WebClipperIcon from '@material-ui/icons/Transform';+import AccountIcon from '@material-ui/icons/AccountCircle';import EmailIcon from '@material-ui/icons/Email';import IssueIcon from '@material-ui/icons/BugReport';import TranslationIcon from '@material-ui/icons/Translate';@@ -73,9 +76,23 @@ const HelpFeedbackPanel = (props: Props) => {toggleAboutDialog,toggleKeysDialog,toggleOnboardingDialog,- toggleProTeaser+ toggleProTeaser,+ theme} = props;+ let email;+ let initials;+ if (props.user && props.user.attributes && props.user.attributes.email) {+ email = props.user.attributes.email;+ const fullName = email.split('@')[0].split('.');+ const firstName = fullName[0];+ const lastName = fullName[fullName.length - 1];+ initials = firstName.charAt(0).toUpperCase();+ if (lastName) {+ initials += lastName.charAt(0).toUpperCase();+ }+ }+return (<div className={classes.panel} style={props.style}><CustomLogo />@@ -87,9 +104,26 @@ const HelpFeedbackPanel = (props: Props) => {>User Profile</Typography>- <div>- <div>Hello, {props.user.attributes.email}</div>- <div+ <Box>+ <ListItem>+ <ListItemIcon>+ <Avatar+ variant="rounded"+ style={{+ color: theme.palette.getContrastText(+ theme.palette.primary.light+ ),+ backgroundColor: theme.palette.primary.light+ }}+ >+ {initials}+ </Avatar>+ </ListItemIcon>+ <Typography style={{ color: theme.palette.text.primary }}>+ {email}+ </Typography>+ </ListItem>+ <Boxstyle={{width: '100%',textAlign: 'center',@@ -98,9 +132,9 @@ const HelpFeedbackPanel = (props: Props) => {><Buttondata-tid="signOutTID"- onClick={() => Auth.signOut()}title={i18n.t('core:signOut')}className={classes.mainActionButton}+ onClick={() => Auth.signOut()}size="small"variant="outlined"color="primary"@@ -109,9 +143,8 @@ const HelpFeedbackPanel = (props: Props) => {<ExitToAppIcon className={classNames(classes.leftIcon)} />{i18n.t('core:signOut')}</Button>- </div>- {/* <AmplifySignOut buttonText="Sign Out" /> */}- </div>+ </Box>+ </Box></>)}<Typography@@ -130,7 +163,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><AboutIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:aboutTitle')}</Typography></ListItem>@@ -143,7 +176,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><DocumentationIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('Open Documentation')}</Typography></ListItem>@@ -151,7 +184,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><KeyShortcutsIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:shortcutKeys')}</Typography></ListItem>@@ -165,7 +198,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><ChangeLogIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:whatsNew')}</Typography></ListItem>@@ -173,7 +206,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><OnboardingIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:onboardingWizard')}</Typography></ListItem>@@ -184,7 +217,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><WebClipperIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:webClipper')}</Typography></ListItem>@@ -196,7 +229,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><NewFeatureIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:suggestNewFeatures')}</Typography></ListItem>@@ -207,7 +240,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><IssueIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:reportIssues')}</Typography></ListItem>@@ -218,7 +251,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><TranslationIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:helpWithTranslation')}</Typography></ListItem>@@ -230,7 +263,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><EmailIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:emailContact')}</Typography></ListItem>@@ -241,7 +274,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><Social2Icon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:followOnTwitter')}</Typography></ListItem>@@ -252,7 +285,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><SocialIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('core:likeUsOnFacebook')}</Typography></ListItem>@@ -263,7 +296,7 @@ const HelpFeedbackPanel = (props: Props) => {<ListItemIcon><ProTeaserIcon /></ListItemIcon>- <Typography style={{ color: props.theme.palette.text.primary }}>+ <Typography style={{ color: theme.palette.text.primary }}>{i18n.t('TagSpaces Pro Overview')}</Typography></ListItem>diff --git a/app/containers/Auth.tsx b/app/containers/Auth.tsxindex ec0d99c94..fe4d8c3af 100644--- a/app/containers/Auth.tsx+++ b/app/containers/Auth.tsx@@ -74,7 +74,7 @@ const Auth: React.FC<any> = props => {]}/><AmplifySignIn- headerText="Sign in to your TagSpaces account"+ headerText="Welcome to TagSpaces"slot="sign-in"usernameAlias="email"hideSignUp={true}diff --git a/app/containers/LoginPage.tsx b/app/containers/LoginPage.tsxdeleted file mode 100644index fed27b9ee..000000000--- a/app/containers/LoginPage.tsx+++ /dev/null@@ -1,69 +0,0 @@-/**- * TagSpaces - universal file and folder organizer- * Copyright (C) 2017-present TagSpaces UG (haftungsbeschraenkt)- *- * This program is free software: you can redistribute it and/or modify- * it under the terms of the GNU Affero General Public License (version 3) as- * published by the Free Software Foundation.- *- * This program is distributed in the hope that it will be useful,- * but WITHOUT ANY WARRANTY; without even the implied warranty of- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the- * GNU Affero General Public License for more details.- *- * You should have received a copy of the GNU Affero General Public License- * along with this program. If not, see <https://www.gnu.org/licenses/>.- *- */--import React, { Component } from 'react';-import { connect } from 'react-redux';-import { translate } from 'react-i18next';-import Button from '@material-ui/core/Button';-import i18n from '../services/i18n';-// import Backend from '../services/backend';--class LoginPage extends Component {- formValid: boolean;-- emailValid: boolean;-- passValid: boolean;-- handleInputChange: Function;-- constructor(props) {- super(props);- this.formValid = false;- this.emailValid = false;- this.passValid = false;-- this.state = {- username: '',- password: ''- };- }-- handleLogin = e => {- e.preventDefault(); // dev mode- // history.push('/');- };-- render() {- return (- <div style={{ backgroundColor: 'white' }}>- <Button onClick={this.handleLogin}>{i18n.t('core:login')}</Button>- </div>- );- }-}--function mapStateToProps(state) {- return {- common: state.common- };-}--export default connect(mapStateToProps)(- translate(['core'], { wait: true })(LoginPage)-);