December 2019
Intermediate to advanced
598 pages
12h 21m
English
Let's implement the sign-out page in SignOutPage.tsx, which is similar in structure to the SignInPage component:
import React, { FC } from 'react';import { Page } from './Page';import { StatusText } from './Styles';import { useAuth } from './Auth';type SignoutAction = 'signout' | 'signout-callback';interface Props { action: SignoutAction;}export const SignOutPage: FC<Props> = ({ action }) => { let message = 'Signing out ...'; const { signOut } = useAuth(); switch (action) { case 'signout': signOut(); break; case 'signout-callback': message = 'You successfully signed out!'; break; } return ( <Page title="Sign out"> <StatusText>{message}</StatusText> </Page> );};
A slight difference is that when the component ...
Read now
Unlock full access