Guest User

Untitled

a guest
Jun 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. // @flow
  2. import React from 'react';
  3. import injectSheet from 'react-jss';
  4. import classNames from 'classnames';
  5. import styles from './styles';
  6.  
  7. // In-house modules
  8. import CategoryItem from './components/CategoryItem';
  9.  
  10. type Props = {
  11. classes: Object,
  12. categories: Array<Object>,
  13. selectedCategory: Object,
  14. selectCategory: () => void,
  15. downloads: Array<Object>,
  16. openDownloads: boolean,
  17. }
  18.  
  19. function CategoriesBar({
  20. classes,
  21. categories,
  22. selectedCategory,
  23. selectCategory,
  24. downloads,
  25. openDownloads,
  26. }: Props) {
  27. return (
  28. <div className={ classes.categoriesBar }>
  29. <div className={ classNames({
  30. 'categories-bar-container': true,
  31. 'download-bar-open': openDownloads,
  32. 'download-bar-pendings': downloads.length > 0 && !openDownloads,
  33. }) }>
  34. {
  35. categories.length ? categories.map((category) => {
  36. return (
  37. <CategoryItem { ...{
  38. key: category.id,
  39. category,
  40. selectedCategory,
  41. selectCategory } } />
  42. );
  43. }) : <p className="no-found medium-title-black">No content found on this channel</p>
  44. }
  45. </div>
  46. </div>
  47. );
  48. }
  49.  
  50. export default injectSheet(styles)(CategoriesBar);
Add Comment
Please, Sign In to add comment