import React from "react"; import { Grid, Grow, useScrollTrigger } from "@mui/material"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import { useTheme } from "@mui/material/styles"; function ScrollTop(props) { const { children, window } = props; // Note that you normally won't need to set the window ref as useScrollTrigger // will default to window. // This is only being set here because the demo is in an iframe. const trigger = useScrollTrigger({ target: window ? window() : undefined, disableHysteresis: true, threshold: 100, }); const handleClick = (event) => { const anchor = (event.target.ownerDocument || document).querySelector( "#back-to-top-anchor", ); if (anchor) { anchor.scrollIntoView({ behavior: "smooth", block: "center" }); } }; return (
{children}
); } const BackToTop = (props) => { const theme = useTheme(); return ( ); }; export default BackToTop;