From ed8aa4b22b2dcbcbefa34fce6ccc81aaaec9c190 Mon Sep 17 00:00:00 2001 From: Daniel <10026790+dnlggr@users.noreply.github.com> Date: Tue, 8 Feb 2022 15:19:26 +0100 Subject: [PATCH] feat: fancy toggle switch (#63) * fature: privacy shields ui * fix: show address status in advanced wallet view * feat: advanced wallet setting * fix: smaller ui adjustments * Remove todo * Fix flickering * Restyle create wallet flow * Don' t open wallet until confirmed * Dry up styles * Fix css * Fix linter warning * Add fancy toggle switch * Update src/components/CreateWallet.jsx Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com> * Update src/components/CreateWallet.jsx Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com> Co-authored-by: Gigi <109058+dergigi@users.noreply.github.com> --- src/components/CreateWallet.jsx | 11 +++--- src/components/ToggleSwitch.jsx | 16 +++++++++ src/components/ToggleSwitch.module.css | 50 ++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 src/components/ToggleSwitch.jsx create mode 100644 src/components/ToggleSwitch.module.css diff --git a/src/components/CreateWallet.jsx b/src/components/CreateWallet.jsx index 40617dc0..82cad3db 100644 --- a/src/components/CreateWallet.jsx +++ b/src/components/CreateWallet.jsx @@ -2,6 +2,7 @@ import React, { useState } from 'react' import * as rb from 'react-bootstrap' import { Link, useNavigate } from 'react-router-dom' import PageTitle from './PageTitle' +import ToggleSwitch from './ToggleSwitch' import { serialize, walletDisplayName } from '../utils' import { useCurrentWallet } from '../context/WalletContext' @@ -61,8 +62,8 @@ const WalletCreationForm = ({ createWallet, isCreating }) => { const WalletCreationConfirmation = ({ createdWallet, walletConfirmed }) => { const [userConfirmed, setUserConfirmed] = useState(false) - const onSwitch = (e) => { - setUserConfirmed(e.target.checked) + const onToggle = (isToggled) => { + setUserConfirmed(isToggled) } return ( @@ -79,9 +80,9 @@ const WalletCreationConfirmation = ({ createdWallet, walletConfirmed }) => {
-