import { Box, Flex, Input, Text } from '@chakra-ui/react'; import React, { useState } from 'react'; import { titleStyles, CustomizeProfileCard, SmallLabel, Label, } from '../../../utils/CustomizeProfileStyles'; import { ChromePicker } from 'react-color'; import useClickOutside from '../../../hooks/useClickOutside'; const Branding = ({ backgroundRef, profileData }) => { const [brandColor, setBrandColor] = useState( profileData?.background || '#000000' ); const [showColorPicker, setShowColorPicker] = useState(false); const handleChange = (color) => { setBrandColor(color.hex); }; //handle click outside to close color picker useClickOutside(setShowColorPicker, [ 'color-board', 'saturation-white', 'saturation-black', 'hue-horizontal', '', ]); return ( Branding Used for backgrounds, borders etc. div:last-child > div:last-child': { display: 'none !important', }, '.flexbox-fix:first-of-type > div:first-of-type': { display: 'none !important', }, }} > {showColorPicker && ( )} setBrandColor(target.value)} /> ); }; export default Branding; // I used color picker component instead of default color picker because default color picker style changed by the browser user used.