From c13e9d7581a01db1f9d46c3e5563dd2f0c479346 Mon Sep 17 00:00:00 2001 From: Ilja Date: Wed, 9 Feb 2022 15:51:06 +0200 Subject: [PATCH] Settings page layout and components --- .../react-wallet-v2/src/components/Layout.tsx | 3 +- .../src/components/RouteTransition.tsx | 6 +-- .../hooks/useWalletConnectEventsManager.ts | 6 +-- .../react-wallet-v2/src/pages/settings.tsx | 41 +++++++++++++++++++ wallets/react-wallet-v2/src/styles/main.css | 8 ++++ 5 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 wallets/react-wallet-v2/src/pages/settings.tsx diff --git a/wallets/react-wallet-v2/src/components/Layout.tsx b/wallets/react-wallet-v2/src/components/Layout.tsx index 5ce99bd..2d78c5c 100644 --- a/wallets/react-wallet-v2/src/components/Layout.tsx +++ b/wallets/react-wallet-v2/src/components/Layout.tsx @@ -49,7 +49,8 @@ export default function Layout({ children, initialized }: Props) { {children} diff --git a/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts b/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts index c727bb9..c3ea9d9 100644 --- a/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts +++ b/wallets/react-wallet-v2/src/hooks/useWalletConnectEventsManager.ts @@ -4,13 +4,13 @@ import { SessionTypes } from '@walletconnect/types' import { useCallback, useEffect } from 'react' export default function useWalletConnectEventsManager(initialized: boolean) { - const onSessionProposal = useCallback((proposal: SessionTypes.Proposal) => { + const onPairingProposal = useCallback((proposal: SessionTypes.Proposal) => { console.log(proposal) }, []) useEffect(() => { if (initialized) { - client?.on(CLIENT_EVENTS.session.proposal, onSessionProposal) + client?.on(CLIENT_EVENTS.pairing.proposal, onPairingProposal) } - }, [initialized, onSessionProposal]) + }, [initialized, onPairingProposal]) } diff --git a/wallets/react-wallet-v2/src/pages/settings.tsx b/wallets/react-wallet-v2/src/pages/settings.tsx new file mode 100644 index 0000000..1db5561 --- /dev/null +++ b/wallets/react-wallet-v2/src/pages/settings.tsx @@ -0,0 +1,41 @@ +import PageHeader from '@/components/PageHeader' +import WalletStore from '@/store/WalletStore' +import { Card, Divider, Row, Switch, Text } from '@nextui-org/react' +import { Fragment } from 'react' + +export default function SettingsPage() { + return ( + + Settings + + Mnemonic + + + {WalletStore.state.wallet?.mnemonic.phrase} + + + + Warning: mnemonic is provided for development purposes only and should not be used + elsewhere! + + + + + + Testnets + + + Dissabled + + + + + + Theme + + + Dark + + + ) +} diff --git a/wallets/react-wallet-v2/src/styles/main.css b/wallets/react-wallet-v2/src/styles/main.css index 542cdca..98df234 100644 --- a/wallets/react-wallet-v2/src/styles/main.css +++ b/wallets/react-wallet-v2/src/styles/main.css @@ -1,3 +1,11 @@ +body, +html { + position: fixed; + height: 100vh; + width: 100vw; + overflow: hidden; +} + .routeTransition { width: 100%; height: 100%;