-
Notifications
You must be signed in to change notification settings - Fork 2
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 #34 from uwblueprint/kenzy/login-page
Style login page
- Loading branch information
Showing
6 changed files
with
49 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,11 +1,23 @@ | ||
// importing from next-auth/react instead of our root's auth.ts because of Client & Server component issues. | ||
// https://authjs.dev/getting-started/session-management/login | ||
import { signIn } from 'next-auth/react'; | ||
import { Button } from '@chakra-ui/react'; | ||
import { FcGoogle } from 'react-icons/fc'; | ||
|
||
export function SignInButton() { | ||
export function SignInButton(): JSX.Element { | ||
return ( | ||
<button onClick={() => signIn('google', { callbackUrl: `/homepage` })}> | ||
Sign In Google | ||
</button> | ||
<Button | ||
variant="outline" | ||
borderColor="blue.400" | ||
colorScheme="gray" | ||
width="275px" | ||
height="45px" | ||
color="text" | ||
fontWeight="bold" | ||
leftIcon={<FcGoogle fontSize="18px" />} | ||
onClick={() => signIn('google', { callbackUrl: `/homepage` })} | ||
> | ||
Sign in with Google | ||
</Button> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Image } from '@chakra-ui/react'; | ||
|
||
export function SistemaLogoColour() { | ||
return ( | ||
<Image src="/images/sistema_logo_colour.png" alt="Sistema Logo Colour" /> | ||
); | ||
} |
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,18 +1,19 @@ | ||
import { SignInButton } from '../components/SignInButton'; | ||
import { SignOutButton } from '../components/SignOutButton'; | ||
import { useSession } from 'next-auth/react'; | ||
import { SistemaLogoColour } from '../components/SistemaLogoColour'; | ||
import { Box, Flex, Text } from '@chakra-ui/react'; | ||
|
||
export default function Index() { | ||
const session = useSession(); | ||
export default function Index(): JSX.Element { | ||
return ( | ||
<> | ||
<Flex direction="column" align="center" justify="center" height="100vh"> | ||
<Box width="280px" height="auto" mb="5"> | ||
<SistemaLogoColour /> | ||
</Box> | ||
|
||
<Text color="text" fontSize="small" mb="3"> | ||
Only sign in with a Sistema email. | ||
</Text> | ||
|
||
<SignInButton /> | ||
<br /> | ||
<SignOutButton /> | ||
<br /> | ||
<pre className="py-6 px-4 whitespace-pre-wrap break-all"> | ||
{JSON.stringify(session, null, 2)} | ||
</pre> | ||
</> | ||
</Flex> | ||
); | ||
} |