-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from jbrunton/home-page
feat: home page
- Loading branch information
Showing
4 changed files
with
45 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
import { Alert, Button, Center, Container, Flex } from '@chakra-ui/react' | ||
import React from 'react' | ||
import { useAuth } from './auth' | ||
import { LoadingIndicator } from '../shared/molecules/LoadingIndicator' | ||
import { RoomSelector } from '../shared/navigation/organisms/RoomSelector' | ||
|
||
export const HomePage = () => { | ||
return <p>Home</p> | ||
const { isAuthenticated, isLoading, signIn } = useAuth() | ||
if (isLoading) { | ||
return <LoadingIndicator /> | ||
} | ||
return ( | ||
<Center height='100%'> | ||
<Container maxWidth='container.lg'> | ||
<Alert status='info' variant='top-accent' p='10'> | ||
{isAuthenticated ? ( | ||
<Flex flexDirection='column'> | ||
<RoomSelector /> | ||
</Flex> | ||
) : ( | ||
<span> | ||
<Button variant='link' onClick={signIn}> | ||
Sign in | ||
</Button>{' '} | ||
to get started. | ||
</span> | ||
)} | ||
</Alert> | ||
</Container> | ||
</Center> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters