Skip to content

Commit 5e8514f

Browse files
committed
perf directory
1 parent 858f2e3 commit 5e8514f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/features/utils/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ const transformTokenName = (token: string): string => {
132132
.replace(/\+/g, "%2B") // Step 3: Replace plus signs with %2B
133133
}
134134

135-
export const getTokenIconUrl = (token: string) => {
135+
export const getTokenIconUrl = (token: string, size = 80) => {
136136
if (!token) return ""
137-
return `https://d2f70xi62kby8n.cloudfront.net/tokens/${transformTokenName(token)}.webp?auto=compress%2Cformat`
137+
// Request appropriately sized images from CloudFront
138+
// For 40x40 display, request 80x80 for retina displays (2x)
139+
return `https://d2f70xi62kby8n.cloudfront.net/tokens/${transformTokenName(token)}.webp?auto=compress%2Cformat&w=${size}&h=${size}&fit=cover`
138140
}
139141

140142
export const fallbackTokenIconUrl = "/assets/icons/generic-token.svg"

0 commit comments

Comments
 (0)