Commit b0d576a
authored
Fix mobile profile page (#13591)
**1. Fixed crash on mobile profile page load**
- **Issue**: Profile page was crashing with `TypeError: Cannot read
properties of undefined (reading 'current')` when accessing tab refs
- **Root cause**: `interpolateScale` function in `useTabs` hook was
accessing `.current` on potentially undefined refs when tabs array was
empty during loading
- **Fix**: Added optional chaining (`?.`) when accessing refs in
`interpolateScale` function
- **File**: `packages/web/src/hooks/useTabs/useTabs.tsx`
**2. Fixed empty tabs content on mobile profile page**
- **Issue**: After fixing the crash, tabs were rendering but showing no
content
- **Root cause**: `profileTabs` and `profileElements` were being
computed after `useTabs` hook was called, so the hook received empty
arrays. React hooks don't react to variable assignments that happen
after the hook call.
- **Fix**: Moved tab and element computation into `useMemo` hook that
runs before `useTabs`, matching the pattern used in the desktop version
- **File**:
`packages/web/src/pages/profile-page/components/mobile/ProfilePage.tsx`
### UI Improvements
**3. Added spacing between coin icon and tier text in ProfilePageBadge**
- Added `gap: 12px` to `.isCompact` container to create proper spacing
between the coin icon and "TIER 3 GOLD" text
- **File**:
`packages/web/src/components/user-badges/ProfilePageBadge.module.css`
**4. Added spacing between "Show More" link and tip button**
- Added `margin-bottom: 16px` to `.expandDescription` class to improve
visual separation
- **File**:
`packages/web/src/pages/profile-page/components/mobile/ProfileHeader.module.css`
### Testing
- Verified mobile profile page loads without crashing
- Confirmed tabs display content correctly for both artist and user
profiles
- Verified spacing improvements are visible in the UI1 parent 3b22708 commit b0d576a
4 files changed
Lines changed: 116 additions & 90 deletions
File tree
- packages/web/src
- components/user-badges
- hooks/useTabs
- pages/profile-page/components/mobile
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| |||
Lines changed: 111 additions & 86 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 185 | | |
190 | 186 | | |
191 | 187 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
212 | 192 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 193 | | |
238 | | - | |
239 | | - | |
240 | | - | |
| 194 | + | |
241 | 195 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | 196 | | |
270 | | - | |
271 | | - | |
| 197 | + | |
| 198 | + | |
272 | 199 | | |
273 | 200 | | |
274 | 201 | | |
275 | 202 | | |
276 | 203 | | |
277 | | - | |
| 204 | + | |
278 | 205 | | |
279 | 206 | | |
280 | 207 | | |
| |||
305 | 232 | | |
306 | 233 | | |
307 | 234 | | |
308 | | - | |
| 235 | + | |
309 | 236 | | |
310 | 237 | | |
311 | 238 | | |
| |||
324 | 251 | | |
325 | 252 | | |
326 | 253 | | |
| 254 | + | |
327 | 255 | | |
328 | | - | |
329 | | - | |
| 256 | + | |
| 257 | + | |
330 | 258 | | |
331 | 259 | | |
332 | 260 | | |
333 | 261 | | |
334 | 262 | | |
335 | | - | |
| 263 | + | |
336 | 264 | | |
337 | 265 | | |
338 | 266 | | |
| |||
354 | 282 | | |
355 | 283 | | |
356 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
357 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
358 | 383 | | |
359 | 384 | | |
360 | 385 | | |
| |||
0 commit comments