Fix height issue with unauthenticated app related screens

This commit is contained in:
Leonardo Murça 2022-09-14 15:42:31 -03:00
parent fe98115394
commit be453c1156
4 changed files with 21 additions and 7 deletions

View file

@ -7,7 +7,7 @@ import UnauthenticatedHome from '../screens/UnauthenticatedHome';
function UnauthenticatedApp() { function UnauthenticatedApp() {
return ( return (
<Container maxWidth="false" sx={container}> <Container disableGutters maxWidth="false" sx={container}>
<Routes> <Routes>
<Route path="/" element={<UnauthenticatedHome />} /> <Route path="/" element={<UnauthenticatedHome />} />
<Route path="/login" element={<Login />} /> <Route path="/login" element={<Login />} />
@ -19,7 +19,7 @@ function UnauthenticatedApp() {
} }
const container = { const container = {
height: '100vh', height: 'auto',
margin: 0, margin: 0,
padding: 0, padding: 0,
display: 'flex', display: 'flex',

View file

@ -1,4 +1,3 @@
import { Fragment } from 'react';
import { import {
Box, Box,
Button, Button,
@ -28,10 +27,11 @@ function View({
error, error,
layoutType, layoutType,
}) { }) {
const { paper, boxLogo, boxForm, logoContainer } = styles[layoutType]; const { container, paper, boxLogo, boxForm, logoContainer } =
styles[layoutType];
return ( return (
<Fragment> <Container disableGutters sx={container}>
<Paper sx={paper} elevation={4} variant="elevation"> <Paper sx={paper} elevation={4} variant="elevation">
<Box sx={boxLogo}> <Box sx={boxLogo}>
<Container sx={logoContainer}> <Container sx={logoContainer}>
@ -82,7 +82,7 @@ function View({
severity="error" severity="error"
message={error && error.message} message={error && error.message}
/> />
</Fragment> </Container>
); );
} }

View file

@ -1,4 +1,12 @@
// ========== Desktop ========== // ========== Desktop ==========
const desktopContainer = {
width: '100%',
height: '100vh',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
};
const desktopPaper = { const desktopPaper = {
width: '950px', width: '950px',
height: '500px', height: '500px',
@ -39,6 +47,7 @@ const desktopBoxForm = {
const logoContainerDesktop = {}; const logoContainerDesktop = {};
const desktop = { const desktop = {
container: desktopContainer,
paper: desktopPaper, paper: desktopPaper,
boxLogo: desktopBoxLogo, boxLogo: desktopBoxLogo,
boxForm: desktopBoxForm, boxForm: desktopBoxForm,
@ -46,6 +55,8 @@ const desktop = {
}; };
// ========== Mobile ========== // ========== Mobile ==========
const mobileContainer = { ...desktopContainer };
const mobilePaper = { const mobilePaper = {
...desktopPaper, ...desktopPaper,
flexDirection: 'column', flexDirection: 'column',
@ -71,6 +82,7 @@ const logoContainerMobile = {
}; };
const mobile = { const mobile = {
container: mobileContainer,
paper: mobilePaper, paper: mobilePaper,
boxLogo: mobileBoxLogo, boxLogo: mobileBoxLogo,
boxForm: mobileBoxForm, boxForm: mobileBoxForm,
@ -79,6 +91,7 @@ const mobile = {
// ========== Unset ========== // ========== Unset ==========
const unset = { const unset = {
container: null,
paper: null, paper: null,
boxLogo: null, boxLogo: null,
boxForm: null, boxForm: null,

View file

@ -38,8 +38,9 @@ function View({
return ( return (
<Container <Container
sx={{ sx={{
height: 'auto',
margin: '0 auto', margin: '0 auto',
padding: '500px 0', padding: '100px 0',
}} }}
disableGutters disableGutters
> >