- {/* Main site links */}
-
-
- Home
-
+
+
+ {/* Main site links */}
+
+
+ Home
+
-
- Explore
-
-
-
- Create a project
-
-
+
+ Explore
+
+
+
+ Create a project
+
+
-
-
-
-
-
-
- >
- )}
+
+
+
+
+
+ >
+ )
+ }}
)
diff --git a/src/components/Navbar/components/HamburgerMenuButton.tsx b/src/components/Navbar/components/HamburgerMenuButton.tsx
index 0c60d17388..edb566df94 100644
--- a/src/components/Navbar/components/HamburgerMenuButton.tsx
+++ b/src/components/Navbar/components/HamburgerMenuButton.tsx
@@ -14,7 +14,7 @@ export const MobileMenuButton = ({
role="button"
aria-label="menu button"
>
-
+ <>
{open ? (
)}
-
+ >
)
diff --git a/src/components/Navbar/components/Wallet/WalletButton.tsx b/src/components/Navbar/components/Wallet/WalletButton.tsx
index e4246aac40..d39021c120 100644
--- a/src/components/Navbar/components/Wallet/WalletButton.tsx
+++ b/src/components/Navbar/components/Wallet/WalletButton.tsx
@@ -1,14 +1,14 @@
import { WarningOutlined } from '@ant-design/icons'
import { Trans } from '@lingui/macro'
import { Button } from 'antd'
-import LegalNoticeModal from 'components/modals/LegalNoticeModal'
+import { LegalNoticeModal } from 'components/modals/LegalNoticeModal'
import { useWallet } from 'hooks/Wallet'
import { useEffect, useState } from 'react'
import WalletMenu from './WalletMenu'
const LEGAL_NOTICE_STORAGE_KEY = 'jbm_hasAcceptedLegalNotice'
-export default function WalletButton() {
+export function WalletButton() {
const {
userAddress,
isConnected,
@@ -20,10 +20,18 @@ export default function WalletButton() {
const [legalNoticeAccepted, setLegalNoticeAccepted] = useState
(false)
const [legalNoticeVisible, setLegalNoticeVisible] = useState(false)
+ // set initial state
useEffect(() => {
- setLegalNoticeAccepted(
- localStorage.getItem(LEGAL_NOTICE_STORAGE_KEY) === 'true',
- )
+ try {
+ const localStorageState = localStorage.getItem(LEGAL_NOTICE_STORAGE_KEY)
+ const isLegalNoticeAccepted = Boolean(
+ JSON.parse(localStorageState ?? 'false'),
+ )
+
+ setLegalNoticeAccepted(isLegalNoticeAccepted)
+ } catch (error) {
+ return
+ }
}, [])
const onOk = () => {
@@ -36,13 +44,20 @@ export default function WalletButton() {
if (!legalNoticeAccepted) {
return (
<>
-