diff --git a/server/src/reports/studentReportCardReact.tsx b/server/src/reports/studentReportCardReact.tsx index ee2d5a28..80e8a680 100644 --- a/server/src/reports/studentReportCardReact.tsx +++ b/server/src/reports/studentReportCardReact.tsx @@ -133,41 +133,40 @@ const App: React.FunctionComponent = (props) => { ); }; -const headerImageStyle: React.CSSProperties = { +const repeatingImageStyle: React.CSSProperties = { width: '95%', margin: '0 2.5%', } -const Header = ({ image }: { image: Image }) => image && ( - -); - -const footerContainerStyle: React.CSSProperties = { - paddingTop: '1rem', -} -const footerImageWrapperStyle: React.CSSProperties = { - position: 'fixed', - bottom: 0, - right: 0, - width: '100%', -} -const placeHolderFooterImageWrapperStyle: React.CSSProperties = { +const placeHolderImageWrapperStyle: React.CSSProperties = { width: '100%', visibility: 'hidden', } -const footerImageStyle: React.CSSProperties = { - width: '95%', - margin: '0 2.5%', -} -const Footer = ({ image }: { image: Image }) => image && ( -
-
- -
-
- +type RepeatingPageImageEdge = 'top' | 'bottom'; +const RepeatingPageImage = ({ image, edge }: { image: Image; edge: RepeatingPageImageEdge }) => { + if (!image) return null; + + const containerStyle: React.CSSProperties = edge === 'top' ? { paddingBottom: '1rem' } : { paddingTop: '1rem' }; + const imageWrapperStyle: React.CSSProperties = { + position: 'fixed', + [edge]: 0, + right: 0, + width: '100%', + }; + + return ( +
+
+ +
+
+ +
-
-); + ); +}; + +const Header = ({ image }: { image: Image }) => ; +const Footer = ({ image }: { image: Image }) => ; const PersonalNote = ({ note }: { note: string }) => note && (

{note}