Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix layout issues #1713

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/app/components/ResponsiveLayer/index.tsx
Original file line number Diff line number Diff line change
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 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched to maxHeight. Seems better now.

style={{
minHeight: isMobile ? '100dvh' : 'auto',
}}
>
{props.children}
</Box>
</Layer>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ 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%;
padding-top: 24px;
padding-bottom: 24px;
padding-right: 12px;
Expand Down Expand Up @@ -309,6 +309,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 +350,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 All @@ -371,6 +381,7 @@ exports[`<AccountSelector /> should match snapshot 1`] = `
>
<div
class="c1"
style="max-height: 400px;"
>
<div
aria-checked="false"
Expand Down
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ 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%;
padding-top: 24px;
padding-bottom: 24px;
padding-right: 12px;
Expand Down Expand Up @@ -288,6 +288,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 +323,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 All @@ -342,6 +352,7 @@ exports[`<Contacts /> should match snapshot 1`] = `
>
<div
class="c1"
style="max-height: 400px;"
>
<div
aria-checked="false"
Expand Down
Original file line number Diff line number Diff line change
@@ -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}
style={{ maxHeight: layerScrollableAreaHeight }}
margin={{ bottom: isMobile ? 'large' : 'none' }}
>
{children}
</Box>
Expand Down
1 change: 0 additions & 1 deletion src/app/components/Toolbar/Features/layer.ts
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Loading