Footer.js 2.0 KB

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