diff --git a/src/views/Product/index.js b/src/views/Product/index.js index 6db4621..041561b 100644 --- a/src/views/Product/index.js +++ b/src/views/Product/index.js @@ -10,6 +10,7 @@ import Comment from "./Comment"; import Rate from "./Rate"; export const Product = ({ + isMobile, productType, getInfo, book, @@ -21,14 +22,25 @@ export const Product = ({ setHeaderOptions, }) => { const [type, setType] = useState("physical"); + const [desktopContentTransform, setDesktopContentTransform] = useState(false); useEffect(() => { getInfo({ id: location.getId() }); setHeaderOptions(headerOptions); + if (!isMobile) { + window.addEventListener("scroll", () => { + if (window.scrollY >= 64) { + setDesktopContentTransform(() => true); + } else { + setDesktopContentTransform(() => false); + } + }); + } }, []); return ( <> {/* Portrait */} + {isMobile ? (
))}
- + ) :
Desktop
} ); };