1
1
"use client" ;
2
-
2
+ import { getTextColor } from "@/lib/colors" ;
3
3
import { isAddress } from "ethers" ;
4
4
import { useDebouncedCallback } from "use-debounce" ;
5
5
import {
@@ -71,6 +71,7 @@ export default function Container({ sponsor }: ContainerProps) {
71
71
const logic = useConfigActions ( ) ;
72
72
const step = useConfigStore ( ( state ) => state . step ) ;
73
73
const primaryColor = useConfigStore ( ( state ) => state . primaryColor ) ;
74
+ const secondaryColor = useConfigStore ( ( state ) => state . secondaryColor ) ;
74
75
const invalidUrl = useConfigStore ( ( state ) => state . invalidUrl ) ;
75
76
const network = useConfigStore ( ( state ) => state . network ) ;
76
77
const scan = useConfigStore ( ( state ) => state . scan ) ;
@@ -141,9 +142,14 @@ export default function Container({ sponsor }: ContainerProps) {
141
142
}
142
143
} ;
143
144
144
- const handleColorChange : ColorChangeHandler = ( color : ColorResult ) => {
145
+ const handlePrimaryColorChange : ColorChangeHandler = ( color : ColorResult ) => {
145
146
logic . updatePrimaryColor ( color . hex ) ;
146
147
} ;
148
+ const handleSecondaryColorChange : ColorChangeHandler = (
149
+ color : ColorResult
150
+ ) => {
151
+ logic . updateSecondaryColor ( color . hex ) ;
152
+ } ;
147
153
148
154
const handleLogoSelect = ( e : React . ChangeEvent < HTMLInputElement > ) => {
149
155
if ( file ) {
@@ -176,14 +182,17 @@ export default function Container({ sponsor }: ContainerProps) {
176
182
validAddress ,
177
183
metadata ,
178
184
file ,
179
- primaryColor
185
+ primaryColor ,
186
+ secondaryColor
180
187
) ;
181
188
} ;
182
189
183
190
const handleValidityChange = ( value : boolean ) => {
184
191
setValid ( value ) ;
185
192
} ;
186
193
194
+ const textColor = getTextColor ( secondaryColor ) ;
195
+
187
196
const handleDeploy = async (
188
197
owner : string ,
189
198
factoryService : CommunityFactoryContractService ,
@@ -275,7 +284,13 @@ export default function Container({ sponsor }: ContainerProps) {
275
284
< AccordionContent >
276
285
< Flex direction = "column" justify = "start" align = "stretch" gap = "2" >
277
286
< Flex justify = "center" >
278
- < Card style = { { maxWidth : 300 } } >
287
+ < Card
288
+ style = { {
289
+ maxWidth : 300 ,
290
+ color : textColor ,
291
+ backgroundColor : secondaryColor ,
292
+ } }
293
+ >
279
294
< Flex gap = "3" align = "center" className = "overflow-hidden" >
280
295
< Avatar
281
296
size = "3"
@@ -294,7 +309,7 @@ export default function Container({ sponsor }: ContainerProps) {
294
309
>
295
310
{ name . trim ( ) ? name : "Community Name" }
296
311
</ Text >
297
- < Text as = "div" size = "2" color = "gray" >
312
+ < Text as = "div" size = "2" style = { { color : textColor } } >
298
313
{ description . trim ( )
299
314
? description
300
315
: "Token Description" }
@@ -404,7 +419,28 @@ export default function Container({ sponsor }: ContainerProps) {
404
419
< SketchPicker
405
420
disableAlpha
406
421
color = { primaryColor }
407
- onChange = { handleColorChange }
422
+ onChange = { handlePrimaryColorChange }
423
+ />
424
+ </ Popover . Content >
425
+ </ Popover . Root >
426
+ </ Flex >
427
+ < Label > Secondary Color</ Label >
428
+ < Flex justify = "center" align = "center" >
429
+ < Popover . Root >
430
+ < Popover . Trigger >
431
+ < Button
432
+ variant = "solid"
433
+ style = { { backgroundColor : secondaryColor } }
434
+ >
435
+ < OpacityIcon height = { 14 } width = { 14 } />
436
+ { secondaryColor }
437
+ </ Button >
438
+ </ Popover . Trigger >
439
+ < Popover . Content side = "bottom" size = "1" >
440
+ < SketchPicker
441
+ disableAlpha
442
+ color = { secondaryColor }
443
+ onChange = { handleSecondaryColorChange }
408
444
/>
409
445
</ Popover . Content >
410
446
</ Popover . Root >
0 commit comments