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

Add button for printing secretkey backup sheet #1146

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Remove blue stripe shown on top
  • Loading branch information
ebma committed Nov 9, 2020
commit 49cef4e98729a580b8e6d9018871faff26202dd5
12 changes: 11 additions & 1 deletion src/Layout/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import { makeStyles } from "@material-ui/core"
import { Box, BoxProps } from "./Box"
import { useIsMobile } from "~Generic/hooks/userinterface"
import { primaryBackground } from "~App/theme"
Expand Down Expand Up @@ -51,8 +52,17 @@ interface SectionProps extends BoxProps {
top?: boolean
}

const useStyles = makeStyles(() => ({
background: {
"@media print": {
background: "white !important"
}
}
}))

const Section = React.memo(function Section(props: SectionProps) {
const background = props.brandColored ? primaryBackground : props.backgroundColor || "#fcfcfc"
const classes = useStyles()
const isSmallScreen = useIsMobile()

const padding: React.CSSProperties["padding"] = props.noPadding ? 0 : props.padding !== undefined ? props.padding : 16
Expand All @@ -72,7 +82,7 @@ const Section = React.memo(function Section(props: SectionProps) {
const MaybeInset = props.pageInset ? PageInset : React.Fragment

return (
<Box {...props} component="section" padding={padding} style={style}>
<Box {...props} className={classes.background} component="section" padding={padding} style={style}>
{props.top ? <TopOfTopSection background={background} /> : null}
{/* Add a little padding to the top if window is frameless */}
{props.top && !isSmallScreen ? <div style={{ width: "100%", padding: "4px 0 0", margin: 0 }} /> : null}
Expand Down