Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add registration starting soon modal and fix payment policy modal #183

Merged
merged 26 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b197513
style: update footer and about us design
BlessedAmrita Oct 13, 2024
d90e279
Merge remote-tracking branch 'upstream/main' into amrita-1
BlessedAmrita Oct 13, 2024
7636849
Merge branch 'main' of https://github.com/BlessedAmrita/project-raisi…
BlessedAmrita Oct 13, 2024
62846e7
chore:minor fixes
BlessedAmrita Oct 13, 2024
4c166d4
Merge branch 'main' of https://github.com/BlessedAmrita/project-raisi…
BlessedAmrita Oct 13, 2024
e5ef7d0
fix: padding and text size
BlessedAmrita Oct 14, 2024
f0b3056
Merge branch 'dscnitrourkela:main' into amrita-1
BlessedAmrita Oct 14, 2024
bdb97ec
chore: minor fixes
BlessedAmrita Oct 14, 2024
a73d7be
chore: minor fixes
BlessedAmrita Oct 14, 2024
23c4bfb
Merge remote-tracking branch 'upstream/main' into amrita-1
BlessedAmrita Oct 14, 2024
b4c23b0
Merge branch 'dscnitrourkela:main' into amrita-1
BlessedAmrita Oct 14, 2024
7f16720
Merge branch 'dscnitrourkela:main' into amrita-1
BlessedAmrita Oct 14, 2024
93d65e3
chore:update hero and about us
BlessedAmrita Oct 14, 2024
7560b7b
fix: resolve merge conflicts
BlessedAmrita Oct 14, 2024
57af68f
Merge branch 'amrita-1' of https://github.com/BlessedAmrita/project-r…
BlessedAmrita Oct 14, 2024
0266b23
chore: minor fixes
BlessedAmrita Oct 15, 2024
7cf2698
chore: minor fixes
BlessedAmrita Oct 16, 2024
4d4ac04
Merge branch 'dscnitrourkela:main' into amrita-1
BlessedAmrita Oct 16, 2024
8da97fe
chore: minor changes
BlessedAmrita Oct 16, 2024
c85b1ee
Merge branch 'main' of https://github.com/BlessedAmrita/project-raisi…
BlessedAmrita Oct 17, 2024
85d4912
Merge branch 'main' of https://github.com/BlessedAmrita/project-raisi…
BlessedAmrita Oct 19, 2024
8a8b24d
feat: add links to footer
BlessedAmrita Oct 19, 2024
3663642
Merge branch 'dscnitrourkela:main' into amrita-1
BlessedAmrita Oct 19, 2024
10f3cc8
Merge branch 'main' of https://github.com/BlessedAmrita/project-raisi…
BlessedAmrita Oct 19, 2024
a866e36
feat: add registration starting soon modal and fix payment policy modal
BlessedAmrita Oct 19, 2024
15a2741
chore: minor changes
BlessedAmrita Oct 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions src/app/register/RegistrationModal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// RegistrationModal.js
import { Modal, ModalContent, ModalBody, Button } from '@nextui-org/react';
import Image from 'next/image';
import { closeIcon } from '@/config/content/Footer';

