From ee8539a9351374a719c9026f85d85e7b4ea6e8f5 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sat, 25 Sep 2021 16:11:31 +0200 Subject: chore: move tweaks to separate subfolder --- components/ColorMenu.tsx | 71 ------------------------------------------------ 1 file changed, 71 deletions(-) delete mode 100644 components/ColorMenu.tsx (limited to 'components/ColorMenu.tsx') diff --git a/components/ColorMenu.tsx b/components/ColorMenu.tsx deleted file mode 100644 index 1bbf087..0000000 --- a/components/ColorMenu.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { ChevronDownIcon } from '@chakra-ui/icons' -import { - Text, - Box, - Button, - Flex, - Menu, - MenuButton, - MenuItem, - MenuList, - Portal, -} from '@chakra-ui/react' -import React, { useCallback } from 'react' -import { initialVisuals } from './config' - -export interface ColorMenuProps { - label: string - colorList: string[] - value: string - visValue: string - setVisuals?: any -} - -export const ColorMenu = (props: ColorMenuProps) => { - const { label, colorList, value, visValue, setVisuals } = props - - const clickCallback = useCallback( - (color) => - setVisuals((curr: typeof initialVisuals) => { - return { - ...curr, - [value]: color, - } - }), - [], - ) - return ( - - {label} - - }> - {} - - - {' '} - - clickCallback('')} - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - {colorList.map((color: string) => ( - clickCallback(color)} - justifyContent="space-between" - alignItems="center" - display="flex" - > - - - ))} - - - - - ) -} -- cgit v1.2.3