index.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import React from 'react';
  2. import Button from '../Button';
  3. import Icon from '../Icon';
  4. import ExpansionPanel from '../ExpansionPanel';
  5. import { BtnWrapper } from '../../global/toolStyled';
  6. type Props = {
  7. sidebarState: string;
  8. onClick: (state: string) => void;
  9. };
  10. const CreateForm: React.FunctionComponent<Props> = ({
  11. onClick,
  12. sidebarState,
  13. }) => {
  14. return (
  15. <ExpansionPanel
  16. label={
  17. <Button shouldFitContainer align="left" onClick={() => { onClick('create-form'); }}>
  18. <Icon glyph="create-form" style={{marginRight: '10px'}}/>
  19. Create Form
  20. </Button>
  21. }
  22. isActive={sidebarState === 'create-form'}
  23. >
  24. <BtnWrapper>
  25. <Button shouldFitContainer align="left">
  26. <Icon glyph="text-field" style={{marginRight: '10px'}}/>
  27. Text Field
  28. </Button>
  29. </BtnWrapper>
  30. <BtnWrapper>
  31. <Button shouldFitContainer align="left">
  32. <Icon glyph="checkbox" style={{marginRight: '10px'}}/>
  33. Check box
  34. </Button>
  35. </BtnWrapper>
  36. <BtnWrapper>
  37. <Button shouldFitContainer align="left">
  38. <Icon glyph="radio-button" style={{marginRight: '10px'}}/>
  39. Radio Button
  40. </Button>
  41. </BtnWrapper>
  42. </ExpansionPanel>
  43. );
  44. };
  45. export default CreateForm;