From 830ce592f8fecfb238da510bf31dfc795ec29cac Mon Sep 17 00:00:00 2001 From: Snehal Srivastava <118104081+SnehalSrivastava27@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:02:12 +0530 Subject: [PATCH] ui(footer): add Orderbook to footer (#814) --- src/components/Footer.tsx | 37 +++++++++++++++++++++++----- src/i18n/locales/en/translation.json | 3 ++- src/index.css | 4 +-- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index b73fe0338..dddfdabef 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -12,6 +12,7 @@ import { InfoModal } from './Modal' import { isDebugFeatureEnabled, isDevMode } from '../constants/debugFeatures' import { routes } from '../constants/routes' import { toSemVer } from '../utils' +import { OrderbookOverlay } from './Orderbook' import packageInfo from '../../package.json' const APP_DISPLAY_VERSION = (() => { @@ -29,8 +30,10 @@ export default function Footer() { const [showBetaWarning, setShowBetaWarning] = useState(false) const [showCheatsheet, setShowCheatsheet] = useState(false) + const [isShowOrderbook, setIsShowOrderbook] = useState(false) const cheatsheetEnabled = useMemo(() => !!currentWallet, [currentWallet]) + const orderbookEnabled = useMemo(() => !!currentWallet, [currentWallet]) const websocketConnected = useMemo(() => websocketState === WebSocket.OPEN, [websocketState]) useEffect(() => { @@ -82,7 +85,7 @@ export default function Footer() { -
+
{cheatsheetEnabled && ( <> setShowCheatsheet(false)} /> @@ -90,12 +93,34 @@ export default function Footer() { setShowCheatsheet(true)} >
-
{t('footer.cheatsheet')}
+
{t('footer.cheatsheet')}
+
+
+ + + )} + {orderbookEnabled && ( + <> + setIsShowOrderbook(false)} + nickname={serviceInfo?.nickname ?? undefined} + /> + + setIsShowOrderbook(true)} + > +
+ +
{t('footer.orderbook')}
@@ -104,13 +129,13 @@ export default function Footer() {
{isDebugFeatureEnabled('devSetupPage') && ( -
+
Dev Setup
)} -
+
-
+