From b75598d879e1b9153d89a96f7b0f66ad8d641f71 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Mon, 11 Oct 2021 20:50:51 +0200 Subject: feat(preview): tag display and scroll fix --- components/Tweaks/ColorMenu.tsx | 73 +++++++++++++++++++++++++---------------- components/Tweaks/index.tsx | 2 +- 2 files changed, 46 insertions(+), 29 deletions(-) (limited to 'components/Tweaks') diff --git a/components/Tweaks/ColorMenu.tsx b/components/Tweaks/ColorMenu.tsx index 3d90e36..b87f76b 100644 --- a/components/Tweaks/ColorMenu.tsx +++ b/components/Tweaks/ColorMenu.tsx @@ -9,6 +9,9 @@ import { MenuItem, MenuList, Portal, + PopoverTrigger, + PopoverContent, + Popover, } from '@chakra-ui/react' import React, { useCallback } from 'react' import { initialVisuals } from '../config' @@ -19,10 +22,11 @@ export interface ColorMenuProps { value: string visValue: string setVisuals?: any + noEmpty?: boolean } export const ColorMenu = (props: ColorMenuProps) => { - const { label, colorList, value, visValue, setVisuals } = props + const { label, colorList, value, visValue, setVisuals, noEmpty } = props const clickCallback = useCallback( (color) => @@ -37,35 +41,48 @@ export const ColorMenu = (props: ColorMenuProps) => { return ( {label} - - }> - {} - + + + + - {' '} - - clickCallback('')} - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - {colorList.map((color: string) => ( - clickCallback(color)} - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - + + + {!noEmpty && ( + clickCallback('')} + justifyContent="space-between" + alignItems="center" + display="flex" + m={1} + > + + + )} + {colorList.map((color: string) => ( + clickCallback(color)} + justifyContent="space-between" + alignItems="center" + display="flex" + > + + + ))} + + - + ) } diff --git a/components/Tweaks/index.tsx b/components/Tweaks/index.tsx index 33f11ee..62252b0 100644 --- a/components/Tweaks/index.tsx +++ b/components/Tweaks/index.tsx @@ -96,7 +96,7 @@ export const Tweaks = (props: TweakProps) => { marginLeft={2} borderRadius="lg" paddingBottom={5} - zIndex="overlay" + zIndex={4} boxShadow="xl" maxH={'95vh'} fontSize="sm" -- cgit v1.2.3