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

Increase side padding to 5rem when app is in wide mode #2613

Merged
merged 2 commits into from
Jan 20, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions e2e/specs/st_set_page_config.spec.js
Original file line number Diff line number Diff line change
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"
);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to add an image snapshot. Otherwise this will always pass. You can pull it from CircleCI job

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, thanks for the clarification! I kinda assumed it would get created automatically once I pushed, didn't realize I have to manually copy it over as well.

});
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
Original file line number Diff line number Diff line change
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