index.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import React from 'react';
  2. import Button from '../Button';
  3. import ExpansionPanel from '../ExpansionPanel';
  4. import Icon from '../Icon';
  5. import SelectBox from '../SelectBox';
  6. import Typography from '../Typography';
  7. import ColorSelect from '../ColorSelector';
  8. import Sliders from '../Sliders';
  9. import { Group, SliderWrapper } from '../../global/toolStyled';
  10. const shapeOptions = [
  11. {
  12. key: 'circle',
  13. content: <Icon glyph="circle" />,
  14. value: '',
  15. },
  16. {
  17. key: 'rectangle',
  18. content: <Icon glyph="rectangle" />,
  19. value: '',
  20. },
  21. {
  22. key: 'line',
  23. content: <Icon glyph="line" />,
  24. value: '',
  25. },
  26. {
  27. key: 'arrow',
  28. content: <Icon glyph="arrow" />,
  29. value: '',
  30. },
  31. ];
  32. const typeOptions = [
  33. {
  34. key: 'border',
  35. content: <Icon glyph="border" />,
  36. value: '',
  37. },
  38. {
  39. key: 'fill',
  40. content: <Icon glyph="fill" />,
  41. value: '',
  42. },
  43. ];
  44. type Props = {
  45. isActive: boolean;
  46. onClick: () => void;
  47. };
  48. const Shape: React.FunctionComponent<Props> = ({
  49. isActive,
  50. onClick,
  51. }: Props) => (
  52. <ExpansionPanel
  53. label={(
  54. <Button
  55. shouldFitContainer
  56. align="left"
  57. onClick={onClick}
  58. isActive={isActive}
  59. >
  60. <Icon glyph="shape" style={{ marginRight: '10px' }} />
  61. Shape
  62. </Button>
  63. )}
  64. isActive={isActive}
  65. >
  66. <Typography>Shape</Typography>
  67. <SelectBox options={shapeOptions} style={{ marginRight: '10px' }} />
  68. <SelectBox options={typeOptions} />
  69. <ColorSelect showTitle color="" onClick={(): void => {}} />
  70. <Typography variant="subtitle" style={{ marginTop: '8px' }}>Opacity</Typography>
  71. <Group>
  72. <SliderWrapper>
  73. <Sliders />
  74. </SliderWrapper>
  75. 40%
  76. </Group>
  77. <Typography variant="subtitle" style={{ marginTop: '8px' }}>Width</Typography>
  78. <Group>
  79. <SliderWrapper>
  80. <Sliders />
  81. </SliderWrapper>
  82. 12pt
  83. </Group>
  84. </ExpansionPanel>
  85. );
  86. export default Shape;