Skip to content

Commit

Permalink
Increase side padding to 5rem when app is in wide mode (#2613)
Browse files Browse the repository at this point in the history
* Increase side padding to 5rem when app is in wide mode

* Upload Cypress snapshot
  • Loading branch information
akrolsmir committed Jan 20, 2021
1 parent 1cff62a commit 419c858
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
6 changes: 6 additions & 0 deletions e2e/specs/st_set_page_config.spec.js
Expand Up @@ -45,4 +45,10 @@ describe("st.set_page_config", () => {
"wide"
);
});

it("displays in wide mode", () => {
cy.get("[data-testid='stReportViewContainer']").matchImageSnapshot(
"wide-mode"
);
});
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 18 additions & 10 deletions frontend/src/components/core/ReportView/styled-components.ts
Expand Up @@ -66,16 +66,24 @@ export interface StyledReportViewBlockContainerProps {

export const StyledReportViewBlockContainer = styled.div<
StyledReportViewBlockContainerProps
>(({ isWideMode, theme }) => ({
flex: 1,
width: theme.sizes.full,
paddingLeft: theme.inSidebar ? theme.spacing.none : theme.spacing.lg,
paddingRight: theme.inSidebar ? theme.spacing.none : theme.spacing.lg,
paddingTop: theme.inSidebar ? theme.spacing.none : "5rem",
paddingBottom: theme.inSidebar ? theme.spacing.none : "10rem",
minWidth: isWideMode ? "auto" : undefined,
maxWidth: isWideMode ? "initial" : theme.sizes.contentMaxWidth,
}))
>(({ isWideMode, theme }) => {
const wideSidePadding = isWideMode ? "5rem" : theme.spacing.lg
return {
flex: 1,
width: theme.sizes.full,
paddingLeft: theme.inSidebar ? theme.spacing.none : theme.spacing.lg,
paddingRight: theme.inSidebar ? theme.spacing.none : theme.spacing.lg,
// Increase side padding, if layout = wide and we're not on mobile
"@media (min-width: 576px)": {
paddingLeft: theme.inSidebar ? theme.spacing.none : wideSidePadding,
paddingRight: theme.inSidebar ? theme.spacing.none : wideSidePadding,
},
paddingTop: theme.inSidebar ? theme.spacing.none : "5rem",
paddingBottom: theme.inSidebar ? theme.spacing.none : "10rem",
minWidth: isWideMode ? "auto" : undefined,
maxWidth: isWideMode ? "initial" : theme.sizes.contentMaxWidth,
}
})

export const StyledReportViewFooterLink = styled.a(({ theme }) => ({
color: theme.colors.gray50,
Expand Down

0 comments on commit 419c858

Please sign in to comment.