From 862c0254cbdec5ec8aae517200b282b6ff887e83 Mon Sep 17 00:00:00 2001 From: Inferno2211 Date: Mon, 26 Aug 2024 21:08:49 +0530 Subject: [PATCH 1/3] add popup Signed-off-by: Inferno2211 --- src/app/home/page.tsx | 200 +++++++++++++++++++----------------- src/components/ui/popup.tsx | 54 ++++++++++ 2 files changed, 159 insertions(+), 95 deletions(-) create mode 100644 src/components/ui/popup.tsx diff --git a/src/app/home/page.tsx b/src/app/home/page.tsx index 1a3d160..f58efa6 100644 --- a/src/app/home/page.tsx +++ b/src/app/home/page.tsx @@ -1,8 +1,9 @@ "use client"; -import React from 'react'; +import { useState } from 'react'; import { Box, Button, Typography } from '@mui/material'; import { Poppins } from "next/font/google"; +import Popup from '@/components/ui/popup'; const poppins = Poppins({ subsets: ["latin"], @@ -10,118 +11,127 @@ const poppins = Poppins({ }); const Home = () => { - return ( - - {/* Background Video */} - - - Your browser does not support the video tag. - + const [isPopupOpen, setIsPopupOpen] = useState(true); - {/* Content */} - - Welcome to A.T.O.M Robotics - + const openPopup = () => setIsPopupOpen(true); + const closePopup = () => setIsPopupOpen(false); + + return ( + <> + - - - + Welcome to A.T.O.M Robotics + - - + + + ); }; diff --git a/src/components/ui/popup.tsx b/src/components/ui/popup.tsx new file mode 100644 index 0000000..c5a1574 --- /dev/null +++ b/src/components/ui/popup.tsx @@ -0,0 +1,54 @@ +import React from 'react'; +import { motion, AnimatePresence } from 'framer-motion'; + +const Popup: React.FC<{ isOpen: boolean; onClose: () => void }> = ({ isOpen, onClose }) => { + return ( + + {isOpen && ( + <> + + + {/* parent div to center */} + +
+ + + {/* yaha content daal dena */} +
+ +

The orientation is scheduled for September 7th.

+ +
+
+
+ + )} +
+ ); +}; + +export default Popup; \ No newline at end of file From 0f37f1d188e95f8affc0238ec2555967d7ad0044 Mon Sep 17 00:00:00 2001 From: Inferno2211 Date: Tue, 27 Aug 2024 22:12:35 +0530 Subject: [PATCH 2/3] made popup into a generic wrapper Signed-off-by: Inferno2211 --- src/app/home/page.tsx | 8 +++++++- src/components/ui/popup.tsx | 14 +++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/home/page.tsx b/src/app/home/page.tsx index f58efa6..fd32f59 100644 --- a/src/app/home/page.tsx +++ b/src/app/home/page.tsx @@ -18,7 +18,13 @@ const Home = () => { return ( <> - + + {/* Yaha apna content dal lo */} + +

Custom Content

+

The orientation is scheduled for September 7th.

+ Placeholder +
void }> = ({ isOpen, onClose }) => { +// Adjust the props to include children +const Popup: React.FC<{ isOpen: boolean; onClose: () => void; children?: React.ReactNode }> = ({ isOpen, onClose, children }) => { return ( {isOpen && ( @@ -14,7 +15,6 @@ const Popup: React.FC<{ isOpen: boolean; onClose: () => void }> = ({ isOpen, onC onClick={onClose} /> - {/* parent div to center */} void }> = ({ isOpen, onC role="dialog" aria-labelledby="popup-title" > -
+
- - {/* yaha content daal dena */} + + {/* Render the children here */}
- -

The orientation is scheduled for September 7th.

+ {/* */} + {children}