Skip to content

Commit f1ea843

Browse files
committed
feat: update Navbar and Faucet components for improved user experience
1 parent 4bff235 commit f1ea843

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

src/components/navbar/NavBar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export function Navbar() {
2424
<span className="hidden lg:block">iExec Explorer</span>
2525
</ChainLink>
2626
<div className="mr-8 flex items-center gap-4 md:mr-0">
27+
<Button variant="link" asChild className="text-foreground -mr-4">
28+
<ChainLink to="/faucet">Faucet</ChainLink>
29+
</Button>
2730
{isConnected && (
28-
<div className="hidden md:flex">
29-
<Button variant="link" asChild className="text-foreground">
30-
<ChainLink to="/faucet">Faucet</ChainLink>
31-
</Button>
31+
<div className="-mr-4 hidden md:flex">
3232
<Button variant="link" asChild className="text-foreground">
3333
<ChainLink to={`/address/${userAddress}?from=my_activity`}>
3434
My activity
@@ -37,9 +37,9 @@ export function Navbar() {
3737
<Button variant="link" asChild className="text-foreground">
3838
<ChainLink to="/account">iExec Account</ChainLink>
3939
</Button>
40-
<span className="border-secondary border-l" />
4140
</div>
4241
)}
42+
<span className="border-secondary h-9 border-l" />
4343
<div className="content hidden gap-4 md:flex">
4444
<ModeToggle />
4545
<ChainSelector />

src/hooks/useLoginLogout.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import { useAuth } from '@clerk/clerk-react';
12
import { useAppKit } from '@reown/appkit/react';
23
import { useDisconnect } from 'wagmi';
34

45
export function useLoginLogout() {
56
const { open } = useAppKit();
67
const { disconnectAsync } = useDisconnect();
8+
const { signOut } = useAuth()
79

810
const logout = async () => {
11+
signOut()
912
try {
1013
await disconnectAsync();
1114
} catch (err) {

src/routes/$chainSlug/_layout/faucet.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,21 @@ function FaucetRoute() {
147147
<SignedIn>
148148
<div className="space-y-4">
149149
<div className="flex flex-col justify-center gap-4 md:flex-row md:items-center">
150-
<Button className="dark:bg-popover bg-primary-foreground hover:bg-muted text-primary dark:text-brand px-1 duration-300">
151-
<UserButton showName />
152-
</Button>
150+
<div className="flex-none">
151+
<UserButton
152+
showName
153+
appearance={{
154+
elements: {
155+
userButtonTrigger: {
156+
background: 'var(--primary-foreground)',
157+
color: 'var(--primary)',
158+
borderRadius: '9999px',
159+
padding: '8px',
160+
},
161+
},
162+
}}
163+
/>
164+
</div>
153165
<div className="relative w-full">
154166
<Input
155167
className="max-w-80 min-w-full pr-11"

0 commit comments

Comments
 (0)