Commit 24fc447
committed
🐛 fix(navbar): fix layout shift on language toggle
Navbar menu item widths and sign-in button width were changing size
when switching between English and Myanmar languages, causing layout
instability.
- Add `desktopNavWidthByKey` fixed-width map to lock each nav item
to a stable Tailwind width class regardless of translated label length
- Apply `inline-flex justify-center whitespace-nowrap` on nav links
to prevent text-driven width changes
- Add `min-w` and `whitespace-nowrap` to `SignInButton` for stable
width across locales
- Fix React purity issue: replace `Math.random()` in render with
static `sparkleDriftX` constant array
- Refine desktop nav spacing, gap, and font size for visual balance1 parent 7a1c239 commit 24fc447
2 files changed
Lines changed: 22 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
| |||
39 | 50 | | |
40 | 51 | | |
41 | 52 | | |
42 | | - | |
| 53 | + | |
43 | 54 | | |
44 | 55 | | |
45 | 56 | | |
| |||
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
55 | | - | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
92 | 103 | | |
93 | 104 | | |
94 | 105 | | |
95 | | - | |
| 106 | + | |
96 | 107 | | |
97 | 108 | | |
98 | 109 | | |
| |||
104 | 115 | | |
105 | 116 | | |
106 | 117 | | |
| 118 | + | |
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| 125 | + | |
113 | 126 | | |
114 | 127 | | |
115 | 128 | | |
| |||
162 | 175 | | |
163 | 176 | | |
164 | 177 | | |
165 | | - | |
| 178 | + | |
166 | 179 | | |
167 | 180 | | |
168 | 181 | | |
| 182 | + | |
169 | 183 | | |
170 | 184 | | |
171 | 185 | | |
| |||
350 | 364 | | |
351 | 365 | | |
352 | 366 | | |
353 | | - | |
| 367 | + | |
354 | 368 | | |
355 | 369 | | |
356 | 370 | | |
357 | 371 | | |
358 | 372 | | |
359 | 373 | | |
360 | 374 | | |
| 375 | + | |
361 | 376 | | |
362 | 377 | | |
363 | 378 | | |
364 | 379 | | |
365 | 380 | | |
366 | 381 | | |
367 | | - | |
| 382 | + | |
368 | 383 | | |
369 | 384 | | |
370 | 385 | | |
| |||
0 commit comments