Skip to content

Commit

Permalink
Merge pull request #270 from smorton-planview/FixFor223
Browse files Browse the repository at this point in the history
fix:  shouldForwardProp should be used for passing transient props in styled-components
  • Loading branch information
cyntler authored Jun 7, 2024
2 parents 7b8f7ce + 8c042d0 commit 8a2b9e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/renderers/pdf/components/pages/PDFSinglePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const PDFSinglePage: FC<Props> = ({ pageNum }) => {

const rendererRect = mainState?.rendererRect || null;

const _pageNum = pageNum || currentPage;
const _pageNum = pageNum ?? currentPage;

return (
<PageWrapper id="pdf-page-wrapper" last={_pageNum >= numPages}>
<PageWrapper id="pdf-page-wrapper" $lastPage={_pageNum >= numPages}>
{!paginated && (
<PageTag id="pdf-page-info">
{t("pdfPluginPageNumber", {
Expand All @@ -32,8 +32,8 @@ const PDFSinglePage: FC<Props> = ({ pageNum }) => {
<Page
pageNumber={_pageNum || currentPage}
scale={zoomLevel}
height={(rendererRect?.height || 100) - 100}
width={(rendererRect?.width || 100) - 100}
height={(rendererRect?.height ?? 100) - 100}
width={(rendererRect?.width ?? 100) - 100}
loading={t("pdfPluginLoading")}
/>
</PageWrapper>
Expand All @@ -43,11 +43,11 @@ const PDFSinglePage: FC<Props> = ({ pageNum }) => {
export default PDFSinglePage;

interface PageWrapperProps {
last?: boolean;
$lastPage: boolean;
}

const PageWrapper = styled.div<PageWrapperProps>`
margin: 20px 0;
margin: ${(props) => (props.$lastPage ? "20px 0" : undefined)};
`;

const PageTag = styled.div`
Expand Down

0 comments on commit 8a2b9e6

Please sign in to comment.