diff --git a/editor.planx.uk/src/components/PrintButton.tsx b/editor.planx.uk/src/components/PrintButton.tsx index a0d3c62e72..8b48c60a7a 100644 --- a/editor.planx.uk/src/components/PrintButton.tsx +++ b/editor.planx.uk/src/components/PrintButton.tsx @@ -1,17 +1,44 @@ import PrintIcon from "@mui/icons-material/Print"; import Button from "@mui/material/Button"; +import { styled } from "@mui/material/styles"; +import Typography from "@mui/material/Typography"; import React from "react"; +const StyledPrintButton = styled(Button)(() => ({ + "@media print": { + display: "none", + }, +})); + +const StyledTimestamp = styled(Typography)(() => ({ + display: "none", + "@media print": { + display: "block", + }, +})); + +const PrintedAt = () => { + return ( + + Printed at {new Date().toLocaleString("en-GB")} + + ); +}; + export const PrintButton = () => { return ( - + <> + } + size="large" + onClick={() => window.print()} + > + Print this page + + + + ); };