mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 14:40:50 +01:00
Update CatalogGiftView
This commit is contained in:
parent
f65947c8f6
commit
c08e60ba2d
@ -54,8 +54,11 @@ export const CatalogGiftView: FC<{}> = props =>
|
|||||||
if(giftData.colors && giftData.colors.length > 0) newColors.push({ id: colorId, color: `#${giftData.colors[0].toString(16)}` });
|
if(giftData.colors && giftData.colors.length > 0) newColors.push({ id: colorId, color: `#${giftData.colors[0].toString(16)}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(newColors.length)
|
||||||
|
{
|
||||||
setSelectedColorId(newColors[0].id);
|
setSelectedColorId(newColors[0].id);
|
||||||
setColors(newColors);
|
setColors(newColors);
|
||||||
|
}
|
||||||
}, [ giftConfiguration ]);
|
}, [ giftConfiguration ]);
|
||||||
|
|
||||||
const close = useCallback(() =>
|
const close = useCallback(() =>
|
||||||
@ -68,7 +71,8 @@ export const CatalogGiftView: FC<{}> = props =>
|
|||||||
setMessage('');
|
setMessage('');
|
||||||
setSelectedBoxIndex(0);
|
setSelectedBoxIndex(0);
|
||||||
setSelectedRibbonIndex(0);
|
setSelectedRibbonIndex(0);
|
||||||
setSelectedColorId(colors[0].id);
|
|
||||||
|
if(colors.length) setSelectedColorId(colors[0].id);
|
||||||
}, [ colors ]);
|
}, [ colors ]);
|
||||||
|
|
||||||
const onCatalogEvent = useCallback((event: CatalogEvent) =>
|
const onCatalogEvent = useCallback((event: CatalogEvent) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user