import React, { FC, useEffect } from 'react'; import { connect } from 'react-redux'; import styled from 'styled-components'; import { Flex } from 'reflexbox/styled-components'; import ReCaptcha from './ReCaptcha'; import showRecaptcha from '../helpers/recaptcha'; import { ifProp } from 'styled-tools'; interface Props { isAuthenticated: boolean; } const Wrapper = styled(Flex).attrs({ as: 'footer', width: 1, flexDirection: 'column', justifyContent: 'center', alignItems: 'center', })` padding: 4px 0 ${ifProp('isAuthenticated', '8px', '24px')}; background-color: white; a { text-decoration: none; color: #2196f3; } `; const Text = styled.p` font-size: 13px; font-weight: 300; color: #666; @media only screen and (max-width: 768px) { font-size: 11px; } `; const Footer: FC = ({ isAuthenticated }) => { useEffect(() => { showRecaptcha(); }, []); return ( {!isAuthenticated && } Made with love by{' '} The Devs .{' | '} GitHub {' | '} Terms of Service {' | '} Report Abuse {process.env.CONTACT_EMAIL && ( <> {' | '} Contact us )} . ); }; const mapStateToProps = ({ auth: { isAuthenticated } }) => ({ isAuthenticated, }); export default connect(mapStateToProps)(Footer);