Skip to content

Commit

Permalink
Fix layout issues
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Oct 12, 2023
1 parent 5edcb48 commit ee92b30
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 10 deletions.
10 changes: 9 additions & 1 deletion src/app/components/ResponsiveLayer/index.tsx
Expand Up @@ -36,7 +36,15 @@ export function ResponsiveLayer(props: LayerExtendedProps) {

return (
<Layer {...props} ref={layerRef} style={{ overflowY: 'auto', ...props.style }}>
<Box fill={isMobile}>{props.children}</Box>
<Box
// Prevents Grommet flex overlap issue in smaller viewport
flex={{ shrink: 0 }}
style={{
minHeight: isMobile ? '100dvh' : 'auto',
}}
>
{props.children}
</Box>
</Layer>
)
}
Expand Up @@ -141,12 +141,13 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
display: flex;
box-sizing: border-box;
max-width: 100%;
margin-bottom: 48px;
min-width: 0;
min-height: 0;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
height: 90%;
height: 400px;
padding-top: 24px;
padding-bottom: 24px;
padding-right: 12px;
Expand Down Expand Up @@ -309,6 +310,10 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
}
@media only screen and (max-width:768px) {
}
@media only screen and (max-width:768px) {
.c2 {
border: solid 1px #0092f6;
Expand Down Expand Up @@ -346,6 +351,12 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
}
}
@media only screen and (max-width:768px) {
.c1 {
margin-bottom: 24px;
}
}
@media only screen and (max-width:768px) {
.c1 {
padding-top: 12px;
Expand Down
Expand Up @@ -26,8 +26,9 @@ exports[`<AddContact /> should match snapshot 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
width: 100%;
height: 100%;
-webkit-flex: 0 0 auto;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
}
.c6 {
Expand Down Expand Up @@ -724,6 +725,7 @@ exports[`<AddContact /> should match snapshot 1`] = `
/>
<div
class="c5"
style="min-height: 100dvh;"
>
<div
class="c6"
Expand Down
Expand Up @@ -125,12 +125,13 @@ exports[`<Contacts /> should match snapshot 1`] = `
display: flex;
box-sizing: border-box;
max-width: 100%;
margin-bottom: 48px;
min-width: 0;
min-height: 0;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
height: 90%;
height: 400px;
padding-top: 24px;
padding-bottom: 24px;
padding-right: 12px;
Expand Down Expand Up @@ -288,6 +289,10 @@ exports[`<Contacts /> should match snapshot 1`] = `
}
@media only screen and (max-width:768px) {
}
@media only screen and (max-width:768px) {
.c2 {
border: solid 1px #0092f6;
Expand Down Expand Up @@ -319,6 +324,12 @@ exports[`<Contacts /> should match snapshot 1`] = `
}
}
@media only screen and (max-width:768px) {
.c1 {
margin-bottom: 24px;
}
}
@media only screen and (max-width:768px) {
.c1 {
padding-top: 12px;
Expand Down
@@ -1,7 +1,7 @@
import { useContext, ReactNode } from 'react'
import { Box } from 'grommet/es6/components/Box'
import { ResponsiveContext } from 'grommet/es6/contexts/ResponsiveContext'
import { mobileScrollableAreaHeight, layerScrollableAreaHeight } from '../layer'
import { layerScrollableAreaHeight } from '../layer'

interface ScrollableContainerProps {
children: ReactNode
Expand All @@ -15,7 +15,8 @@ export const ScrollableContainer = ({ children }: ScrollableContainerProps) => {
gap="small"
pad={{ vertical: 'medium', right: 'small' }}
overflow={{ vertical: 'auto' }}
height={isMobile ? mobileScrollableAreaHeight : layerScrollableAreaHeight}
height={layerScrollableAreaHeight}
margin={{ bottom: isMobile ? 'large' : 'none' }}
>
{children}
</Box>
Expand Down
1 change: 0 additions & 1 deletion src/app/components/Toolbar/Features/layer.ts
@@ -1,3 +1,2 @@
export const mobileScrollableAreaHeight = '90%'
export const layerScrollableAreaHeight = '400px'
export const layerOverlayMinHeight = '435px' // Keep child modals height in sync with parent modal
Expand Up @@ -26,8 +26,9 @@ exports[`<ImportAccountsSelectionModal /> should match snapshot 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
width: 100%;
height: 100%;
-webkit-flex: 0 0 auto;
-ms-flex: 0 0 auto;
flex: 0 0 auto;
}
.c6 {
Expand Down Expand Up @@ -645,6 +646,7 @@ exports[`<ImportAccountsSelectionModal /> should match snapshot 1`] = `
/>
<div
class="c5"
style="min-height: 100dvh;"
>
<form
autocapitalize="off"
Expand Down

0 comments on commit ee92b30

Please sign in to comment.