diff --git a/src/components/Settings/ThemeColorPicker.tsx b/src/components/Settings/ThemeColorPicker.tsx index 86ec2044..cf43c479 100644 --- a/src/components/Settings/ThemeColorPicker.tsx +++ b/src/components/Settings/ThemeColorPicker.tsx @@ -1,7 +1,8 @@ import { useState } from "react"; -import { ChromePicker } from "react-color"; +import { ColorPicker, toColor } from "react-color-palette"; +import "react-color-palette/lib/css/styles.css"; -import { Grid, Typography, Stack, Box, Button } from "@mui/material"; +import { useTheme, Grid, Typography, Stack, Box, Button } from "@mui/material"; import PassIcon from "@mui/icons-material/Check"; import FailIcon from "@mui/icons-material/Error"; @@ -24,6 +25,8 @@ export default function ThemeColorPicker({ currentDark = DARK_PRIMARY, handleSave, }: IThemeColorPickerProps) { + const theme = useTheme(); + const [light, setLight] = useState(currentLight); const [dark, setDark] = useState(currentDark); @@ -32,25 +35,31 @@ export default function ThemeColorPicker({ return ( <> - + + `0 0 0 1px ${theme.palette.divider} inset !important`, + + "& .rcp-fields-element-input": theme.typography.body2, + }, + }} + > Light Theme - - `0 0 0 1px ${theme.palette.divider} inset !important`, - }, - }} - > - setLight(c.hex)} - /> - + setLight(c.hex)} + dark={theme.palette.mode === "dark"} + /> Dark Theme - - `0 0 0 1px ${theme.palette.divider} inset !important`, - }, - }} - > - setDark(c.hex)} - /> - + setDark(c.hex)} + dark={theme.palette.mode === "dark"} + /> onSubmit(color); + const handleChangeComplete = (color: any) => onSubmit(color); return ( - + ); } diff --git a/src/components/fields/Color/SideDrawerField.tsx b/src/components/fields/Color/SideDrawerField.tsx index b93e2ebd..71bae526 100644 --- a/src/components/fields/Color/SideDrawerField.tsx +++ b/src/components/fields/Color/SideDrawerField.tsx @@ -1,12 +1,13 @@ import { useState } from "react"; import { Controller } from "react-hook-form"; import { ISideDrawerFieldProps } from "../types"; -import { ChromePicker } from "react-color"; +import { ColorPicker, toColor } from "react-color-palette"; +import "react-color-palette/lib/css/styles.css"; import { makeStyles, createStyles } from "@mui/styles"; -import { Grid, ButtonBase, Typography, Collapse } from "@mui/material"; +import { ButtonBase, Box, Typography, Collapse } from "@mui/material"; -// import { useFieldStyles } from "components/SideDrawer/Form/utils"; +import { useFieldStyles } from "components/SideDrawer/Form/utils"; const useStyles = makeStyles((theme) => createStyles({ @@ -42,7 +43,7 @@ export default function Color({ disabled, }: ISideDrawerFieldProps) { const classes = useStyles(); - // const fieldClasses = useFieldStyles(); + const fieldClasses = useFieldStyles(); const [showPicker, setShowPicker] = useState(false); const toggleOpen = () => setShowPicker((s) => !s); @@ -51,40 +52,66 @@ export default function Color({ ( - <> - { - toggleOpen(); - onBlur(); - }} - component={ButtonBase} - focusRipple - disabled={disabled} - > - -
{ + console.log(value); + return ( + <> + { + toggleOpen(); + onBlur(); + }} + component={ButtonBase} + focusRipple + disabled={disabled} + sx={{ + justifyContent: "flex-start", + "&&": { pl: 0.75 }, + color: value?.hex ? "textPrimary" : "textSecondary", + }} + > + + `0 0 0 1px ${theme.palette.divider} inset`, + borderRadius: 0.5, + }} /> - - - - {value?.hex ?? "Choose a color…"} - - - + {value?.hex ?? "Choose a color…"} + - - - - - )} + `0 0 0 1px ${theme.palette.divider}`, + m: 1 / 8, + }, + "& .rcp-saturation": { + borderRadius: 1, + borderBottomLeftRadius: 0, + borderBottomRightRadius: 0, + }, + }} + > + + + + ); + }} /> ); } diff --git a/src/components/fields/Slider/TableCell.tsx b/src/components/fields/Slider/TableCell.tsx index fff728e8..f2912e96 100644 --- a/src/components/fields/Slider/TableCell.tsx +++ b/src/components/fields/Slider/TableCell.tsx @@ -10,11 +10,11 @@ const useStyles = makeStyles((theme) => progress: { width: "100%", backgroundColor: theme.palette.divider, - borderRadius: theme.shape.borderRadius, + borderRadius: 4, }, bar: { - borderRadius: theme.shape.borderRadius, - height: 16, + borderRadius: 4, + height: 8, maxWidth: "100%", }, })