From 3e36706ab9473481eb1dfcde4ae0d2d3a05430da Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 19 Jun 2023 13:02:38 +0800 Subject: [PATCH] Styling on labels editor --- .../elements/LabelColorDropdown.tsx | 190 ++---------------- packages/web/pages/settings/labels.tsx | 1 + 2 files changed, 17 insertions(+), 174 deletions(-) diff --git a/packages/web/components/elements/LabelColorDropdown.tsx b/packages/web/components/elements/LabelColorDropdown.tsx index f5aeee40e..1682f66da 100644 --- a/packages/web/components/elements/LabelColorDropdown.tsx +++ b/packages/web/components/elements/LabelColorDropdown.tsx @@ -17,8 +17,6 @@ const DropdownMenuContent = styled(DropdownMenuPrimitive.Content, { borderRadius: 6, backgroundColor: '$grayBg', padding: 5, - boxShadow: - '0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2)', }) const DropdownMenu = DropdownMenuPrimitive.Root @@ -30,70 +28,8 @@ const DropdownMenuTrigger = styled(DropdownMenuPrimitive.Trigger, { marginRight: '$2', }) -// const MainContainer = styled(Box, { -// fontFamily: 'inter', -// fontSize: '$2', -// lineHeight: '1.25', -// color: '$grayText', -// display: 'flex', -// justifyContent: 'space-between', -// alignItems: 'center', -// backgroundColor: '$grayBg', -// border: '1px solid $grayBorder', -// width: '180px', -// borderRadius: '$3', -// px: '$3', -// py: '0px', -// cursor: 'pointer', -// '&:hover': { -// border: '1px solid $grayBorderHover', -// }, -// '@mdDown': { -// width: '100%', -// }, -// }) - -const StyledLabel = styled('label', { - position: 'relative', - width: '154px', - height: '40px', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - textAlign: 'center', - fontSize: '13px', - borderRadius: '50px', - overflow: 'hidden', - - '>input': { - position: 'absolute', - width: '154px', - height: '40px', - - appearance: 'none', - '-moz-appearance': 'none', - '-webkit-appearance': 'none', - background: 'none', - border: 'none', - cursor: 'pointer', - }, - - '::-webkit-color-swatch': { - border: 0, - borderRadius: 0, - }, - - '::-moz-focus-inner': { - padding: 0, - }, -}) - export const LabelColorDropdown = (props: LabelColorDropdownProps) => { const { isCreateMode, canEdit, labelId, labelColor, setLabelColor } = props - - const isDarkMode = isDarkTheme() - const iconColor = isDarkMode ? '#FFFFFF' : '#0A0806' - const [colorPickerValue, setColorPickerValue] = useState(props.labelColor) const [open, setOpen] = useState(false) const handleCustomColorChange = (color: string) => { @@ -118,122 +54,23 @@ export const LabelColorDropdown = (props: LabelColorDropdownProps) => { }, }} > - - - + - + ) - - return ( - - - { - // setColorPickerValue(event.target.value) - handleCustomColorChange(event.target.value) - event.preventDefault() - }} - /> - - {labelId ? ( - - ) : ( - - )} - - - - ) - - // return ( - // - // - // - // - // {labelId !== '' && labelId === labelColorHexRowId ? ( - // - // ) : ( - // <> - // {labelId ? ( - // - // ) : ( - // - // )} - // - // )} - // - - // - // - // - - // - // - // - // - // ) } function LabelOption(props: LabelOptionProps): JSX.Element { const { color, isDropdownOption, isCreateMode, labelId } = props - // const colorDetails = getColorDetails( - // color as LabelColor, - // labelId, - // Boolean(isCreateMode) - // ) - const isCreating = isCreateMode && !labelId const { text, border, colorName, background } = getLabelColorObject( color as LabelColor ) @@ -257,11 +94,17 @@ function LabelOption(props: LabelOptionProps): JSX.Element { {colorHex} - {isDropdownOption ? : null} ) } diff --git a/packages/web/pages/settings/labels.tsx b/packages/web/pages/settings/labels.tsx index 24ffae4ce..2e66be2f3 100644 --- a/packages/web/pages/settings/labels.tsx +++ b/packages/web/pages/settings/labels.tsx @@ -82,6 +82,7 @@ const TableCardBox = styled(Box, { }) const inputStyles = { + height: '35px', backgroundColor: 'transparent', color: '$grayTextContrast', padding: '6px 6px',