Skip to content

Commit

Permalink
fix background perf and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleguido committed Oct 26, 2024
1 parent 18f3c5a commit 767631d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/components/Background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ const Background = () => {
windowHeight.current = window.innerHeight
}

const mouseMoveEvent = (e: MouseEvent) => {
const x = e.pageX - windowWidth.current / 2
const y = e.pageY - windowHeight.current / 2
// api.start({ x, y })
}
// const mouseMoveEvent = (e: MouseEvent) => {
// // to be improved for performance
// // const x = e.pageX - windowWidth.current / 2
// // const y = e.pageY - windowHeight.current / 2
// // api.start({ x, y })
// }
useEffect(() => {
document.addEventListener("mousemove", mouseMoveEvent)
// document.addEventListener("mousemove", mouseMoveEvent)
document.addEventListener("resize", onResizeHandler)
return () => {
document.removeEventListener("mousemove", mouseMoveEvent)
// document.removeEventListener("mousemove", mouseMoveEvent)
document.removeEventListener("resize", onResizeHandler)
}
// eslint-disable-next-line
Expand Down
4 changes: 2 additions & 2 deletions src/components/NotebookViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface NotebookViewerProps {
}

const splitTextWithCellInfo = (
text: string
text: string,
): Array<{ cellNumber: number; cellType: string; content: string }> => {
const cells: Array<{
cellNumber: number
Expand Down Expand Up @@ -98,7 +98,7 @@ const NotebookViewer: React.FC<NotebookViewerProps> = ({
</Alert>
</Col>
<Col lg="5">
<MarkdownSnipped className="m-0" value={notebook.excerpt} />
<MarkdownSnipped className="m-0" value={excerpt} />
</Col>
</Row>
<Row className="mb-3">
Expand Down

0 comments on commit 767631d

Please sign in to comment.