Skip to content

Commit

Permalink
Make headers taller and fix background
Browse files Browse the repository at this point in the history
  • Loading branch information
ericboucher committed Sep 9, 2024
1 parent c477d64 commit a02b7f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
30 changes: 9 additions & 21 deletions apps/frontend/components/DisasterTable/DisasterTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const DisasterTable = ({
getRowId,
isEditable,
variant,
columnHeaderHeight = 'normal',
columnHeaderHeight = 'large',
getRowClassName,
}: DisasterTableProps): JSX.Element => {
const theme = useTheme();
Expand Down Expand Up @@ -212,12 +212,6 @@ export const DisasterTable = ({
onMouseLeave={() => setHovering(false)}
sx={{
overflow: 'scroll',
'@media print': {
transform: `scale(${scaleFactor})`,
transformOrigin: 'top left',
overflow: 'unset',
breakInside: 'avoid',
},
}}
>
{/* Adds padding for printing */}
Expand All @@ -229,23 +223,13 @@ export const DisasterTable = ({
},
}}
/>
<Stack
direction="row"
position="relative"
m={2}
mt={0}
sx={{
'@media print': {
breakInside: 'avoid',
},
}}
>
<Stack direction="row" position="relative" m={2} mt={0}>
{/* Adds padding for printing */}
<Box
sx={{
'@media print': {
minWidth: '2rem',
minHeight: '100% ',
minHeight: '100%',
},
}}
/>
Expand Down Expand Up @@ -281,6 +265,11 @@ export const DisasterTable = ({
<Box width={totalWidth}>
<DataGrid
sx={{
'@media print': {
transform: `scale(${scaleFactor})`,
transformOrigin: 'top left',
overflow: 'unset',
},
'& .MuiDataGrid-row.highlight-1': {
background: `${colors.color1}`,
},
Expand Down Expand Up @@ -342,7 +331,6 @@ export const DisasterTable = ({
'& .MuiDataGrid-scrollbar': {
overflow: 'hidden',
},
breakInside: 'avoid',
borderTop: variant === 'bordered' ? undefined : 'none',
borderColor: colors.gray,
'& .MuiDataGrid-cell:focus-within': {
Expand Down Expand Up @@ -383,7 +371,7 @@ export const DisasterTable = ({
sx={{
'@media print': {
minWidth: '2rem',
minHeight: '100% ',
minHeight: '100%',
},
}}
/>
Expand Down
8 changes: 2 additions & 6 deletions apps/frontend/components/PrintWrapper/PrintWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const printStyles = (
'@media print': {
'html, body': {
fontSize: '0.9em',
background: 'white !important',
},
},
'@page': {
Expand All @@ -22,12 +23,7 @@ interface Props {
}
export const PrintWrapper = ({ printRef, children }: Props): JSX.Element => {
return (
<Box
ref={printRef}
sx={{
background: 'white',
}}
>
<Box ref={printRef}>
<Box
sx={{
'@media print': {
Expand Down

0 comments on commit a02b7f9

Please sign in to comment.