index.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import React from 'react';
  2. import Icon from '../Icon';
  3. import Button from '../Button';
  4. import Typography from '../Typography';
  5. import ExpansionPanel from '../ExpansionPanel';
  6. import Sliders from '../Sliders';
  7. import ColorSelect from '../ColorSelector';
  8. import SelectBox from '../SelectBox';
  9. import {
  10. Wrapper, Group, Item, SliderWrapper,
  11. } from '../../global/toolStyled';
  12. import { fontOptions, sizeOptions } from './data';
  13. type Props = {
  14. isActive: boolean;
  15. onClick: () => void;
  16. };
  17. const TextTools: React.FunctionComponent<Props> = ({
  18. isActive,
  19. onClick,
  20. }: Props) => (
  21. <ExpansionPanel
  22. label={(
  23. <Button
  24. shouldFitContainer
  25. align="left"
  26. onClick={onClick}
  27. isActive={isActive}
  28. >
  29. <Icon glyph="text" style={{ marginRight: '10px' }} />
  30. Text
  31. </Button>
  32. )}
  33. isActive={isActive}
  34. >
  35. <Wrapper>
  36. <Typography variant="subtitle" style={{ marginTop: '8px' }}>Fonts</Typography>
  37. <Group>
  38. <SelectBox options={fontOptions} />
  39. <Item size="small">
  40. <Icon glyph="bold" />
  41. </Item>
  42. <Item size="small">
  43. <Icon glyph="italic" />
  44. </Item>
  45. </Group>
  46. </Wrapper>
  47. <Wrapper width="40%">
  48. <Typography variant="subtitle" style={{ marginTop: '8px' }}>Size</Typography>
  49. <Group>
  50. <SelectBox options={sizeOptions} />
  51. </Group>
  52. </Wrapper>
  53. <Wrapper width="60%">
  54. <Typography variant="subtitle" style={{ marginTop: '8px' }}>Align</Typography>
  55. <Group>
  56. <Item size="small">
  57. <Icon glyph="align-left" />
  58. </Item>
  59. <Item size="small">
  60. <Icon glyph="align-center" />
  61. </Item>
  62. <Item size="small">
  63. <Icon glyph="align-right" />
  64. </Item>
  65. </Group>
  66. </Wrapper>
  67. <Wrapper>
  68. <ColorSelect showTitle color="" onClick={(): void => {}} />
  69. </Wrapper>
  70. <Wrapper>
  71. <Typography variant="subtitle" style={{ marginTop: '8px' }}>Opacity</Typography>
  72. <Group>
  73. <SliderWrapper>
  74. <Sliders />
  75. </SliderWrapper>
  76. 40%
  77. </Group>
  78. </Wrapper>
  79. </ExpansionPanel>
  80. );
  81. export default TextTools;