generated from theodorusclarence/ts-nextjs-tailwind-starter
-
-
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
63017a7
commit aa156d4
Showing
10 changed files
with
146 additions
and
37 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
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,49 @@ | ||
'use client'; | ||
|
||
// components/SheetModal.js | ||
import { useState } from 'react'; | ||
import { motion, AnimatePresence } from 'framer-motion'; | ||
|
||
import { useEffect } from 'react'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import Sheet, { SheetRef } from 'react-modal-sheet'; | ||
import { setSheet } from '@/GlobalRedux/Features/sheet/sheetSlice'; | ||
const SheetLayout = ({ children }) => { | ||
const isOpen = useSelector((state) => state.sheet.value); | ||
|
||
useEffect(() => { | ||
// Add your logic here to handle the sheet open state | ||
console.log('Sheet is open:', isOpen); | ||
}, [isOpen]); | ||
|
||
const dispatch = useDispatch(); | ||
|
||
return ( | ||
<div> | ||
<AnimatePresence> | ||
{isOpen && ( | ||
<> | ||
<Sheet | ||
rootId='render' | ||
isOpen={isOpen} | ||
onClose={() => dispatch(setSheet(false))} | ||
> | ||
<Sheet.Container | ||
style={{ | ||
backgroundColor: 'rgba(44, 45, 51, 0.7)', | ||
backdropFilter: 'blur(10px) saturate(150%)', | ||
}} | ||
> | ||
{/* <Sheet.Header></Sheet.Header> */} | ||
<Sheet.Content>{children}</Sheet.Content> | ||
</Sheet.Container> | ||
<Sheet.Backdrop onTap={() => dispatch(setSheet(false))} /> | ||
</Sheet> | ||
</> | ||
)} | ||
</AnimatePresence> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SheetLayout; |
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