Resolve "Implement and Split edit Category from add Category"

This commit is contained in:
Thomas Schleicher 2024-01-05 16:45:25 +00:00 committed by jastornig
parent bf939fb807
commit d3b7c61c67
8 changed files with 146 additions and 21 deletions

View file

@ -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({