index.tsx 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import React from 'react';
  2. import Button from '../Button';
  3. import Icon from '../Icon';
  4. import Drawer from '../Drawer';
  5. import Typography from '../Typography';
  6. import Tabs from '../Tabs';
  7. import Sliders from '../Sliders';
  8. import Divider from '../Divider';
  9. import ColorSelect from '../ColorSelector';
  10. import TextField from '../TextField';
  11. import { BtnWrapper, ContentWrapper } from './styled';
  12. import {
  13. Wrapper, Head, Body, Footer, IconWrapper,
  14. } from '../../global/sidebarStyled';
  15. import { Group, SliderWrapper } from '../../global/toolStyled';
  16. type Props = {
  17. onClick: () => void;
  18. isActive: boolean;
  19. };
  20. const TextContent = (): React.ReactElement => (
  21. <>
  22. <ContentWrapper>
  23. <Typography variant="subtitle">Content</Typography>
  24. </ContentWrapper>
  25. <TextField variant="multiline" shouldFitContainer />
  26. </>
  27. );
  28. const ImageContent = (): React.ReactElement => (
  29. <ContentWrapper>
  30. <Icon glyph="add-image" />
  31. <Button appearance="link" style={{ marginLeft: '10px' }}>Select Image</Button>
  32. </ContentWrapper>
  33. );
  34. const Watermark: React.FunctionComponent<Props> = ({
  35. onClick,
  36. isActive,
  37. }: Props) => (
  38. <>
  39. <BtnWrapper>
  40. <Button shouldFitContainer align="left" onClick={onClick}>
  41. <Icon glyph="watermark" style={{ marginRight: '10px' }} />
  42. Watermark
  43. </Button>
  44. </BtnWrapper>
  45. <Drawer open={isActive} anchor="left" zIndex={4}>
  46. <Wrapper>
  47. <Head>
  48. <IconWrapper>
  49. <Icon glyph="left-back" onClick={onClick} />
  50. </IconWrapper>
  51. <Typography light>Watermark</Typography>
  52. </Head>
  53. <Body>
  54. <Typography variant="subtitle">Type</Typography>
  55. <Tabs
  56. options={[
  57. {
  58. key: 'text',
  59. content: 'Text',
  60. child: <TextContent />,
  61. },
  62. {
  63. key: 'image',
  64. content: 'Image',
  65. child: <ImageContent />,
  66. },
  67. ]}
  68. />
  69. <Divider orientation="horizontal" style={{ margin: '20px 0' }} />
  70. <ColorSelect showTitle color="" onClick={(): void => {}} />
  71. <Typography variant="subtitle">Opacity</Typography>
  72. <Group>
  73. <SliderWrapper>
  74. <Sliders />
  75. </SliderWrapper>
  76. 40%
  77. </Group>
  78. <Divider orientation="horizontal" style={{ margin: '20px 0' }} />
  79. <Group>
  80. <Typography variant="subtitle">Page Range</Typography>
  81. <Button appearance="primary-hollow" style={{ width: '50%' }}>All Pages</Button>
  82. </Group>
  83. </Body>
  84. <Footer>
  85. <Button appearance="primary">Save</Button>
  86. <Button appearance="danger-link">Remove watermark</Button>
  87. </Footer>
  88. </Wrapper>
  89. </Drawer>
  90. </>
  91. );
  92. export default Watermark;