Footer.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. 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"
  46. >
  47. GitHub
  48. </a>
  49. {' | '}
  50. <a href="/terms" title="Terms of Service">
  51. Terms of Service
  52. </a>
  53. {' | '}
  54. <a href="/report" title="Report abuse">
  55. Report Abuse
  56. </a>
  57. {process.env.CONTACT_EMAIL && (
  58. <Fragment>
  59. {' | '}
  60. <a href={`mailto:${process.env.CONTACT_EMAIL}`} title="Contact us">
  61. Contact us
  62. </a>
  63. </Fragment>
  64. )}
  65. .
  66. </Text>
  67. </Wrapper>
  68. );
  69. }
  70. }
  71. Footer.propTypes = {
  72. isAuthenticated: PropTypes.bool.isRequired,
  73. };
  74. const mapStateToProps = ({ auth: { isAuthenticated } }) => ({ isAuthenticated });
  75. export default connect(mapStateToProps)(Footer);