From e250becc692bddeaece12b41a2d17309d87f0e4e Mon Sep 17 00:00:00 2001 From: David de Kloet <122978264+dskloetd@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:39:00 +0200 Subject: [PATCH] NNS1-3094: Remove extra padding from staking island (#5234) # Motivation The staking table is currently narrower than the tokens table which is not intended. Both are inside an element with `width: var(--island-width)` but the staking table uses this style on a `main` element which gets additional padding from a global style. While testing this, I also noticed that when the window gets narrow, the tokens table gets double padding. Once from the padding on the `main` element and once from the subtraction on the `--island-max-width` style [which is set to](https://github.com/dfinity/gix-components/blob/4b072e97fda2c0866bd6a355661cfda5fe44ac18/src/lib/styles/global/variables.scss#L45) `calc(100% - 6 * var(--padding))`. This doesn't seem to be intended either. # Changes 1. Remove `max-width` style on the `MainWrapper` component. 2. Rename `MainWrapper` to `IslandWidthMain` and move it from `components/tokens` to `components/layout`. 3. Reuse the `IslandWidthMain` in the `Staking` component to guarantee consistency. # Tests Manually at https://qsgjb-riaaa-aaaaa-aaaga-cai.dskloet-ingress.devenv.dfinity.network/ # Todos - [ ] Add entry to changelog (if necessary). not yet --- .../IslandWidthMain.svelte} | 1 - frontend/src/lib/routes/Staking.svelte | 33 +++++++++---------- .../src/routes/(app)/(home)/+layout.svelte | 6 ++-- .../routes/(app)/(nns)/tokens/+layout.svelte | 6 ++-- .../(app)/(u)/(list)/accounts/+layout.svelte | 6 ++-- 5 files changed, 24 insertions(+), 28 deletions(-) rename frontend/src/lib/components/{tokens/MainWrapper.svelte => layout/IslandWidthMain.svelte} (92%) diff --git a/frontend/src/lib/components/tokens/MainWrapper.svelte b/frontend/src/lib/components/layout/IslandWidthMain.svelte similarity index 92% rename from frontend/src/lib/components/tokens/MainWrapper.svelte rename to frontend/src/lib/components/layout/IslandWidthMain.svelte index d2362802a69..c0a2972c751 100644 --- a/frontend/src/lib/components/tokens/MainWrapper.svelte +++ b/frontend/src/lib/components/layout/IslandWidthMain.svelte @@ -23,7 +23,6 @@ overflow-x: hidden; @include media.min-width(large) { width: var(--island-width); - max-width: var(--island-max-width); } } } diff --git a/frontend/src/lib/routes/Staking.svelte b/frontend/src/lib/routes/Staking.svelte index 987e02b8dd8..692f4f11f2a 100644 --- a/frontend/src/lib/routes/Staking.svelte +++ b/frontend/src/lib/routes/Staking.svelte @@ -1,5 +1,6 @@ -
- {#if showStakingBanner} - - - {$i18n.staking.title} -

{$i18n.staking.text}

- -
- {/if} + +
+ {#if showStakingBanner} + + + {$i18n.staking.title} +

{$i18n.staking.text}

+ +
+ {/if} - -
+ + + diff --git a/frontend/src/routes/(app)/(home)/+layout.svelte b/frontend/src/routes/(app)/(home)/+layout.svelte index a375c78f227..9d80fa213ff 100644 --- a/frontend/src/routes/(app)/(home)/+layout.svelte +++ b/frontend/src/routes/(app)/(home)/+layout.svelte @@ -1,17 +1,17 @@ - + - + diff --git a/frontend/src/routes/(app)/(nns)/tokens/+layout.svelte b/frontend/src/routes/(app)/(nns)/tokens/+layout.svelte index a375c78f227..9d80fa213ff 100644 --- a/frontend/src/routes/(app)/(nns)/tokens/+layout.svelte +++ b/frontend/src/routes/(app)/(nns)/tokens/+layout.svelte @@ -1,17 +1,17 @@ - + - + diff --git a/frontend/src/routes/(app)/(u)/(list)/accounts/+layout.svelte b/frontend/src/routes/(app)/(u)/(list)/accounts/+layout.svelte index 45b9e89bf42..3833456c271 100644 --- a/frontend/src/routes/(app)/(u)/(list)/accounts/+layout.svelte +++ b/frontend/src/routes/(app)/(u)/(list)/accounts/+layout.svelte @@ -1,9 +1,9 @@