From 6915150ff60c2acdff1d73ce35db9c4926a48dc9 Mon Sep 17 00:00:00 2001 From: JCNoguera <88061365+VmMad@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:15:40 +0200 Subject: [PATCH] refactor: cleanup `Toggle` component (#7092) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: cleanup `Toggle` component * fix: remove unnecessary cursor-pointer --------- Co-authored-by: Begoña Álvarez de la Cruz --- .../popups/send/SendConfirmationPopup.svelte | 3 +- .../buttons/ProfileLockButton.svelte | 2 +- .../drawers/send/views/ReviewView.svelte | 3 +- .../components/filters/FilterItem.svelte | 11 ++-- .../shared/components/inputs/Toggle.svelte | 66 ++++++++++++------- .../components/modals/ProfileActions.svelte | 2 +- 6 files changed, 56 insertions(+), 31 deletions(-) diff --git a/packages/desktop/components/popups/send/SendConfirmationPopup.svelte b/packages/desktop/components/popups/send/SendConfirmationPopup.svelte index fee12b35a32..2b5a37f6d8a 100644 --- a/packages/desktop/components/popups/send/SendConfirmationPopup.svelte +++ b/packages/desktop/components/popups/send/SendConfirmationPopup.svelte @@ -42,6 +42,7 @@ TARGET_CONTRACTS, TRANSFER_ALLOWANCE, } from '@core/layer-2' + import { ToggleColor } from '@ui/inputs/Toggle.svelte' export let _onMount: (..._: any[]) => Promise = async () => {} export let disableBack = false @@ -221,7 +222,7 @@
- {}} /> +
diff --git a/packages/mobile/components/drawers/send/views/ReviewView.svelte b/packages/mobile/components/drawers/send/views/ReviewView.svelte index 553017ae2f1..0216504e84c 100644 --- a/packages/mobile/components/drawers/send/views/ReviewView.svelte +++ b/packages/mobile/components/drawers/send/views/ReviewView.svelte @@ -22,6 +22,7 @@ import { DrawerId, openDrawer } from '@/auxiliary/drawer' import { sendRouter } from '@/routers' import { activeProfile } from '@core/profile' + import { ToggleColor } from '@ui/inputs/Toggle.svelte' export let sendTransaction: () => Promise export let storageDeposit: number @@ -110,7 +111,7 @@ @@ -19,11 +24,7 @@ {localize(filterUnit.labelKey ?? filterUnit.localeKey + '.label')} - (filterUnit.active = !filterUnit.active)} - bind:active={filterUnit.active} - color="green" - /> + {#if filterUnit.active} + export enum ToggleColor { + Green = 'green', + Blue = 'blue', + } + + - - diff --git a/packages/shared/components/modals/ProfileActions.svelte b/packages/shared/components/modals/ProfileActions.svelte index c3ec5847ca0..01c1511e52c 100644 --- a/packages/shared/components/modals/ProfileActions.svelte +++ b/packages/shared/components/modals/ProfileActions.svelte @@ -166,7 +166,7 @@ - +
{:else}