Unify cover image proxification in profile layouts
Summary
- Add CSS utility functions for URL validation and escaping
- Migrate wallet profile-layout to use
proxifyImageSrc(matching blog) - Add URL escaping to both blog and wallet profile layouts
Changes
| File | Change |
|---|---|
packages/ui/lib/css-utils.ts |
New utility with escapeCssUrl() and isSafeImageUrl()
|
packages/ui/components/index.tsx |
Export css-utils |
apps/wallet/.../profile-layout.tsx |
Use proxifyImageSrc + escaping |
apps/blog/.../profile-layout.tsx |
Add escaping for consistency |
Details
The wallet was using proxifyImageUrl which simply prepends the proxy domain. The blog was already using proxifyImageSrc which Base58 encodes URLs into /p/{hash} format.
This change unifies both apps to use proxifyImageSrc and adds URL validation/escaping.
Related
-
#777 (closed) - Migrate remaining
proxifyImageUrlusages (follow-up refactoring)
Test plan
-
Verify profile cover images display correctly in blog app -
Verify profile cover images display correctly in wallet app -
Verify profiles without cover images still work