mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 16:52:38 +00:00
remove "makeZoom" function
The makeZoom function is redundant if we just insert the style a little further down when the `.pages` div is initialized, as a `style` attribute on the tag.
This commit is contained in:
@@ -231,19 +231,6 @@ const BrewRenderer = (props)=>{
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const makeZoom = () => {
|
|
||||||
|
|
||||||
return(
|
|
||||||
<style id='zoomStyle'>
|
|
||||||
{`
|
|
||||||
.pages {
|
|
||||||
zoom: ${state.zoom}%;
|
|
||||||
}
|
|
||||||
`}
|
|
||||||
</style>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const handlePageChange = (pageNumber) => {
|
const handlePageChange = (pageNumber) => {
|
||||||
// Scroll to the desired page
|
// Scroll to the desired page
|
||||||
scrollToPage(pageNumber);
|
scrollToPage(pageNumber);
|
||||||
@@ -284,14 +271,13 @@ const BrewRenderer = (props)=>{
|
|||||||
<RenderWarnings />
|
<RenderWarnings />
|
||||||
<NotificationPopup />
|
<NotificationPopup />
|
||||||
</div>
|
</div>
|
||||||
{makeZoom()}
|
|
||||||
|
|
||||||
{/* Apply CSS from Style tab and render pages from Markdown tab */}
|
{/* Apply CSS from Style tab and render pages from Markdown tab */}
|
||||||
{state.isMounted
|
{state.isMounted
|
||||||
&&
|
&&
|
||||||
<>
|
<>
|
||||||
{renderStyle()}
|
{renderStyle()}
|
||||||
<div className='pages' lang={`${props.lang || 'en'}`}>
|
<div className='pages' lang={`${props.lang || 'en'}`} style={{ zoom: `${state.zoom}%` }}>
|
||||||
{renderPages()}
|
{renderPages()}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
"baseSnippets": false,
|
"baseSnippets": false,
|
||||||
"path": "Blank"
|
"path": "Blank"
|
||||||
},
|
},
|
||||||
"journal": {
|
"Journal": {
|
||||||
"name": "Journal",
|
"name": "Journal",
|
||||||
"renderer": "V3",
|
"renderer": "V3",
|
||||||
"baseTheme": "Blank",
|
"baseTheme": "Blank",
|
||||||
"baseSnippets": "5ePHB",
|
"baseSnippets": "5ePHB",
|
||||||
"path": "journal"
|
"path": "Journal"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user