mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
Latest Updates
This commit is contained in:
parent
3cab31332a
commit
00d1d2ac02
@ -124,9 +124,7 @@ const ProductView: FC<ProductViewProps> = ({ product, relatedProducts }) => {
|
||||
/>
|
||||
<div className="flex flex-row justify-between items-center">
|
||||
<Rating value={2} />
|
||||
<div className="text-accent-6 pr-1 font-medium select-none">
|
||||
36 reviews
|
||||
</div>
|
||||
<div className="text-accent-6 pr-1 font-medium">36 reviews</div>
|
||||
</div>
|
||||
<div>
|
||||
<Button
|
||||
|
@ -16,21 +16,21 @@ interface SidebarProps {
|
||||
const Sidebar: FC<SidebarProps> = ({ children, open = false, onClose }) => {
|
||||
const ref = useRef() as React.MutableRefObject<HTMLDivElement>
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => {
|
||||
if (ref.current && open) {
|
||||
window.document.body.style.overflow = 'hidden'
|
||||
disableBodyScroll(ref.current)
|
||||
} else {
|
||||
window.document.body.style.overflow &&
|
||||
setTimeout(() => (window.document.body.style.overflow = 'unset'), 30)
|
||||
!!ref.current && enableBodyScroll(ref.current)
|
||||
}
|
||||
}, 30)
|
||||
return () => {
|
||||
clearAllBodyScrollLocks()
|
||||
}
|
||||
}, [open])
|
||||
// useEffect(() => {
|
||||
// // setTimeout(() => {
|
||||
// // if (ref.current && open) {
|
||||
// // window.document.body.style.overflow = 'hidden'
|
||||
// // disableBodyScroll(ref.current)
|
||||
// // } else {
|
||||
// // window.document.body.style.overflow &&
|
||||
// // setTimeout(() => (window.document.body.style.overflow = 'unset'), 30)
|
||||
// // !!ref.current && enableBodyScroll(ref.current)
|
||||
// // }
|
||||
// // }, 30)
|
||||
// return () => {
|
||||
// clearAllBodyScrollLocks()
|
||||
// }
|
||||
// }, [open])
|
||||
|
||||
return (
|
||||
<Portal>
|
||||
|
Loading…
x
Reference in New Issue
Block a user