Skip to content

Commit

Permalink
cleanup information drawers
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNerdi committed May 2, 2024
1 parent 73b9c5e commit 4a3e960
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
<script lang="ts">
import { DrawerTemplate } from '@components'
import { selectedChain, NetworkNamespace } from '@core/network'
import { Router } from '@core/router'
import { NetworkConfigRoute } from '../'
import { EvmChainInformation, StardustInformation } from './components'
import { EvmChainInformationDrawer, StardustInformationDrawer } from './components'
export let drawerRouter: Router<NetworkConfigRoute>
</script>

<DrawerTemplate title={$selectedChain?.name} {drawerRouter}>
<div class="w-full h-full px-6">
{#if $selectedChain && $selectedChain.namespace === NetworkNamespace.Evm}
<EvmChainInformation network={$selectedChain} />
{:else if $selectedChain && $selectedChain.namespace === NetworkNamespace.Stardust}
<StardustInformation />
{/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}

This file was deleted.

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>
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<script lang="ts">
import { Button, IconName } from '@bloomwalletio/ui'
import { DrawerTemplate } from '@components'
import { localize } from '@core/i18n'
import { Router } from '@core/router'
import { PopupId, closePopup, openPopup } from '@desktop/auxiliary/popup'
import ConfigureNodeList from './ConfigureNodeList.svelte'
import LocalProofOfWork from './LocalProofOfWork.svelte'
import { IStardustNetwork } from '@core/network'
import { NetworkConfigRoute } from '../../network-config-route.enum'
export let drawerRouter: Router<NetworkConfigRoute>
export let network: IStardustNetwork
let nodesContainer: HTMLElement
Expand All @@ -26,8 +33,17 @@
}
</script>

<div class="flex flex-col w-full space-y-4">
<ConfigureNodeList bind:nodesContainer />
<LocalProofOfWork />
</div>
<Button variant="text" icon={IconName.Plus} width="full" text={localize('actions.addNode')} on:click={onAddNodeClick} />
<DrawerTemplate title={network.name} {drawerRouter}>
<div class="flex flex-col w-full space-y-4 px-6">
<ConfigureNodeList bind:nodesContainer />
<LocalProofOfWork />
</div>
<Button
slot="footer"
variant="text"
icon={IconName.Plus}
width="full"
text={localize('actions.addNode')}
on:click={onAddNodeClick}
/>
</DrawerTemplate>
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 StardustInformation } from './StardustInformation.svelte'
export { default as EvmChainInformationDrawer } from './EvmChainInformationDrawer.svelte'
export { default as StardustInformationDrawer } from './StardustInformationDrawer.svelte'

0 comments on commit 4a3e960

Please sign in to comment.