Footer.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. <a
  42. href="https://github.com/thedevs-network/kutt"
  43. title="GitHub"
  44. target="_blank" // eslint-disable-line react/jsx-no-target-blank
  45. >
  46. GitHub
  47. </a>
  48. {' | '}
  49. <a href="/terms" title="Terms of Service" target="_blank">
  50. Terms of Service
  51. </a>
  52. {' | '}
  53. <a href="/report" title="Report abuse" target="_blank">
  54. Report Abuse
  55. </a>.
  56. </Text>
  57. </Wrapper>
  58. );
  59. }
  60. }
  61. Footer.propTypes = {
  62. isAuthenticated: PropTypes.bool.isRequired,
  63. };
  64. const mapStateToProps = ({ auth: { isAuthenticated } }) => ({ isAuthenticated });
  65. export default connect(mapStateToProps)(Footer);