Browse Source
feat: add mobile header components and update modal imports
feat: add mobile header components and update modal imports
fix : search duas completedmaster
sina_sajjadi
4 weeks ago
17 changed files with 262 additions and 29 deletions
-
15package-lock.json
-
1package.json
-
5public/assets/images/NoDataFound.svg
-
11src/components/layout/mobile-header.tsx
-
46src/components/layout/mobile-navigation.tsx
-
19src/components/mobile-header/hamburger.tsx
-
0src/components/mobile-header/mobile-search.tsx
-
0src/components/mobile-header/mobile-setting.tsx
-
2src/components/modals/modal-manager.tsx
-
3src/components/modals/modal.tsx
-
145src/components/modals/search-modal.tsx
-
4src/components/modals/setting.tsx
-
4src/components/ui/download-app.tsx
-
4src/components/ui/range-input.tsx
-
4src/pages/_app.tsx
-
2src/pages/duas/[slug].tsx
-
26src/utils/motion/fade-in-bottom.ts
@ -0,0 +1,5 @@ |
|||||
|
<svg width="98" height="99" viewBox="0 0 98 99" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||
|
<path d="M45.0816 71.2798C30.9696 71.2798 19.6016 59.7958 19.6016 45.5398C19.6016 31.2838 30.9696 19.7998 45.0816 19.7998C59.1936 19.7998 70.5616 31.2838 70.5616 45.5398C70.5616 59.7958 59.1936 71.2798 45.0816 71.2798ZM45.0816 23.7598C33.1256 23.7598 23.5216 33.4618 23.5216 45.5398C23.5216 57.6178 33.1256 67.3198 45.0816 67.3198C57.0376 67.3198 66.6416 57.6178 66.6416 45.5398C66.6416 33.4618 57.0376 23.7598 45.0816 23.7598Z" fill="#8B8B8B" stroke="#8B8B8B" stroke-width="0.5"/> |
||||
|
<path d="M64.0605 61.9087L81.6613 79.6891L78.8899 82.4888L61.2891 64.7084L64.0605 61.9087Z" fill="#8B8B8B" stroke="#8B8B8B" stroke-width="0.5"/> |
||||
|
<path d="M77.7678 29.8828L79.5355 28.115L77.7678 26.3472L75.6528 24.2322L73.885 22.4645L72.1172 24.2322L68.5 27.8495L64.8828 24.2322L63.115 22.4645L61.3472 24.2322L59.2322 26.3472L57.4645 28.115L59.2322 29.8828L62.8495 33.5L59.2322 37.1172L57.4645 38.885L59.2322 40.6528L61.3472 42.7678L63.115 44.5355L64.8828 42.7678L68.5 39.1505L72.1172 42.7678L73.885 44.5355L75.6528 42.7678L77.7678 40.6528L79.5355 38.885L77.7678 37.1172L74.1505 33.5L77.7678 29.8828Z" fill="#8B8B8B" stroke="#F5F5F5" stroke-width="5"/> |
||||
|
</svg> |
@ -0,0 +1,46 @@ |
|||||
|
import { useEffect } from 'react'; |
||||
|
import { motion, AnimatePresence } from 'framer-motion'; |
||||
|
import { useUI } from '../context/ui.context'; |
||||
|
|
||||
|
const sidebarVariants = { |
||||
|
hidden: { x: '100%' }, |
||||
|
visible: { x: 0 }, |
||||
|
exit: { x: '100%' }, |
||||
|
}; |
||||
|
|
||||
|
const MobileNavigation = () => { |
||||
|
const { sidebarDisplay, closeSidebar } = useUI(); |
||||
|
|
||||
|
useEffect(() => { |
||||
|
if (!sidebarDisplay) { |
||||
|
document.body.style.overflow = 'hidden'; |
||||
|
} else { |
||||
|
document.body.style.overflow = 'auto'; |
||||
|
} |
||||
|
}, [sidebarDisplay]); |
||||
|
console.log("ssssssssssss"); |
||||
|
|
||||
|
return ( |
||||
|
<AnimatePresence> |
||||
|
{sidebarDisplay && ( |
||||
|
<motion.div |
||||
|
className="fixed inset-0 z-50 flex justify-end" |
||||
|
initial="hidden" |
||||
|
animate="visible" |
||||
|
exit="exit" |
||||
|
variants={sidebarVariants} |
||||
|
transition={{ type: 'spring', stiffness: 300, damping: 30 }} |
||||
|
> |
||||
|
<div className="w-64 bg-white h-full shadow-lg p-4"> |
||||
|
<button onClick={closeSidebar} className="text-gray-600"> |
||||
|
Close |
||||
|
</button> |
||||
|
{/* Add your sidebar content here */} |
||||
|
</div> |
||||
|
</motion.div> |
||||
|
)} |
||||
|
</AnimatePresence> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export default MobileNavigation; |
@ -0,0 +1,19 @@ |
|||||
|
import React from 'react'; |
||||
|
import Image from 'next/image'; |
||||
|
import Hamburegure from "../../../public/assets/images/hamburgure.svg"; |
||||
|
import { useUI } from '../context/ui.context'; |
||||
|
import MobileNavigation from '../layout/mobile-navigation'; |
||||
|
|
||||
|
|
||||
|
const HamburgerButton: React.FC = () => { |
||||
|
const {openSidebar} = useUI() |
||||
|
return ( |
||||
|
<> |
||||
|
<button onClick={openSidebar} className="p-1 bg-white rounded-[15px] z-50"> |
||||
|
<Image width={30} src={Hamburegure} alt="Hamburger" /> |
||||
|
</button> |
||||
|
</> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export default HamburgerButton; |
@ -0,0 +1,26 @@ |
|||||
|
export function fadeInBottom(duration: number = 0.5) { |
||||
|
return { |
||||
|
hidden: { |
||||
|
y: -50, // Start above the viewport
|
||||
|
transition: { |
||||
|
type: "easeInOut", |
||||
|
duration: duration, |
||||
|
}, |
||||
|
}, |
||||
|
visible: { |
||||
|
y: 0, // Center position
|
||||
|
transition: { |
||||
|
type: "easeInOut", |
||||
|
duration: duration, |
||||
|
}, |
||||
|
}, |
||||
|
exit: { |
||||
|
y: 50, // Exit below the viewport
|
||||
|
transition: { |
||||
|
type: "easeInOut", |
||||
|
duration: duration, |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
} |
||||
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue