From de869941057d280da928129e1d96def2baf1f6c1 Mon Sep 17 00:00:00 2001 From: AricRedemption Date: Wed, 28 Feb 2024 18:42:46 +0800 Subject: [PATCH] chore: Update UI --- src/App.vue | 2 +- src/assets/icons-v3/bridge.svg | 1 + src/assets/icons-v3/copy.svg | 1 + src/assets/icons-v3/down-arrow.svg | 1 + src/assets/icons-v3/receive.svg | 1 + src/assets/icons-v3/send.svg | 1 + src/assets/icons-v3/swap.svg | 1 + src/assets/icons/setting-v3.svg | 1 + src/assets/vue.svg | 1 - src/components/Avatar.vue | 7 ++- src/components/headers/ServiceMenu.vue | 14 ++--- src/components/headers/SettingMenu.vue | 79 +++++++++++++++++++++++++ src/lib/account.ts | 8 ++- src/pages/accounts/components/Item.vue | 2 +- src/pages/wallet/AccountHeader.vue | 47 +++++++++++++++ src/pages/wallet/Index.vue | 11 +--- src/pages/wallet/components/Balance.vue | 35 +++++++---- src/router.ts | 10 +++- 18 files changed, 186 insertions(+), 37 deletions(-) create mode 100644 src/assets/icons-v3/bridge.svg create mode 100644 src/assets/icons-v3/copy.svg create mode 100644 src/assets/icons-v3/down-arrow.svg create mode 100644 src/assets/icons-v3/receive.svg create mode 100644 src/assets/icons-v3/send.svg create mode 100644 src/assets/icons-v3/swap.svg create mode 100644 src/assets/icons/setting-v3.svg delete mode 100644 src/assets/vue.svg create mode 100644 src/components/headers/SettingMenu.vue create mode 100644 src/pages/wallet/AccountHeader.vue diff --git a/src/App.vue b/src/App.vue index 8279021..5de513e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -88,7 +88,7 @@ checkMigrate().then(async () => { - + diff --git a/src/assets/icons-v3/bridge.svg b/src/assets/icons-v3/bridge.svg new file mode 100644 index 0000000..2d85215 --- /dev/null +++ b/src/assets/icons-v3/bridge.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons-v3/copy.svg b/src/assets/icons-v3/copy.svg new file mode 100644 index 0000000..11a8300 --- /dev/null +++ b/src/assets/icons-v3/copy.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons-v3/down-arrow.svg b/src/assets/icons-v3/down-arrow.svg new file mode 100644 index 0000000..ad00731 --- /dev/null +++ b/src/assets/icons-v3/down-arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons-v3/receive.svg b/src/assets/icons-v3/receive.svg new file mode 100644 index 0000000..b68ff49 --- /dev/null +++ b/src/assets/icons-v3/receive.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons-v3/send.svg b/src/assets/icons-v3/send.svg new file mode 100644 index 0000000..2ff0915 --- /dev/null +++ b/src/assets/icons-v3/send.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons-v3/swap.svg b/src/assets/icons-v3/swap.svg new file mode 100644 index 0000000..741fe0d --- /dev/null +++ b/src/assets/icons-v3/swap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/setting-v3.svg b/src/assets/icons/setting-v3.svg new file mode 100644 index 0000000..1d47283 --- /dev/null +++ b/src/assets/icons/setting-v3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/vue.svg b/src/assets/vue.svg deleted file mode 100644 index 770e9d3..0000000 --- a/src/assets/vue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/Avatar.vue b/src/components/Avatar.vue index babf337..db4f58b 100644 --- a/src/components/Avatar.vue +++ b/src/components/Avatar.vue @@ -1,8 +1,8 @@ diff --git a/src/components/headers/ServiceMenu.vue b/src/components/headers/ServiceMenu.vue index a724f55..0df68e1 100644 --- a/src/components/headers/ServiceMenu.vue +++ b/src/components/headers/ServiceMenu.vue @@ -2,11 +2,11 @@ import { ref } from 'vue' import { useRouter } from 'vue-router' import BtcLogoImg from '@/assets/images/btc-logo.svg?url' -import DownArrowImg from '@/assets/icons/down-arrow.svg?url' import SpaceLogoImg from '@/assets/images/space-logo.svg?url' +import DownArrowImg from '@/assets/icons-v3/down-arrow.svg?url' +import { type Service, getServiceNetwork } from '@/lib/network' import NetworkTypeImg from '@/assets/icons/network-type.svg?url' import AllNetworkTypeImg from '@/assets/icons/all-network-type.svg?url' -import { type Service, getServiceNetwork } from '@/lib/network' const router = useRouter() const service = ref() @@ -21,11 +21,11 @@ const goToNetwork = () => { diff --git a/src/components/headers/SettingMenu.vue b/src/components/headers/SettingMenu.vue new file mode 100644 index 0000000..baf7984 --- /dev/null +++ b/src/components/headers/SettingMenu.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/src/lib/account.ts b/src/lib/account.ts index 1173cbf..1b544b9 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -150,8 +150,12 @@ export async function getAccount(accountId: string): Promise { - const currentAccountId = await storage.get(CURRENT_ACCOUNT_ID) + const currentAccountId = await getCurrentAccountId() if (!currentAccountId) { return } @@ -164,7 +168,7 @@ export async function removeCurrentAccount(): Promise { return false } - const currentAccountId = await storage.get(CURRENT_ACCOUNT_ID) + const currentAccountId = await getCurrentAccountId() if (!currentAccountId) { return false } diff --git a/src/pages/accounts/components/Item.vue b/src/pages/accounts/components/Item.vue index dcd29cd..c61c378 100644 --- a/src/pages/accounts/components/Item.vue +++ b/src/pages/accounts/components/Item.vue @@ -80,7 +80,7 @@ const openEditNameModal = ref(false)
- +
diff --git a/src/pages/wallet/AccountHeader.vue b/src/pages/wallet/AccountHeader.vue new file mode 100644 index 0000000..e81957f --- /dev/null +++ b/src/pages/wallet/AccountHeader.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/pages/wallet/Index.vue b/src/pages/wallet/Index.vue index 4baad95..bb25b0d 100644 --- a/src/pages/wallet/Index.vue +++ b/src/pages/wallet/Index.vue @@ -1,6 +1,7 @@ diff --git a/src/pages/wallet/components/Balance.vue b/src/pages/wallet/components/Balance.vue index 9a6b215..4ac42d2 100644 --- a/src/pages/wallet/components/Balance.vue +++ b/src/pages/wallet/components/Balance.vue @@ -1,6 +1,11 @@ diff --git a/src/router.ts b/src/router.ts index f960025..39599b6 100644 --- a/src/router.ts +++ b/src/router.ts @@ -298,7 +298,15 @@ const routes = [ { path: '/tokens', component: () => import('./pages/tokens/Index.vue') }, - { path: '/settings', component: () => import('./pages/settings/Index.vue') }, + { + path: '/settings', + component: () => import('./pages/settings/Index.vue'), + meta: { + secondaryHeader: true, + headerTitle: 'Setting', + noFooter: true, + }, + }, { path: '/accounts', component: () => import('./pages/accounts/Index.vue'),