aboutsummaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/LoginPage/LoginPage.tsx23
-rw-r--r--src/pages/RegistrationPage/RegistrationPage.tsx27
2 files changed, 46 insertions, 4 deletions
diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx
index 367ed6b..2bc7e5a 100644
--- a/src/pages/LoginPage/LoginPage.tsx
+++ b/src/pages/LoginPage/LoginPage.tsx
@@ -23,6 +23,15 @@ const useStyles = makeStyles(theme => ({
formHeader: {
textAlign: 'center',
fontSize: 25
+ },
+ formTransfer: {
+ display: 'flex',
+ justifyContent: 'center'
+ },
+ transferButton: {
+ marginLeft: 10,
+ color: 'green',
+ cursor: 'pointer'
}
}));
@@ -50,7 +59,9 @@ const LoginPage: React.FC = () => {
}
};
- // TODO: Add registration redirect
+ const handleRegistration = () => {
+ history.push('/registration');
+ };
return (
<>
@@ -74,6 +85,16 @@ const LoginPage: React.FC = () => {
/>
<Button variant="contained" onClick={handleSubmit}>submit</Button>
</form>
+ <div className={classes.formTransfer}>
+ <div>{'Don\'t have an account?'}</div>
+ <span
+ onClick={handleRegistration}
+ className={classes.transferButton}
+ role="presentation"
+ >
+ Sign up
+ </span>
+ </div>
</>
);
};
diff --git a/src/pages/RegistrationPage/RegistrationPage.tsx b/src/pages/RegistrationPage/RegistrationPage.tsx
index 9e081ca..8936c2d 100644
--- a/src/pages/RegistrationPage/RegistrationPage.tsx
+++ b/src/pages/RegistrationPage/RegistrationPage.tsx
@@ -21,6 +21,15 @@ const useStyles = makeStyles(theme => ({
formHeader: {
textAlign: 'center',
fontSize: 25
+ },
+ formTransfer: {
+ display: 'flex',
+ justifyContent: 'center'
+ },
+ transferButton: {
+ marginLeft: 10,
+ color: 'green',
+ cursor: 'pointer'
}
}));
@@ -33,7 +42,7 @@ const RegistrationPage: React.FC = () => {
const { login } = useAuth();
const history = useHistory();
- const onClick = () => {
+ const handleSubmit = () => {
const username = usernameRef.current?.value;
const password = passwordRef.current?.value;
const email = emailRef.current?.value;
@@ -44,7 +53,9 @@ const RegistrationPage: React.FC = () => {
} else setError(true);
};
- // TODO: add login redirect
+ const handleLogin = () => {
+ history.push('/login');
+ };
return (
<>
@@ -66,8 +77,18 @@ const RegistrationPage: React.FC = () => {
error={error}
helperText={error && 'This field is required!'}
/>
- <Button variant="contained" onClick={onClick}>submit</Button>
+ <Button variant="contained" onClick={handleSubmit}>submit</Button>
</form>
+ <div className={classes.formTransfer}>
+ <div>{'Already have an account?'}</div>
+ <span
+ onClick={handleLogin}
+ className={classes.transferButton}
+ role="presentation"
+ >
+ Log in
+ </span>
+ </div>
</>
);
};