index.tsx 935 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React from 'react';
  2. import Icon from '../Icon';
  3. import Typography from '../Typography';
  4. import { Container } from './styled';
  5. import { Separator } from '../../global/otherStyled';
  6. import data from './data';
  7. type Props = {
  8. onClick: (state: string) => void;
  9. navbarState: string;
  10. children: React.ReactNode;
  11. displayMode: string;
  12. fileName: string;
  13. };
  14. const Navbar: React.FC<Props> = ({
  15. onClick,
  16. navbarState,
  17. children,
  18. displayMode,
  19. fileName,
  20. }: Props) => (
  21. <Container isHidden={displayMode === 'full'}>
  22. <Typography variant="title">{fileName}</Typography>
  23. {/* <Icon glyph="edit" /> */}
  24. <Separator />
  25. {
  26. data.btnGroup.map(ele => (
  27. <Icon
  28. key={ele.key}
  29. glyph={ele.content}
  30. isActive={navbarState === ele.content}
  31. onClick={(): void => { onClick(ele.content); }}
  32. />
  33. ))
  34. }
  35. {children}
  36. </Container>
  37. );
  38. export default Navbar;