From c9eba93fbb9a92b40cea644f44b9aef5edcadda3 Mon Sep 17 00:00:00 2001 From: Alex <32063118+alex-byteport@users.noreply.github.com> Date: Tue, 17 Dec 2024 09:25:10 +0100 Subject: [PATCH] New sidebar with navigation added: UI changes and small fixes (#101) * new sidebar with navigation added. ui changes and small fixes. * prettier * fix warnings * fix dangling session proxies hwn changing role --------- Co-authored-by: Alexey Popov Co-authored-by: Alain Brenzikofer --- app.vue | 11 +- assets/img/.DS_Store | Bin 6148 -> 8196 bytes assets/img/incognitee-full-logo.svg | 1 + components/Logo/incognitee-logo.vue | 2 +- components/overlays/SessionProxiesOverlay.vue | 3 - components/tabs/MessagingTab.vue | 78 ++- components/tabs/SwapTab.vue | 32 +- components/tabs/VouchersTab.vue | 613 +++++++++--------- components/tabs/WalletTab.vue | 17 +- components/ui/CampaignBanner.vue | 2 +- components/ui/HealthIndicator.vue | 8 +- components/ui/InfoBanner.vue | 2 +- components/ui/NetworkSelector.vue | 4 +- components/ui/PrivateMessageHistory.vue | 17 +- components/ui/PrivateTxHistory.vue | 6 +- components/ui/Sidebar.vue | 222 +++++++ helpers/eventBus.ts | 6 +- layouts/default.vue | 277 ++------ package.json | 3 +- pages/index.vue | 27 +- public/.DS_Store | Bin 6148 -> 8196 bytes public/img/.DS_Store | Bin 6148 -> 6148 bytes public/img/index/.DS_Store | Bin 8196 -> 10244 bytes 23 files changed, 728 insertions(+), 603 deletions(-) create mode 100644 assets/img/incognitee-full-logo.svg create mode 100644 components/ui/Sidebar.vue diff --git a/app.vue b/app.vue index 5cd504e..d3971a3 100644 --- a/app.vue +++ b/app.vue @@ -1,7 +1,16 @@ diff --git a/helpers/eventBus.ts b/helpers/eventBus.ts index 34c3187..a3a3a11 100644 --- a/helpers/eventBus.ts +++ b/helpers/eventBus.ts @@ -1,5 +1,7 @@ import mitt from "mitt"; -const eventBus = mitt(); +type Events = { + toggleSidebar: void; +}; -export { eventBus }; +export const eventBus = mitt(); diff --git a/layouts/default.vue b/layouts/default.vue index 94f1200..96f312d 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,221 +1,58 @@ diff --git a/package.json b/package.json index 986b5b3..dffd6e9 100644 --- a/package.json +++ b/package.json @@ -75,5 +75,6 @@ "vue-qrcode-reader": "^5.5.4", "vue3-form-wizard": "^0.2.3", "vuetify": "^3.7.0" - } + }, + "packageManager": "yarn@4.5.3+sha512.3003a14012e2987072d244c720506549c1aab73ee728208f1b2580a9fd67b92d61ba6b08fe93f6dce68fd771e3af1e59a0afa28dd242dd0940d73b95fedd4e90" } diff --git a/pages/index.vue b/pages/index.vue index 007c60a..d75bb38 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -154,7 +154,10 @@ import { useSystemHealth } from "@/store/systemHealth"; import { useNotes } from "~/store/notes"; import { formatMoment } from "~/helpers/date"; import { Note, NoteDirection } from "~/lib/notes"; -import { SessionProxyRole } from "@/lib/sessionProxyStorage.ts"; +import { + SessionProxyRole, + sessionProxyRoleOrder, +} from "@/lib/sessionProxyStorage.ts"; import MessagingTab from "~/components/tabs/MessagingTab.vue"; import SwapTab from "~/components/tabs/SwapTab.vue"; import GovTab from "~/components/tabs/GovTab.vue"; @@ -275,16 +278,18 @@ const fetchIncogniteeBalance = async () => { }; const storeSessionProxies = (proxies) => { - for (const proxy of proxies) { - const localKeyring = new Keyring({ type: "sr25519" }); - const seed = hexToU8a(proxy.seed.toString()); - const account = localKeyring.addFromSeed(seed); - accountStore.addSessionProxy( - account, - seed, - proxy.role.toString() as SessionProxyRole, - ); - } + // Add the first entry for each role in proxies to the store + sessionProxyRoleOrder.forEach((role) => { + const proxy = proxies.find((p) => p.role.toString() === role); + if (proxy) { + const localKeyring = new Keyring({ type: "sr25519" }); + const seed = hexToU8a(proxy.seed.toString()); + const account = localKeyring.addFromSeed(seed); + accountStore.addSessionProxy(account, seed, role); + } else { + accountStore.removeProxyForRole(role); + } + }); }; const fetchNetworkStatus = async () => { const promises = []; diff --git a/public/.DS_Store b/public/.DS_Store index 2df834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