fix(auth): center home and login layouts with full viewport height
Release / build-and-push (push) Successful in 41s

- Remove content margins when logged out in App
- Switch Home to minH 100dvh full width
- Center LoginForm vertically in full-height flex layout
- Tidy Create Game button padding and border
This commit is contained in:
John O'Keefe
2026-09-08 20:25:38 -04:00
parent 315c22de65
commit 5d726595fc
4 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ function App() {
<> <>
<ToastContainer position='bottom-right' hideProgressBar /> <ToastContainer position='bottom-right' hideProgressBar />
{loggedIn ? <Header /> : ''} {loggedIn ? <Header /> : ''}
<Box mt={loadedPreferences.get().stickyNav ? "20" : "4"} mb={'4'}> <Box mt={loggedIn ? (loadedPreferences.get().stickyNav ? "20" : "4") : "0"} mb={loggedIn ? '4' : '0'}>
{/*<Box mt={loadedPreferences.get().stickyNav ? isSmallerThan768 ? "15%" : "9%" : "4"} mb={'4'}>*/} {/*<Box mt={loadedPreferences.get().stickyNav ? isSmallerThan768 ? "15%" : "9%" : "4"} mb={'4'}>*/}
<Routes> <Routes>
<Route path='/*' element={loggedIn ? <Navigate to='games' /> : <Home />} /> <Route path='/*' element={loggedIn ? <Navigate to='games' /> : <Home />} />
+3 -2
View File
@@ -191,9 +191,10 @@ export default function NavBar() {
colorPalette={'blue'} colorPalette={'blue'}
size={'md'} size={'md'}
asChild asChild
w={'70%'} px={4}
borderWidth={0}
> >
<RouteLink to="/games/create"><LuPlus/> <Text mt="1">Create Game</Text></RouteLink> <RouteLink to="/games/create"><LuPlus/><Text mt="1">Create Game</Text></RouteLink>
</Button> </Button>
<Separator/> <Separator/>
<Heading as={'h3'} size={'md'}>Keyboard Shortcuts</Heading> <Heading as={'h3'} size={'md'}>Keyboard Shortcuts</Heading>
+1 -1
View File
@@ -4,7 +4,7 @@ import { VStack, Image, Button, Heading, Flex, Center } from '@chakra-ui/react'
const Home = () => { const Home = () => {
return ( return (
<Flex align={'center'} bgImage={'linear-gradient(to bottom right, #314755, #26a0da)'} height={'100vh'}> <Flex align={'center'} bgImage={'linear-gradient(to bottom right, #314755, #26a0da)'} minH={'100dvh'} w={'100%'}>
<Center w={'100%'}> <Center w={'100%'}>
<VStack gap={4} align={'center'} margin={'auto'}> <VStack gap={4} align={'center'} margin={'auto'}>
<Image src="/assets/Logo.svg" alt="Games Database Logo"/> <Image src="/assets/Logo.svg" alt="Games Database Logo"/>
+6 -5
View File
@@ -5,7 +5,7 @@ import { login } from '../../stateManagement/userState'
import { import {
Container, Container,
Button, Button,
Input, HStack, Center, Input, Center, Flex,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import {Field} from '../ui/field' import {Field} from '../ui/field'
import {useColorModeValue} from '../ui/color-mode' import {useColorModeValue} from '../ui/color-mode'
@@ -35,7 +35,8 @@ export default function LoginForm() {
) )
return ( return (
<Container style={{ marginTop: '7rem', paddingBottom: '5rem' }}> <Flex minH={'100dvh'} w={'100%'} align={'center'} justify={'center'}>
<Container maxW={'md'} w={'full'} py={'4'}>
<form onSubmit={onSubmit}> <form onSubmit={onSubmit}>
<Field label="Email" invalid={Boolean(errors.email)} errorText={errors.email?.type === 'required' ? errors.email.message?.toString() : errors.email?.type === 'pattern' ? 'Invalid Email Address' : undefined} mb={'3'}> <Field label="Email" invalid={Boolean(errors.email)} errorText={errors.email?.type === 'required' ? errors.email.message?.toString() : errors.email?.type === 'pattern' ? 'Invalid Email Address' : undefined} mb={'3'}>
<Input <Input
@@ -65,8 +66,7 @@ export default function LoginForm() {
{...register('password', { required: 'You must specify a password' })} {...register('password', { required: 'You must specify a password' })}
/> />
</Field> </Field>
<br/> <Center mt={'6'}>
<HStack>
<Button <Button
type="submit" type="submit"
colorPalette="blue" colorPalette="blue"
@@ -75,11 +75,12 @@ export default function LoginForm() {
> >
Submit Submit
</Button> </Button>
</HStack> </Center>
<Center mt={'5rem'}> <Center mt={'5rem'}>
<Button asChild variant="outline"><Link to={'/forgotpassword'}>Forgot Password</Link></Button> <Button asChild variant="outline"><Link to={'/forgotpassword'}>Forgot Password</Link></Button>
</Center> </Center>
</form> </form>
</Container> </Container>
</Flex>
) )
} }