Footer.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import React, { Component } from 'react';
  2. import PropTypes from 'prop-types';
  3. import { connect } from 'react-redux';
  4. import styled from 'styled-components';
  5. import ReCaptcha from './ReCaptcha';
  6. import showRecaptcha from '../../helpers/recaptcha';
  7. const Wrapper = styled.footer`
  8. width: 100%;
  9. display: flex;
  10. flex-direction: column;
  11. justify-content: center;
  12. align-items: center;
  13. padding: 4px 0 ${({ isAuthenticated }) => (isAuthenticated ? '8px' : '24px')};
  14. background-color: white;
  15. a {
  16. text-decoration: none;
  17. color: #2196f3;
  18. }
  19. `;
  20. const Text = styled.p`
  21. font-size: 13px;
  22. font-weight: 300;
  23. color: #666;
  24. @media only screen and (max-width: 768px) {
  25. font-size: 11px;
  26. }
  27. `;
  28. class Footer extends Component {
  29. componentDidMount() {
  30. showRecaptcha();
  31. }
  32. render() {
  33. return (
  34. <Wrapper isAuthenticated={this.props.isAuthenticated}>
  35. {!this.props.isAuthenticated && <ReCaptcha />}
  36. <Text>
  37. Made with love by{' '}
  38. <a href="//thedevs.network/" title="The Devs">
  39. The Devs
  40. </a>
  41. .{' | '}
  42. <a
  43. href="https://github.com/thedevs-network/kutt"
  44. title="GitHub"
  45. target="_blank" // eslint-disable-line react/jsx-no-target-blank
  46. >
  47. GitHub
  48. </a>
  49. {' | '}
  50. <a href="/terms" title="Terms of Service" target="_blank">
  51. Terms of Service
  52. </a>
  53. {' | '}
  54. <a href="/report" title="Report abuse" target="_blank">
  55. Report Abuse
  56. </a>
  57. .
  58. </Text>
  59. </Wrapper>
  60. );
  61. }
  62. }
  63. Footer.propTypes = {
  64. isAuthenticated: PropTypes.bool.isRequired,
  65. };
  66. const mapStateToProps = ({ auth: { isAuthenticated } }) => ({ isAuthenticated });
  67. export default connect(mapStateToProps)(Footer);