Skip to content

Commit 8a29418

Browse files
committed
fix: should hide profile when not have sig in local
1 parent 2dca5f2 commit 8a29418

File tree

1 file changed

+55
-55
lines changed

1 file changed

+55
-55
lines changed

pages/_app.tsx

+55-55
Original file line numberDiff line numberDiff line change
@@ -160,61 +160,61 @@ function App({ Component, pageProps }) {
160160
</div>
161161
</div>
162162

163-
<div
164-
style={{ display: account && isSupportCurrentNetwork ? "block" : "none" }}
165-
className="absolute top-8 right-8 text-right fixed "
166-
>
167-
<Menu as="div" className="relative inline-block text-left">
168-
<div>
169-
<Menu.Button
170-
className="inline-flex justify-center w-full px-2 py-2 font-medium text-white bg-black rounded-md bg-opacity-20 hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75">
171-
<ChevronDownIcon
172-
className="w-5 h-5 text-violet-200 hover:text-violet-100"
173-
aria-hidden="true"
174-
/>
175-
</Menu.Button>
176-
</div>
177-
<Transition
178-
as={Fragment}
179-
enter="transition ease-out duration-100"
180-
enterFrom="transform opacity-0 scale-95"
181-
enterTo="transform opacity-100 scale-100"
182-
leave="transition ease-in duration-75"
183-
leaveFrom="transform opacity-100 scale-100"
184-
leaveTo="transform opacity-0 scale-95"
185-
>
186-
<Menu.Items
187-
className="absolute right-0 w-56 mt-2 origin-top-right bg-white divide-y divide-gray-100 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
188-
<div className="px-1 py-1">
189-
<Menu.Item>
190-
{({ active }) => (
191-
<button
192-
className={`${
193-
active ? "bg-blue-500 text-gray-300" : "text-gray-900"
194-
} group flex rounded-md items-center w-full px-2 py-2 text-sm`}
195-
>
196-
id: {getBrief(account)}
197-
</button>
198-
)}
199-
</Menu.Item>
200-
201-
<Menu.Item>
202-
{({ active }) => (
203-
<button
204-
onClick={disconnectWallet}
205-
className={`${
206-
active ? "bg-blue-500 text-gray-300" : "text-gray-900"
207-
} group flex rounded-md items-center w-full px-2 py-2 text-sm`}
208-
>
209-
Logout
210-
</button>
211-
)}
212-
</Menu.Item>
213-
</div>
214-
</Menu.Items>
215-
</Transition>
216-
</Menu>
217-
</div>
163+
{
164+
sigInLocal && account && isSupportCurrentNetwork &&
165+
<div className="absolute top-8 right-8 text-right fixed">
166+
<Menu as="div" className="relative inline-block text-left">
167+
<div>
168+
<Menu.Button
169+
className="inline-flex justify-center w-full px-2 py-2 font-medium text-white bg-black rounded-md bg-opacity-20 hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75">
170+
<ChevronDownIcon
171+
className="w-5 h-5 text-violet-200 hover:text-violet-100"
172+
aria-hidden="true"
173+
/>
174+
</Menu.Button>
175+
</div>
176+
<Transition
177+
as={Fragment}
178+
enter="transition ease-out duration-100"
179+
enterFrom="transform opacity-0 scale-95"
180+
enterTo="transform opacity-100 scale-100"
181+
leave="transition ease-in duration-75"
182+
leaveFrom="transform opacity-100 scale-100"
183+
leaveTo="transform opacity-0 scale-95"
184+
>
185+
<Menu.Items
186+
className="absolute right-0 w-56 mt-2 origin-top-right bg-white divide-y divide-gray-100 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
187+
<div className="px-1 py-1">
188+
<Menu.Item>
189+
{({ active }) => (
190+
<button
191+
className={`${
192+
active ? "bg-blue-500 text-gray-300" : "text-gray-900"
193+
} group flex rounded-md items-center w-full px-2 py-2 text-sm`}
194+
>
195+
id: {getBrief(account)}
196+
</button>
197+
)}
198+
</Menu.Item>
199+
200+
<Menu.Item>
201+
{({ active }) => (
202+
<button
203+
onClick={disconnectWallet}
204+
className={`${
205+
active ? "bg-blue-500 text-gray-300" : "text-gray-900"
206+
} group flex rounded-md items-center w-full px-2 py-2 text-sm`}
207+
>
208+
Logout
209+
</button>
210+
)}
211+
</Menu.Item>
212+
</div>
213+
</Menu.Items>
214+
</Transition>
215+
</Menu>
216+
</div>
217+
}
218218
</nav>
219219
<Web3Context.Provider value={web3ContextValue}>
220220
<Component {...pageProps} />

0 commit comments

Comments
 (0)