index.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React from 'react';
  2. import Icon from '../Icon';
  3. import Typography from '../Typography';
  4. import Search from '../Search';
  5. import Annotations from '../Annotations';
  6. import Thumbnails from '../Thumbnails';
  7. import { Wrapper } from './styled';
  8. import { Separator } from '../../global/otherStyled';
  9. import data from './data';
  10. type Props = {
  11. onClick: (state: string) => void;
  12. navbarState: string;
  13. };
  14. const Navbar: React.FunctionComponent<Props> = ({
  15. onClick,
  16. navbarState,
  17. }) => {
  18. return (
  19. <Wrapper>
  20. <Typography variant="title">Title</Typography>
  21. <Icon glyph="edit" />
  22. <Separator />
  23. {
  24. data.btnGroup.map((ele) => (
  25. <Icon
  26. key={ele.key}
  27. glyph={ele.content}
  28. isActive={navbarState === ele.content}
  29. onClick={() => { onClick(ele.content); }}
  30. />
  31. ))
  32. }
  33. <Search isActive={navbarState === 'search'} close={() => { onClick(''); }} />
  34. <Annotations isActive={navbarState === 'annotation'} />
  35. <Thumbnails isActive={navbarState === 'thumbnail'} />
  36. </Wrapper>
  37. );
  38. };
  39. export default Navbar;