Guest User

Untitled

a guest
Feb 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. /**
  2. *
  3. * HeaderThemesInner
  4. *
  5. */
  6.  
  7. import React, { PropTypes } from 'react';
  8. import styled from 'styled-components';
  9. import ThemesItem from './ThemesItem';
  10.  
  11. export default class HeaderThemes extends React.Component { // eslint-disable-line react/prefer-stateless-function
  12. componentDidMount() {
  13. const Overlay = `
  14. position: fixed;
  15. top: 0;
  16. right: 0;
  17. bottom: 0;
  18. left: 0;
  19. z-index: 10;
  20. background: rgba(0, 51, 51, 0.8);
  21. animation-duration: .3s;
  22. animation-fill-mode: both;
  23. display: flex;
  24. margin: 0;
  25. padding: 100px 0 0 0;
  26. flex-direction: column;
  27. color: white;
  28. font-family: 'Mosk';
  29. justify-content: space-around;
  30. `;
  31.  
  32. const OverlayIn = styled.ul`
  33. ${Overlay}
  34. animation-name: fadeInDown;
  35. `;
  36.  
  37. const OverlayOut = styled.ul`
  38. ${Overlay}
  39. animation-name: fadeOutUp;
  40. `;
  41. }
  42.  
  43. render() {
  44. const { active, themes, themesList } = this.props;
  45.  
  46. if (active) {
  47. return (
  48. <OverlayIn>{themesList}</OverlayIn>
  49. );
  50. } else if (active === false) {
  51. return (
  52. <OverlayOut>{themesList}</OverlayOut>
  53. );
  54. }
  55. return null;
  56. }
  57. }
  58.  
  59. HeaderThemes.propTypes = {
  60. active: PropTypes.bool,
  61. themesList: PropTypes.any,
  62. themes: PropTypes.any,
  63. };
Add Comment
Please, Sign In to add comment