@@ -83,52 +83,8 @@ export default function CustomizePage(): ReactElement {
8383 }
8484 } , [ ] ) ;
8585
86- // ── buildQueryParams ──────────────────────────────────────────────────────
87-
88- const buildQueryParams = useCallback ( ( ) : string => {
89- const params = new URLSearchParams ( ) ;
90-
91- if ( hasUsername ) {
92- params . set ( 'user' , trimmedUsername ) ;
93- }
94-
95- if ( skipsCustomColors ) {
96- // Virtual themes always emit theme=<name> and skip custom color params.
97- params . set ( 'theme' , theme ) ;
98- } else {
99- const hasCustomColors = bgHex || accentHex || textHex ;
100-
101- // Custom hex colors take priority over theme
102- if ( ! hasCustomColors ) {
103- params . set ( 'theme' , theme ) ;
104- }
105- if ( bgHex ) params . set ( 'bg' , stripHash ( bgHex ) ) ;
106- if ( accentHex ) params . set ( 'accent' , stripHash ( accentHex ) ) ;
107- if ( textHex ) params . set ( 'text' , stripHash ( textHex ) ) ;
108- }
109-
110- if ( scale !== 'linear' ) params . set ( 'scale' , scale ) ;
111- if ( speed !== '8s' ) params . set ( 'speed' , speed ) ;
112- if ( font ) params . set ( 'font' , font ) ;
113- if ( year ) params . set ( 'year' , year ) ;
114- if ( radius !== 8 ) params . set ( 'radius' , radius . toString ( ) ) ;
115- if ( size !== 'medium' ) params . set ( 'size' , size ) ;
116-
117- if ( hideTitle ) params . set ( 'hide_title' , 'true' ) ;
118- if ( hideBackground ) params . set ( 'hide_background' , 'true' ) ;
119- if ( hideStats ) params . set ( 'hide_stats' , 'true' ) ;
120- if ( viewMode !== 'default' ) params . set ( 'view' , viewMode ) ;
121- if ( deltaFormat !== 'percent' ) params . set ( 'delta_format' , deltaFormat ) ;
122- if ( badgeWidth !== '' ) params . set ( 'width' , badgeWidth . toString ( ) ) ;
123- if ( badgeHeight !== '' ) params . set ( 'height' , badgeHeight . toString ( ) ) ;
124- if ( grace !== 1 ) params . set ( 'grace' , grace . toString ( ) ) ;
125- if ( language !== 'en' ) params . set ( 'lang' , language ) ;
126- if ( timezone !== 'UTC' ) params . set ( 'tz' , timezone ) ;
127-
128- return params . toString ( ) ;
129- } , [
130- hasUsername ,
131- trimmedUsername ,
86+ const queryString = buildQueryParams ( {
87+ username,
13288 theme,
13389 bgHex,
13490 accentHex,
@@ -149,9 +105,7 @@ export default function CustomizePage(): ReactElement {
149105 grace,
150106 language,
151107 timezone,
152- ] ) ;
153-
154- const queryString = buildQueryParams ( ) ;
108+ } ) ;
155109 const previewSrc = `/api/streak?${ queryString } ` ;
156110 const exportSnippet = getExportSnippet ( exportFormat , queryString ) ;
157111
0 commit comments