From 22ac06a59e730ab1b406ae2bfcdaa147c2805e92 Mon Sep 17 00:00:00 2001 From: marino <102478601+kemuru@users.noreply.github.com> Date: Sun, 14 May 2023 16:52:00 +0100 Subject: [PATCH 01/11] feat: add navbar settings and notifications pop-ups --- web/package.json | 1 + web/src/components/ConnectButton.tsx | 25 ++++--- .../Header/navbar/Menu/Settings/General.tsx | 75 +++++++++++++++++++ .../Notifications/FormNotifs/FormEmail.tsx | 47 ++++++++++++ .../Notifications/FormNotifs/index.tsx | 64 ++++++++++++++++ .../Settings/Notifications/HeaderNotifs.tsx | 18 +++++ .../Menu/Settings/Notifications/index.tsx | 20 +++++ .../Header/navbar/Menu/Settings/index.tsx | 67 +++++++++++++++++ .../navbar/{Menu.tsx => Menu/index.tsx} | 31 +++++++- 9 files changed, 335 insertions(+), 13 deletions(-) create mode 100644 web/src/layout/Header/navbar/Menu/Settings/General.tsx create mode 100644 web/src/layout/Header/navbar/Menu/Settings/Notifications/FormNotifs/FormEmail.tsx create mode 100644 web/src/layout/Header/navbar/Menu/Settings/Notifications/FormNotifs/index.tsx create mode 100644 web/src/layout/Header/navbar/Menu/Settings/Notifications/HeaderNotifs.tsx create mode 100644 web/src/layout/Header/navbar/Menu/Settings/Notifications/index.tsx create mode 100644 web/src/layout/Header/navbar/Menu/Settings/index.tsx rename web/src/layout/Header/navbar/{Menu.tsx => Menu/index.tsx} (56%) diff --git a/web/package.json b/web/package.json index 3f62f8d40..401252a84 100644 --- a/web/package.json +++ b/web/package.json @@ -72,6 +72,7 @@ "react-chartjs-2": "^4.3.1", "react-dom": "^18.2.0", "react-error-boundary": "^3.1.4", + "react-identicons": "^1.2.5", "react-is": "^18.2.0", "react-jazzicon": "^1.0.4", "react-loading-skeleton": "^3.2.0", diff --git a/web/src/components/ConnectButton.tsx b/web/src/components/ConnectButton.tsx index 86c9a765b..7ef37da99 100644 --- a/web/src/components/ConnectButton.tsx +++ b/web/src/components/ConnectButton.tsx @@ -7,17 +7,26 @@ import { useConnect } from "hooks/useConnect"; import { SUPPORTED_CHAINS } from "consts/chains"; const AccountDisplay: React.FC = () => { - const { account, chainId } = useWeb3(); - const chainName = chainId ? SUPPORTED_CHAINS[chainId].chainName : undefined; - const shortAddress = account ? shortenAddress(account) : undefined; return ( - {chainName} - + + ); }; +export const ChainDisplay: React.FC = () => { + const { chainId } = useWeb3(); + const chainName = chainId ? SUPPORTED_CHAINS[chainId].chainName : undefined; + return {chainName}; +}; + +export const AddressDisplay: React.FC = () => { + const { account } = useWeb3(); + const shortAddress = account ? shortenAddress(account) : undefined; + return ; +}; + const StyledContainer = styled.div` width: fit-content; height: 34px; @@ -42,11 +51,7 @@ const StyledContainer = styled.div` const ConnectButton: React.FC = () => { const { active } = useWeb3(); const { activate, connecting } = useConnect(); - return active ? ( - - ) : ( -