From 9f8e239ad00fd04dd96abb9ab680385386be7869 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Thu, 22 Aug 2024 18:18:42 +0100 Subject: [PATCH] Fix auth logic, update swell icon, add sign-in/sign-out button --- src/App.scss | 10 +++ src/components/AccountMenu.tsx | 55 ++++++++++--- .../ecosystem/FavoriteIconButton.tsx | 26 +++--- src/components/ecosystem/Socials.tsx | 8 +- src/components/ecosystem/SwellIcon.tsx | 79 +++++++++++++++++++ src/core/constants.ts | 2 + src/pages/App.tsx | 27 ++++++- 7 files changed, 174 insertions(+), 33 deletions(-) create mode 100644 src/components/ecosystem/SwellIcon.tsx diff --git a/src/App.scss b/src/App.scss index 1e2baa3..3a7c5ae 100644 --- a/src/App.scss +++ b/src/App.scss @@ -73,6 +73,8 @@ body { } .mp__btnConnect { + position: relative; + width: 100%; border-radius: 18px !important; @@ -106,6 +108,12 @@ body { .mp__iconGray { width: 12pt; } + + .icon-overlay { + position: absolute; + top: -6px; + right: -6px; + } } .MuiDrawer-paper { @@ -759,6 +767,7 @@ input[type=number] { .chipPreTge { background: linear-gradient(180deg, #EBB84F, #bc923b) !important; + p { color: black !important } @@ -917,6 +926,7 @@ input[type=number] { .iconRed { color: #da3a34 !important; + svg { color: #da3a34 !important; } diff --git a/src/components/AccountMenu.tsx b/src/components/AccountMenu.tsx index d37f4cc..21bb384 100644 --- a/src/components/AccountMenu.tsx +++ b/src/components/AccountMenu.tsx @@ -22,7 +22,6 @@ */ import { useState, type MouseEvent } from 'react' -import { Link } from 'react-router-dom' import Jazzicon, { jsNumberForAddress } from 'react-jazzicon' import Box from '@mui/material/Box' @@ -32,14 +31,19 @@ import Tooltip from '@mui/material/Tooltip' import Button from '@mui/material/Button' import ArrowOutwardIcon from '@mui/icons-material/ArrowOutward' -import HistoryIcon from '@mui/icons-material/History' import SignalCellularAltOutlinedIcon from '@mui/icons-material/SignalCellularAltOutlined' import AccountCircleRoundedIcon from '@mui/icons-material/AccountCircleRounded' import LooksRoundedIcon from '@mui/icons-material/LooksRounded' +import LoginOutlinedIcon from '@mui/icons-material/LoginOutlined' +import LogoutOutlinedIcon from '@mui/icons-material/LogoutOutlined' +import FiberManualRecordRoundedIcon from '@mui/icons-material/FiberManualRecordRounded' import { cls, styles, cmn, RainbowConnectButton } from '@skalenetwork/metaport' +import { useAuth } from '../AuthContext' + export default function AccountMenu(props: any) { + const { isSignedIn, handleSignIn, handleSignOut } = useAuth() const [anchorEl, setAnchorEl] = useState(null) const open = Boolean(anchorEl) const handleClick = (event: MouseEvent) => { @@ -76,13 +80,32 @@ export default function AccountMenu(props: any) { ) : ( - +