Skip to content

Commit

Permalink
fix: limit number of account network summary based on screen size (#2845
Browse files Browse the repository at this point in the history
)

Co-authored-by: Nicole O'Brien <[email protected]>
  • Loading branch information
jeeanribeiro and nicole-obrien authored Sep 26, 2024
1 parent 62f69a8 commit 56327ef
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import { networks } from '@core/network'
export let account: IAccountState
const ACCOUNT_NETWORK_SUMMARY_MAXIMUM_WIDTH_IN_PX = 300
let accountSummaryListWidth: number
let accountSummaryWidth: number
</script>

<Pane
Expand All @@ -16,8 +21,17 @@
shadow-lg
"
>
<AccountSummary />
{#each $networks as network}
<AccountNetworkSummary {account} {network} />
{/each}
<div
class="flex-1 flex divide-x divide-solid divide-stroke dark:divide-stroke-dark"
bind:clientWidth={accountSummaryListWidth}
>
<div bind:clientWidth={accountSummaryWidth}>
<AccountSummary />
</div>
{#each $networks as network, i}
{#if i * ACCOUNT_NETWORK_SUMMARY_MAXIMUM_WIDTH_IN_PX <= accountSummaryListWidth - accountSummaryWidth}
<AccountNetworkSummary {account} {network} />
{/if}
{/each}
</div>
</Pane>

0 comments on commit 56327ef

Please sign in to comment.