Resolve "Implement and Split edit Category from add Category"
This commit is contained in:
parent
bf939fb807
commit
d3b7c61c67
8 changed files with 146 additions and 21 deletions
|
|
@ -2,14 +2,14 @@ import { StyleSheet } from "react-native";
|
|||
import ColorPicker, { BrightnessSlider, HueSlider, Preview, SaturationSlider, } from "reanimated-color-picker";
|
||||
|
||||
export type CustomColorPickerProperties = {
|
||||
currentColor?: string | null,
|
||||
color: string,
|
||||
handleColorChange: (color: string) => void | undefined,
|
||||
}
|
||||
|
||||
const CustomColorPicker = (properties: CustomColorPickerProperties) => {
|
||||
return (
|
||||
<ColorPicker
|
||||
value={properties.currentColor ?? generateRandomColor()}
|
||||
value={properties.color}
|
||||
onChange={(color) => {
|
||||
properties.handleColorChange(color["hex"])
|
||||
}}
|
||||
|
|
@ -30,10 +30,6 @@ const CustomColorPicker = (properties: CustomColorPickerProperties) => {
|
|||
);
|
||||
}
|
||||
|
||||
const generateRandomColor = (): string => {
|
||||
return '#' + Math.floor(Math.random()*16777215).toString(16);
|
||||
}
|
||||
|
||||
export default CustomColorPicker;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
|
|
|||
Reference in a new issue