forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavbar.tsx
More file actions
181 lines (175 loc) · 4.94 KB
/
Copy pathNavbar.tsx
File metadata and controls
181 lines (175 loc) · 4.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
import { ThemeToggle } from "./ThemeToggle";
import { WalletButton } from "./wallet-button";
interface NavbarProps {
onMenuOpen?: () => void;
}
export default function Navbar({ onMenuOpen }: NavbarProps) {
return (
<header
style={{
position: "sticky",
top: 0,
zIndex: 30,
width: "100%",
backgroundColor:
"color-mix(in srgb, var(--color-surface) 85%, transparent)",
backdropFilter: "blur(12px)",
WebkitBackdropFilter: "blur(12px)",
borderBottom: "1px solid var(--color-border)",
boxSizing: "border-box",
}}
>
{/* Accent top line */}
<div
style={{
position: "absolute",
top: 0,
left: 0,
right: 0,
height: "2px",
background:
"linear-gradient(90deg, transparent, var(--color-accent), transparent)",
opacity: 0.6,
}}
/>
<div
style={{
padding: "0 1rem",
height: "3.5rem",
display: "flex",
alignItems: "center",
justifyContent: "space-between",
gap: "0.5rem",
minWidth: 0, // prevents flex children from overflowing
}}
>
{/* ── Left: hamburger + mobile brand ── */}
<div
style={{
display: "flex",
alignItems: "center",
gap: "0.5rem",
minWidth: 0,
flexShrink: 0,
}}
>
<button
onClick={() => onMenuOpen?.()}
aria-label="Toggle navigation menu"
style={{
background: "transparent",
border: "none",
cursor: "pointer",
color: "var(--color-text-muted)",
padding: "0.35rem",
borderRadius: "0.375rem",
display: "flex",
alignItems: "center",
justifyContent: "center",
flexShrink: 0,
transition: "color 0.15s, background-color 0.15s",
}}
onMouseEnter={(e) => {
e.currentTarget.style.color = "var(--color-text)";
e.currentTarget.style.backgroundColor =
"color-mix(in srgb, var(--color-accent) 10%, transparent)";
}}
onMouseLeave={(e) => {
e.currentTarget.style.color = "var(--color-text-muted)";
e.currentTarget.style.backgroundColor = "transparent";
}}
>
<svg
width="22"
height="22"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
>
<path
d="M4 6h16M4 12h16M4 18h16"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</button>
{/* Brand — hidden on lg+ since sidebar shows it there */}
<div
className="lg:hidden"
style={{
display: "flex",
alignItems: "center",
gap: "0.4rem",
minWidth: 0,
overflow: "hidden",
}}
>
<img
src="/stellarsplit-logo.png"
alt="StellarSplit logo"
width={28}
height={28}
style={{ flexShrink: 0 }}
/>
<span
style={{
fontWeight: 700,
fontSize: "0.9rem",
color: "var(--color-accent)",
letterSpacing: "-0.02em",
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
StellarSplit
</span>
</div>
</div>
{/* ── Right: ThemeToggle + divider + WalletButton ── */}
<div
style={{
display: "flex",
alignItems: "center",
gap: "0.5rem",
flexShrink: 0,
}}
>
{/* Hide theme toggle on small screens */}
<div className="hidden sm:flex" style={{ alignItems: "center", gap: "0.5rem" }}>
<ThemeToggle />
<div
style={{
width: "1px",
height: "1.4rem",
backgroundColor: "var(--color-border)",
flexShrink: 0,
}}
/>
</div>
<WalletButton
style={{
background:
"linear-gradient(135deg, var(--color-accent), color-mix(in srgb, var(--color-accent) 70%, #a78bfa))",
color: "#ffffff",
border: "none",
borderRadius: "0.5rem",
padding: "0.45rem 0.75rem",
fontWeight: 600,
fontSize: "0.875rem",
cursor: "pointer",
boxShadow:
"0 0 12px color-mix(in srgb, var(--color-accent) 25%, transparent)",
transition: "opacity 0.2s, box-shadow 0.2s",
whiteSpace: "nowrap",
}}
>
<span className="hidden sm:inline">Connect Wallet</span>
<span className="sm:hidden">Connect</span>
</WalletButton>
</div>
</div>
</header>
);
}