-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from nini22P/dev
Move account logout to settings page
- Loading branch information
Showing
15 changed files
with
442 additions
and
797 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Avatar, Button, Divider, List, ListItem, ListItemAvatar, ListItemButton, ListItemText } from '@mui/material' | ||
import useUser from '../hooks/useUser' | ||
import { useTranslation } from 'react-i18next' | ||
import useTheme from '../hooks/useTheme' | ||
|
||
const Setting = () => { | ||
const { accounts, logout } = useUser() | ||
const { t } = useTranslation() | ||
const { styles } = useTheme() | ||
|
||
return ( | ||
<List> | ||
{/* 账号 */} | ||
<ListItem> | ||
<ListItemAvatar> | ||
</ListItemAvatar> | ||
<ListItemText sx={{ color: styles.color.primary }}> | ||
{t('account.account')} | ||
</ListItemText> | ||
</ListItem> | ||
|
||
<ListItem | ||
secondaryAction={ | ||
<Button onClick={() => logout()}> | ||
{t('account.signOut')} | ||
</Button> | ||
} | ||
> | ||
<ListItemAvatar> | ||
<Avatar aria-label={accounts[0].name}> | ||
{accounts[0].name?.split(' ')[0]} | ||
</Avatar> | ||
</ListItemAvatar> | ||
<ListItemText | ||
primary={accounts[0].name} | ||
secondary={accounts[0].username} | ||
/> | ||
</ListItem> | ||
|
||
<Divider sx={{ mt: 1, mb: 1 }} /> | ||
|
||
</List> | ||
|
||
) | ||
} | ||
export default Setting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters