From 691a25fd136043ba2f5e50b0f139f0c4bc3cf2de Mon Sep 17 00:00:00 2001 From: Mark Nardi Date: Thu, 2 May 2024 09:25:33 +0200 Subject: [PATCH 1/3] add network information for evm chains --- .../views/NetworkInformationDrawer.svelte | 14 +++---- .../components/EvmChainInformation.svelte | 41 ++++++++++++++++++- .../components/IscChainInformation.svelte | 35 ---------------- .../network-config/views/components/index.ts | 1 - .../network/stores/selected-chain.store.ts | 6 +-- 5 files changed, 48 insertions(+), 49 deletions(-) delete mode 100644 packages/desktop/views/dashboard/drawers/network-config/views/components/IscChainInformation.svelte diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte index a0c49aa00f..4184ae5814 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte @@ -1,21 +1,17 @@ - +
- {#if evmNetwork?.type === NetworkType.Isc} - - {:else if evmNetwork?.type === NetworkType.Evm} - + {#if $selectedChain && $selectedChain.namespace === NetworkNamespace.Evm} + {/if}
diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/components/EvmChainInformation.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/EvmChainInformation.svelte index f10df475cf..3c833a48d0 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/components/EvmChainInformation.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/views/components/EvmChainInformation.svelte @@ -1,4 +1,43 @@ - evm + diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/components/IscChainInformation.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/IscChainInformation.svelte deleted file mode 100644 index 30770faf55..0000000000 --- a/packages/desktop/views/dashboard/drawers/network-config/views/components/IscChainInformation.svelte +++ /dev/null @@ -1,35 +0,0 @@ - - -
diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/components/index.ts b/packages/desktop/views/dashboard/drawers/network-config/views/components/index.ts index 8be41f9615..d3b5a16bc5 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/components/index.ts +++ b/packages/desktop/views/dashboard/drawers/network-config/views/components/index.ts @@ -1,3 +1,2 @@ export { default as AddIscChainForm } from './AddIscChainForm.svelte' export { default as EvmChainInformation } from './EvmChainInformation.svelte' -export { default as IscChainInformation } from './IscChainInformation.svelte' diff --git a/packages/shared/src/lib/core/network/stores/selected-chain.store.ts b/packages/shared/src/lib/core/network/stores/selected-chain.store.ts index 2edbe51534..629eb1024f 100644 --- a/packages/shared/src/lib/core/network/stores/selected-chain.store.ts +++ b/packages/shared/src/lib/core/network/stores/selected-chain.store.ts @@ -1,9 +1,9 @@ import { Writable, writable } from 'svelte/store' -import { IEvmNetwork } from '../interfaces' +import { Network } from '../types' -export const selectedChain: Writable = writable(undefined) +export const selectedChain: Writable = writable(undefined) -export function setSelectedChain(evmNetwork: IEvmNetwork): void { +export function setSelectedChain(evmNetwork: Network): void { selectedChain.set(evmNetwork) } From 73b9c5e89cbff18a565a9afe2236d07186f5fcd1 Mon Sep 17 00:00:00 2001 From: Mark Nardi Date: Thu, 2 May 2024 09:40:32 +0200 Subject: [PATCH 2/3] remove networksettingsdrawer and unify with network informations --- .../desktop/components/NetworkCard.svelte | 8 ++---- .../NetworkConfigRouterView.svelte | 3 -- .../network-config/components/index.ts | 2 -- .../network-config-route.enum.ts | 1 - .../views/NetworkInformationDrawer.svelte | 4 ++- .../components/ConfigureNodeList.svelte | 0 .../components/LocalProofOfWork.svelte | 0 .../StardustInformation.svelte} | 28 +++++-------------- .../network-config/views/components/index.ts | 1 + .../drawers/network-config/views/index.ts | 1 - 10 files changed, 13 insertions(+), 35 deletions(-) delete mode 100644 packages/desktop/views/dashboard/drawers/network-config/components/index.ts rename packages/desktop/views/dashboard/drawers/network-config/{ => views}/components/ConfigureNodeList.svelte (100%) rename packages/desktop/views/dashboard/drawers/network-config/{ => views}/components/LocalProofOfWork.svelte (100%) rename packages/desktop/views/dashboard/drawers/network-config/views/{NetworkSettingsDrawer.svelte => components/StardustInformation.svelte} (53%) diff --git a/packages/desktop/components/NetworkCard.svelte b/packages/desktop/components/NetworkCard.svelte index 3702067c7a..73d63957e2 100644 --- a/packages/desktop/components/NetworkCard.svelte +++ b/packages/desktop/components/NetworkCard.svelte @@ -32,12 +32,8 @@ } function onCardClick(): void { - if (network.namespace === NetworkNamespace.Stardust) { - $networkConfigRouter.goTo(NetworkConfigRoute.NetworkSettings) - } else { - setSelectedChain(network) - $networkConfigRouter.goTo(NetworkConfigRoute.ChainInformation) - } + setSelectedChain(network) + $networkConfigRouter.goTo(NetworkConfigRoute.ChainInformation) } function onQrCodeIconClick(): void { diff --git a/packages/desktop/views/dashboard/drawers/network-config/NetworkConfigRouterView.svelte b/packages/desktop/views/dashboard/drawers/network-config/NetworkConfigRouterView.svelte index 9911a03f62..b4856bc3cc 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/NetworkConfigRouterView.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/NetworkConfigRouterView.svelte @@ -9,7 +9,6 @@ ConfirmLedgerEvmAddressDrawer, ConnectedNetworksDrawer, EditNetworkDrawer, - NetworkSettingsDrawer, RemoveNetworkDrawer, } from './views' import { clearSelectedChain } from '@core/network' @@ -39,8 +38,6 @@ {:else if $networkConfigRoute === NetworkConfigRoute.ChainInformation} -{:else if $networkConfigRoute === NetworkConfigRoute.NetworkSettings} - {:else if $networkConfigRoute === NetworkConfigRoute.EditChain} {:else if $networkConfigRoute === NetworkConfigRoute.RemoveChain} diff --git a/packages/desktop/views/dashboard/drawers/network-config/components/index.ts b/packages/desktop/views/dashboard/drawers/network-config/components/index.ts deleted file mode 100644 index c7b236b2f6..0000000000 --- a/packages/desktop/views/dashboard/drawers/network-config/components/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as ConfigureNodeList } from './ConfigureNodeList.svelte' -export { default as LocalProofOfWork } from './LocalProofOfWork.svelte' diff --git a/packages/desktop/views/dashboard/drawers/network-config/network-config-route.enum.ts b/packages/desktop/views/dashboard/drawers/network-config/network-config-route.enum.ts index 31d9fcf02c..2231d60ae7 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/network-config-route.enum.ts +++ b/packages/desktop/views/dashboard/drawers/network-config/network-config-route.enum.ts @@ -2,7 +2,6 @@ export enum NetworkConfigRoute { AddChain = 'addChain', ChainDepositAddress = 'chainDepositAddress', ChainInformation = 'chainInformation', - NetworkSettings = 'networkSettings', ConfirmLedgerEvmAddress = 'confirmLedgerEvmAddress', ConnectedChains = 'connectedChains', EditChain = 'editChain', diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte index 4184ae5814..08933210ae 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte @@ -3,7 +3,7 @@ import { selectedChain, NetworkNamespace } from '@core/network' import { Router } from '@core/router' import { NetworkConfigRoute } from '../' - import { EvmChainInformation } from './components' + import { EvmChainInformation, StardustInformation } from './components' export let drawerRouter: Router @@ -12,6 +12,8 @@
{#if $selectedChain && $selectedChain.namespace === NetworkNamespace.Evm} + {:else if $selectedChain && $selectedChain.namespace === NetworkNamespace.Stardust} + {/if}
diff --git a/packages/desktop/views/dashboard/drawers/network-config/components/ConfigureNodeList.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/ConfigureNodeList.svelte similarity index 100% rename from packages/desktop/views/dashboard/drawers/network-config/components/ConfigureNodeList.svelte rename to packages/desktop/views/dashboard/drawers/network-config/views/components/ConfigureNodeList.svelte diff --git a/packages/desktop/views/dashboard/drawers/network-config/components/LocalProofOfWork.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/LocalProofOfWork.svelte similarity index 100% rename from packages/desktop/views/dashboard/drawers/network-config/components/LocalProofOfWork.svelte rename to packages/desktop/views/dashboard/drawers/network-config/views/components/LocalProofOfWork.svelte diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkSettingsDrawer.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformation.svelte similarity index 53% rename from packages/desktop/views/dashboard/drawers/network-config/views/NetworkSettingsDrawer.svelte rename to packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformation.svelte index a0f6a48bd1..bcbabdf086 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkSettingsDrawer.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformation.svelte @@ -1,14 +1,9 @@ - -
- - -
-
diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/components/EvmChainInformationDrawer.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/EvmChainInformationDrawer.svelte new file mode 100644 index 0000000000..6a337b7c9c --- /dev/null +++ b/packages/desktop/views/dashboard/drawers/network-config/views/components/EvmChainInformationDrawer.svelte @@ -0,0 +1,51 @@ + + + +
+
+ + diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformation.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformationDrawer.svelte similarity index 57% rename from packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformation.svelte rename to packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformationDrawer.svelte index bcbabdf086..cc84436300 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformation.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/views/components/StardustInformationDrawer.svelte @@ -1,9 +1,16 @@ -
- - -
-