Refactor TemplatePreview for Improved Layout and Responsiveness

- Replaced a div with a Flex component to enhance layout and alignment of the TemplatePreview.
- Adjusted styles to ensure minimum width and proper cursor behavior during panning.
- Streamlined iframe rendering within the new structure for better responsiveness and user experience.
This commit is contained in:
Tom Butcher 2026-08-22 13:11:49 +01:00
parent 47e4e60b86
commit fb52a14dd0

View File

@ -613,12 +613,25 @@ const TemplatePreview = ({
cursor: panMode ? (isPanning ? 'grabbing' : 'grab') : undefined, cursor: panMode ? (isPanning ? 'grabbing' : 'grab') : undefined,
touchAction: panMode ? 'none' : undefined touchAction: panMode ? 'none' : undefined
}} }}
>
<Flex
justify='center'
align='center'
style={{
minWidth: '100%',
width: iframeSize.width,
height: iframeSize.height
}}
> >
<div <div
style={{ style={{
width: iframeSize.width, width: iframeSize.width,
height: iframeSize.height, height: iframeSize.height,
cursor: panMode ? (isPanning ? 'grabbing' : 'grab') : undefined cursor: panMode
? isPanning
? 'grabbing'
: 'grab'
: undefined
}} }}
> >
<iframe <iframe
@ -637,6 +650,7 @@ const TemplatePreview = ({
}} }}
/> />
</div> </div>
</Flex>
</ScrollBox> </ScrollBox>
) : ( ) : (
<PDFViewer <PDFViewer