From be394373833e02442e27cff71ed66441e41d8971 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 3 May 2023 21:17:42 +0300 Subject: [PATCH] Update Sidebar --- components/Sidebar.tsx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index cde52fc..a98685d 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -3,21 +3,36 @@ import clsx from 'clsx' import { Anchor } from 'components/Anchor' +import { setLogItemList, useLogStore } from 'contexts/log' import { useWallet } from 'contexts/wallet' import Link from 'next/link' import { useRouter } from 'next/router' +import { useEffect } from 'react' // import BrandText from 'public/brand/brand-text.svg' import { footerLinks, socialsLinks } from 'utils/links' import { BADGE_HUB_ADDRESS, BASE_FACTORY_ADDRESS, NETWORK } from '../utils/constants' import { Conditional } from './Conditional' import { IncomeDashboardDisclaimer } from './IncomeDashboardDisclaimer' +import { LogModal } from './LogModal' import { SidebarLayout } from './SidebarLayout' import { WalletLoader } from './WalletLoader' export const Sidebar = () => { const router = useRouter() const wallet = useWallet() + const logs = useLogStore() + + useEffect(() => { + if (logs.itemList.length === 0) return + console.log('Stringified log item list: ', JSON.stringify(logs.itemList)) + window.localStorage.setItem('logs', JSON.stringify(logs.itemList)) + }, [logs]) + + useEffect(() => { + console.log(window.localStorage.getItem('logs')) + setLogItemList(JSON.parse(window.localStorage.getItem('logs') || '[]')) + }, []) return ( @@ -25,7 +40,6 @@ export const Sidebar = () => { [e.preventDefault(), router.push('/brand')]}> Brand Text - {/* wallet button */} {/* main navigation routes */} @@ -205,9 +219,17 @@ export const Sidebar = () => { +
- + {logs.itemList.length > 0 && ( + + )} {/* Stargaze network status */}
Network: {wallet.network}