You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

color-content.tsx 830B

12345678910111213141516171819202122232425262728
  1. import { IconButton } from 'components/shared'
  2. import { strokes } from 'lib/shape-styles'
  3. import { ColorStyle } from 'types'
  4. import * as DropdownMenu from '@radix-ui/react-dropdown-menu'
  5. import { Square } from 'react-feather'
  6. import styled from 'styles'
  7. import { DropdownContent } from '../shared'
  8. export default function ColorContent({
  9. onChange,
  10. }: {
  11. onChange: (color: ColorStyle) => void
  12. }) {
  13. return (
  14. <DropdownContent sideOffset={0} side="bottom">
  15. {Object.keys(strokes).map((color: ColorStyle) => (
  16. <DropdownMenu.DropdownMenuItem
  17. as={IconButton}
  18. key={color}
  19. title={color}
  20. onSelect={() => onChange(color)}
  21. >
  22. <Square fill={strokes[color]} stroke="none" size="22" />
  23. </DropdownMenu.DropdownMenuItem>
  24. ))}
  25. </DropdownContent>
  26. )
  27. }