import React from 'react'; import { useMemo } from 'react'; import { Route } from 'react-router-dom'; import styled from 'styled-components'; import AnimatedSwitch from '../AnimatedSwitch'; import SignInForm from './SignInForm'; import SignUpForm from './SignUpForm'; import { RouteComponentProps } from 'react-router-dom'; const Container = styled.div` background: radial-gradient(rgb(34, 65, 67), rgb(17, 48, 50)), url(/assets/chat-background.jpg) no-repeat; background-size: cover; background-blend-mode: multiply; color: white; `; const Intro = styled.div` height: 265px; `; const Icon = styled.img` width: 125px; height: auto; margin-left: auto; margin-right: auto; padding-top: 70px; display: block; `; const Title = styled.h2` width: 100%; text-align: center; color: white; `; // eslint-disable-next-line const Alternative = styled.div` position: fixed; bottom: 10px; left: 10px; label { color: var(--secondary-bg); } `; const AuthScreen: React.FC> = ({ history, location, }) => { const alternative = useMemo(() => { if (location.pathname === '/sign-in') { const handleSignUp = () => { history.replace('/sign-up'); }; return ( Don't have an account yet?{' '} ); } else { const handleSignIn = () => { history.replace('/sign-in'); }; return ( Already have an accout? ); } }, [location.pathname, history]); return ( WhatsApp {alternative} ); }; export default AuthScreen;