From 11b3bc59467efd0989e26605be7c6b65f3c50a90 Mon Sep 17 00:00:00 2001 From: olgakup Date: Wed, 13 Nov 2024 14:45:16 -0800 Subject: [PATCH 01/82] feat: remove custom network button, move menu, add scroll ui --- .../src/libs/networks-state/index.ts | 15 +++- packages/extension/src/ui/action/App.vue | 71 +++++++++---------- .../ui/action/components/app-menu/index.vue | 28 ++++++-- .../components/base-input-debounced/index.vue | 4 +- .../action/components/base-search/index.vue | 2 +- .../components/custom-scrollbar/index.vue | 13 +++- .../icons/common/manage-networks-icon.vue | 33 ++++----- .../add-network/views/add-network-list.vue | 2 +- 8 files changed, 97 insertions(+), 71 deletions(-) diff --git a/packages/extension/src/libs/networks-state/index.ts b/packages/extension/src/libs/networks-state/index.ts index 3a0af4706..516f7c7ca 100644 --- a/packages/extension/src/libs/networks-state/index.ts +++ b/packages/extension/src/libs/networks-state/index.ts @@ -20,6 +20,7 @@ class NetworksState { async setNetworkStatus( targetNetworkName: string, + // isActive represents whether or not the network is pinned on the ui isActive: boolean, ): Promise { const state: IState = await this.getState(); @@ -73,7 +74,19 @@ class NetworksState { } } - async getActiveNetworkNames(): Promise { + /** + * Retrieves the names of the pinned networks. + * + * This method first ensures that networks with new features are inserted. + * It then attempts to retrieve the current state. If the state and its networks + * are defined, it maps and returns the names of the valid networks. + * If the state or networks are not defined, it sets the initial active networks + * and returns a predefined list of popular network names. + * + * Previously, the method was named `getActiveNetworks`. + * @returns {Promise} A promise that resolves to an array of active network names. + */ + async getPinnedNetworkNames(): Promise { await this.insertNetworksWithNewFeatures(); const state: IState | undefined = await this.getState(); if (state && state.networks) { diff --git a/packages/extension/src/ui/action/App.vue b/packages/extension/src/ui/action/App.vue index 311ac7647..c96395ab8 100644 --- a/packages/extension/src/ui/action/App.vue +++ b/packages/extension/src/ui/action/App.vue @@ -4,30 +4,17 @@
-