export const RegistrationModal = ({ isOpen, onClose }) => {
return (
<Modal
size='sm'
isOpen={isOpen}
onClose={onClose}
backdrop='opaque'
hideCloseButton={true}
placement='center'
className='backdrop-blur-xl border-2 border-green-200'
>
<ModalContent className='relative bg-[#0000002a] h-[50vh]'>
<Button
color='danger'
variant='light'
onPress={onClose}
className='absolute top-1 right-0 z-10'
>
<Image src={closeIcon} alt='close' width={30} height={30} />
</Button>
<ModalBody className='px-[30px] py-[50px] text-monteserrat h-full flex flex-col justify-center items-center'>
<p className='tracking-wider text-center text-[18px] lg:text-[23px]' id='modal-title'>
🚀 Coming Soon
</p>
<p className='text-center tracking-wide text-[14px] lg:text-[21px]'>
Stay tuned for exciting updates! Registration will open soon.
</p>
</ModalBody>
</ModalContent>
</Modal>
);
};
35 changes: 33 additions & 2 deletions src/app/register/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { useUserDetails } from '@/hooks/useUserDetails';
import CampusAmbassador from '@/components/Register/CampusAmbassador/CampusAmbassador';
import { PrimaryButton } from '@/components/shared/Typography/Buttons';
import { AuthContext } from '@/context/auth-context';
import { RegistrationModal } from './RegistrationModal';
function Page() {
const [userDetails, setUserDetails] = useState({
name: '',
Expand Down Expand Up @@ -161,10 +162,21 @@ function Page() {
}
}

const [isModalOpen, setModalOpen] = useState(false);

function handleSubmit() {
const isFormValid = validateForm();
if (!isFormValid) return;
setModalOpen(true);
console.log(userDetails);
}

return (
<RegisterContainer>
<Moon />
{isLoggedIn ? (

{/* //---------------------commented out google auth part--------------------- */}
{/* {isLoggedIn ? (
<RegisterInnerContainer>
<RegisterHeading>Register</RegisterHeading>
<RegisterForm>
Expand All @@ -185,7 +197,26 @@ function Page() {
<PrimaryButton onClick={handleGoogleSignIn} disabled={authLoading}>
{authLoading ? 'Loading...' : 'Sign In with Google'}
</PrimaryButton>
)}
)} */}
{/* //---------------------commented out google auth part--------------------- */}

<RegisterInnerContainer>
<RegisterHeading>Register</RegisterHeading>
<RegisterForm>
{formFields.map((field) => {
return returnFormFields(field);
})}
</RegisterForm>
<CampusAmbassador
handleChange={handleChange}
userReferral={userDetails.phone}
isCampusAmbassador={userDetails.campusAmbassador}
/>
<RegsiterButton onClick={handleSubmit} disabled={loading}>
Submit
</RegsiterButton>
</RegisterInnerContainer>
<RegistrationModal isOpen={isModalOpen} onClose={() => setModalOpen(false)} />
</RegisterContainer>
);
}
Expand Down
28 changes: 2 additions & 26 deletions src/components/Marginals/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,15 @@ import {
FooterGradient,
ListTitle,
SocialImageContainer,
Overlay,
Modal,
} from './styles';
import { LogoText2 } from '../../shared/Typography/Headings';
// import { createPortal } from 'react-dom';
import { PaymentPolicyModal } from './PaymentPolicyModel';
import { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
// import { Modal } from 'flowbite-react';
import { useState } from 'react';

export const Footer = () => {
const [isRegisterModalOpen, setIsRegisterModalOpen] = useState(false);
const [modalRoot, setModalRoot] = useState(null);

const handleRegisterModalOpen = () => setIsRegisterModalOpen(true);
const handleRegisterModalClose = () => setIsRegisterModalOpen(false);

useEffect(() => {
const root = document.getElementById('modal-root');
if (root) {
setModalRoot(root);
}
}, []);
return (
<>
<FooterContainer id='contact'>
Expand Down Expand Up @@ -123,17 +109,7 @@ export const Footer = () => {
</FooterBottom>
</FooterWrapper>
</FooterContainer>

{modalRoot &&
isRegisterModalOpen &&
createPortal(
<Overlay>
<Modal>
<PaymentPolicyModal isClose={handleRegisterModalClose} />
</Modal>
</Overlay>,
modalRoot,
)}
<PaymentPolicyModal isOpen={isRegisterModalOpen} onClose={handleRegisterModalClose} />
</>
);
};
Expand Down
44 changes: 28 additions & 16 deletions src/components/Marginals/Footer/PaymentPolicyModel.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
// import { Modal, Overlay } from '../eventCardComponents/eventCard.style';
// import { ModalExit, ModalText } from './registerModal.styles';
import { Modal, ModalContent, ModalBody, Button } from '@nextui-org/react';
import { closeIcon } from '@/config/content/Footer';
import Image from 'next/image';
import { ModalText, Para } from './styles';

// import { Modal } from "flowbite-react";
import { Paragraph, SmallParagraph } from '../../shared/Typography/Paragraphs';
import { Modal, ModalExit, ModalText, Overlay, Para } from './styles';

export const PaymentPolicyModal = ({ isClose }) => {
export const PaymentPolicyModal = ({ isOpen, onClose }) => {
return (
<>
<Overlay>
<Modal>
<Modal
size='lg'
isOpen={isOpen}
onClose={onClose}
backdrop='opaque'
hideCloseButton={true}
placement='center'
className='backdrop-blur-2xl border-2 border-[#00FFD1] p-5'
scrollBehavior='normal'
>
<ModalContent className='relative bg-[#0000002a] max-h-[90vh]'>
<Button
color='danger'
variant='light'
onPress={onClose}
className='absolute top-1 right-0 z-10'
>
<Image src={closeIcon} alt='close' width={30} height={30} />
</Button>
<ModalBody className='px-[30px] py-[50px] text-monteserrat h-full flex flex-col justify-center items-center'>
<ModalText>Pricing</ModalText>
<Para>
The registration fees for Innovision 2024 is ₹899 for all the students from outside NIT
Expand All @@ -25,11 +40,8 @@ export const PaymentPolicyModal = ({ isClose }) => {
There will be no refund of the registration fees under any circumstances unless the fest
is cancelled by team Innovision.
</Para>
<ModalExit className='text-4xl' onClick={isClose}>
close
</ModalExit>
</Modal>
</Overlay>
</>
</ModalBody>
</ModalContent>
</Modal>
);
};
Loading