-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement evmnetworkinformation in the network card (#2428)
* add network information for evm chains * remove networksettingsdrawer and unify with network informations * cleanup information drawers --------- Co-authored-by: Nicole O'Brien <[email protected]>
- Loading branch information
1 parent
de2d878
commit d2aa87d
Showing
14 changed files
with
71 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
packages/desktop/views/dashboard/drawers/network-config/components/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 7 additions & 14 deletions
21
...ages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
<script lang="ts"> | ||
import { DrawerTemplate } from '@components' | ||
import { NetworkType, IscChain, selectedChain } from '@core/network' | ||
import { selectedChain, NetworkNamespace } from '@core/network' | ||
import { Router } from '@core/router' | ||
import { NetworkConfigRoute } from '../' | ||
import { EvmChainInformation, IscChainInformation } from './components' | ||
import { EvmChainInformationDrawer, StardustInformationDrawer } from './components' | ||
export let drawerRouter: Router<NetworkConfigRoute> | ||
$: evmNetwork = $selectedChain as IscChain | ||
</script> | ||
|
||
<DrawerTemplate title={evmNetwork?.name} {drawerRouter}> | ||
<div class="w-full h-full px-6"> | ||
{#if evmNetwork?.type === NetworkType.Isc} | ||
<IscChainInformation {evmNetwork} /> | ||
{:else if evmNetwork?.type === NetworkType.Evm} | ||
<EvmChainInformation /> | ||
{/if} | ||
</div> | ||
</DrawerTemplate> | ||
{#if $selectedChain && $selectedChain.namespace === NetworkNamespace.Evm} | ||
<EvmChainInformationDrawer network={$selectedChain} {drawerRouter} /> | ||
{:else if $selectedChain && $selectedChain.namespace === NetworkNamespace.Stardust} | ||
<StardustInformationDrawer network={$selectedChain} {drawerRouter} /> | ||
{/if} |
File renamed without changes.
4 changes: 0 additions & 4 deletions
4
...esktop/views/dashboard/drawers/network-config/views/components/EvmChainInformation.svelte
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
.../views/dashboard/drawers/network-config/views/components/EvmChainInformationDrawer.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script lang="ts"> | ||
import { localize } from '@core/i18n' | ||
import { IEvmNetwork, IIscChain, NetworkType } from '@core/network' | ||
import { Table } from '@bloomwalletio/ui' | ||
import { DrawerTemplate } from '@components/drawers' | ||
import { NetworkConfigRoute } from '../../network-config-route.enum' | ||
import { Router } from '@core/router' | ||
export let drawerRouter: Router<NetworkConfigRoute> | ||
export let network: IEvmNetwork | ||
const localeKey = 'views.dashboard.drawers.networkConfig.chain' | ||
function isIscChain(network: IEvmNetwork): network is IIscChain { | ||
return network.type === NetworkType.Isc | ||
} | ||
</script> | ||
|
||
<DrawerTemplate title={network.name} {drawerRouter}> | ||
<div class="w-full h-full px-6"> | ||
<Table | ||
orientation="vertical" | ||
items={[ | ||
{ | ||
key: localize(`${localeKey}.chainId`), | ||
value: network.chainId ?? undefined, | ||
copyable: true, | ||
}, | ||
{ | ||
key: localize(`${localeKey}.rpcEndpoint`), | ||
value: network.rpcEndpoint ?? undefined, | ||
copyable: true, | ||
}, | ||
{ | ||
key: localize(`${localeKey}.explorerUrl`), | ||
value: network.explorerUrl ?? undefined, | ||
copyable: true, | ||
}, | ||
...(isIscChain(network) | ||
? [ | ||
{ | ||
key: localize(`${localeKey}.aliasAddress`), | ||
value: network.aliasAddress ?? undefined, | ||
copyable: true, | ||
}, | ||
] | ||
: []), | ||
]} | ||
/> | ||
</div> | ||
</DrawerTemplate> |
35 changes: 0 additions & 35 deletions
35
...esktop/views/dashboard/drawers/network-config/views/components/IscChainInformation.svelte
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/desktop/views/dashboard/drawers/network-config/views/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { default as AddIscChainForm } from './AddIscChainForm.svelte' | ||
export { default as EvmChainInformation } from './EvmChainInformation.svelte' | ||
export { default as IscChainInformation } from './IscChainInformation.svelte' | ||
export { default as EvmChainInformationDrawer } from './EvmChainInformationDrawer.svelte' | ||
export { default as StardustInformationDrawer } from './StardustInformationDrawer.svelte' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/shared/src/lib/core/network/stores/selected-chain.store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters