-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65c098f
commit 2c31604
Showing
16 changed files
with
336 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { useSpring } from "@react-spring/web" | ||
import { Link } from "gatsby" | ||
import React, { useEffect, useRef, useState } from "react" | ||
import { Button, Modal } from "react-bootstrap" | ||
import ModalNotebookPreview from "./ModalNotebookPreview" | ||
|
||
const PageLayout = ({ children, path, pageContext }) => { | ||
console.log("[PageLayout] render props") | ||
const [show, setShow] = useState(true) | ||
const timerRef = useRef() | ||
|
||
const handleClose = () => { | ||
setShow(false) | ||
clearTimeout(timerRef.current) | ||
timerRef.current = setTimeout(() => { | ||
window.history.back() | ||
}, 800) | ||
} | ||
useEffect(() => { | ||
return () => { | ||
clearTimeout(timerRef.current) | ||
} | ||
}, []) | ||
useEffect(() => { | ||
// scroll to 0 0 | ||
window.scrollTo(0, 0) | ||
if (path === "/") { | ||
setShow(false) | ||
} else { | ||
setShow(true) | ||
} | ||
}, [path]) | ||
|
||
return ( | ||
<Modal show={show} onHide={handleClose} backdrop="static" keyboard={false}> | ||
<Modal.Header closeButton> | ||
<Link to="/">impresso-datalab</Link> | ||
<Button variant="primary" onClick={handleClose}> | ||
close | ||
</Button> | ||
</Modal.Header> | ||
<Modal.Body className="container">{children}</Modal.Body> | ||
</Modal> | ||
) | ||
} | ||
|
||
export default PageLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.