Skip to content

Commit

Permalink
[feat] ✨ update user-account path
Browse files Browse the repository at this point in the history
  • Loading branch information
dappsar committed Oct 31, 2024
1 parent 19f50dd commit 2ba303b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/layouts/common/account-popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function AccountPopover() {
const OPTIONS = [
{
label: t('menu.account'),
linkTo: paths.dashboard.user.account
linkTo: paths.dashboard.user.root
}
]

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/dashboard/config-navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useNavData() {
title: t('menu.user'),
path: paths.dashboard.user.root,
icon: ICONS.user,
children: [{ title: t('menu.account'), path: paths.dashboard.user.account }]
children: [{ title: t('menu.account'), path: paths.dashboard.user.root }]
}
]
}
Expand Down
14 changes: 4 additions & 10 deletions src/routes/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,12 @@ export const paths = {
root: `${ROOTS.DASHBOARD}/nfts`,
content: (id: string) => `${ROOTS.DASHBOARD}/nfts`
},
transfer: {
all: `${ROOTS.DASHBOARD}/transfer/all`
},
user: {
root: `${ROOTS.DASHBOARD}/user/account`,
account: `${ROOTS.DASHBOARD}/user/account`,
email: `${ROOTS.DASHBOARD}/user/account/email`,
wallet: {
root: (walletId: string) => `${ROOTS.DASHBOARD}/user/wallet/${walletId}`,
nfts: {
root: (walletId: string) => `${ROOTS.DASHBOARD}/user/wallet/${walletId}/nfts`,
item: (walletId: string, nftId: string) =>
`${ROOTS.DASHBOARD}/user/wallet/${walletId}/nfts/${nftId}`
}
}
email: `${ROOTS.DASHBOARD}/user/account/email`
}
}
}
4 changes: 2 additions & 2 deletions src/sections/account/change-email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ export default function ChangeEmail() {
}, [startCountdown, contextUser, generate2faCodeEmail, t, setValue, enqueueSnackbar])

const handleCancel = () => {
router.push(paths.dashboard.user.account)
router.push(paths.dashboard.user.root)
}

const onSubmit = async (data: any) => {
try {
// @ts-ignore
await updateEmail?.(contextUser!.phoneNumber, data.code || '', confirmEmail, contextUser!.id)
router.push(paths.dashboard.user.account)
router.push(paths.dashboard.user.root)
setErrorMsg('')
enqueueSnackbar(t('common.msg.update-success'))
} catch (ex) {
Expand Down

0 comments on commit 2ba303b

Please sign in to comment.