index.tsx 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. // import Icon from '../Icon';
  4. // import Button from '../Button';
  5. // import Typography from '../Typography';
  6. import SliderWithTitle from '../SliderWithTitle';
  7. import ColorSelector from '../../containers/ColorSelector';
  8. import {
  9. Wrapper,
  10. // Group,
  11. // Item,
  12. } from '../../global/toolStyled';
  13. const FreehandOption: React.SFC<OptionPropsType> = ({
  14. // type,
  15. color,
  16. opacity,
  17. width,
  18. setDataState = (): void => {
  19. // do nothing
  20. },
  21. }: OptionPropsType) => {
  22. const { t } = useTranslation('sidebar');
  23. return (
  24. <>
  25. {/* <Wrapper>
  26. <Typography variant="subtitle" style={{ marginTop: '4px' }} align="left">
  27. {t('style')}
  28. </Typography>
  29. <Group>
  30. <Item
  31. size="small"
  32. selected={type === 'pen'}
  33. onClick={(): void => { setDataState({ type: 'pen' }); }}
  34. >
  35. <Icon glyph="freehand" />
  36. </Item>
  37. <Item size="small">
  38. <Icon glyph="eraser" />
  39. </Item>
  40. <Item size="small">
  41. <Icon glyph="redo" />
  42. </Item>
  43. <Item size="small">
  44. <Icon glyph="undo" />
  45. </Item>
  46. </Group>
  47. </Wrapper> */}
  48. <Wrapper>
  49. <ColorSelector
  50. title={t('color')}
  51. selectedColor={color}
  52. onClick={(selected: string): void => {
  53. setDataState({ color: selected });
  54. }}
  55. />
  56. </Wrapper>
  57. <Wrapper>
  58. <SliderWithTitle
  59. title={t('opacity')}
  60. value={opacity}
  61. tips={`${opacity}%`}
  62. onSlide={(val: number): void => {
  63. setDataState({ opacity: val });
  64. }}
  65. />
  66. </Wrapper>
  67. <Wrapper>
  68. <SliderWithTitle
  69. title={t('brushSize')}
  70. value={width}
  71. tips={`${width} pt`}
  72. onSlide={(val: number): void => {
  73. setDataState({ width: val });
  74. }}
  75. maximum={40}
  76. />
  77. </Wrapper>
  78. {/* <Wrapper>
  79. <Group style={{ marginTop: '20px', paddingRight: '40px' }}>
  80. <Button
  81. appearance="danger-hollow"
  82. shouldFitContainer
  83. >
  84. <Icon glyph="clear" style={{ marginRight: '5px' }} />
  85. {t('clear')}
  86. </Button>
  87. </Group>
  88. </Wrapper> */}
  89. </>
  90. );
  91. };
  92. export default FreehandOption;