index.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import React from 'react';
  2. import Icon from '../Icon';
  3. import Button from '../Button';
  4. import ExpansionPanel from '../ExpansionPanel';
  5. import Typography from '../Typography';
  6. import SelectBox from '../SelectBox';
  7. import ColorSelect from '../ColorSelector';
  8. import Sliders from '../Sliders';
  9. import { Group, Item, SliderWrapper } from '../../global/toolStyled';
  10. const BrushOptions = [
  11. {
  12. key: 'freehand',
  13. content: <Icon glyph="freehand" />,
  14. value: '',
  15. },
  16. {
  17. key: 'markpen',
  18. content: <Icon glyph="markpen" />,
  19. value: '',
  20. },
  21. ];
  22. type Props = {
  23. isActive: boolean;
  24. onClick: () => void;
  25. };
  26. const Freehand: React.FunctionComponent<Props> = ({
  27. isActive,
  28. onClick,
  29. }: Props) => (
  30. <ExpansionPanel
  31. label={(
  32. <Button
  33. shouldFitContainer
  34. align="left"
  35. onClick={onClick}
  36. isActive={isActive}
  37. >
  38. <Icon glyph="freehand" style={{ marginRight: '10px' }} />
  39. Freehand
  40. </Button>
  41. )}
  42. isActive={isActive}
  43. >
  44. <Typography variant="subtitle" style={{ marginTop: '4px' }}>Tools</Typography>
  45. <Group>
  46. <SelectBox options={BrushOptions} />
  47. <Item size="small">
  48. <Icon glyph="eraser" />
  49. </Item>
  50. <Item size="small">
  51. <Icon glyph="redo" />
  52. </Item>
  53. <Item size="small">
  54. <Icon glyph="undo" />
  55. </Item>
  56. </Group>
  57. <ColorSelect showTitle color="" onClick={(): void => {}} />
  58. <Typography variant="subtitle" style={{ marginTop: '4px' }}>Opacity</Typography>
  59. <Group>
  60. <SliderWrapper>
  61. <Sliders />
  62. </SliderWrapper>
  63. 40%
  64. </Group>
  65. <Typography variant="subtitle" style={{ marginTop: '8px' }}>Width</Typography>
  66. <Group>
  67. <SliderWrapper>
  68. <Sliders />
  69. </SliderWrapper>
  70. 12pt
  71. </Group>
  72. </ExpansionPanel>
  73. );
  74. export default Freehand;