Skip to content

Commit

Permalink
Feat:add Payment Section to register form (#222)
Browse files Browse the repository at this point in the history
* Feat: improved Upper Slider,lower Slider,fix Responsiveness of EventPage

* Feat:fix minor changes

* feat:add payment Section in Register Form
  • Loading branch information
AYANscyy2 authored Oct 25, 2024
1 parent edebe21 commit 4c0dcbe
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/app/register/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Moon,
UndertakingLink,
PaymentPolicyInfo,
PaymentHeading,
} from './register.styles';
import Link from 'next/link';
import InputField from '@/components/Register/InputField/InputField';
Expand All @@ -25,6 +26,7 @@ import { PrimaryButton } from '@/components/shared/Typography/Buttons';
import { AuthContext } from '@/context/auth-context';
import { RegistrationModal } from './RegistrationModal';
import toast from 'react-hot-toast';
import { QrButton } from '@/components/Register/Qrscanner/QrButton';

function Page() {
const [userDetails, setUserDetails] = useState({
Expand Down Expand Up @@ -158,6 +160,13 @@ function Page() {
error={errors[field.id]}
/>
);
case 'button':
return (
<>
<PaymentHeading>Payment Section </PaymentHeading>
<QrButton label={field.label} />
</>
);
case 'checkbox':
return (
<CheckBox
Expand Down Expand Up @@ -187,7 +196,7 @@ function Page() {
<RegisterContainer>
<Moon />

{isLoggedIn ? (
{!isLoggedIn ? (
<RegisterInnerContainer>
<RegisterHeading>Register</RegisterHeading>
<RegisterForm>
Expand Down
9 changes: 8 additions & 1 deletion src/app/register/register.styles.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import styled from 'styled-components';
import tw from 'twin.macro';
import { Heading1 } from '@/components/shared/Typography/Headings';
import { Heading1, Heading2 } from '@/components/shared/Typography/Headings';
import { PrimaryButton } from '@/components/shared/Typography/Buttons';

export const RegisterHeading = styled(Heading1)`
${tw`text-center text-2xl xxs:text-3xl ssm:text-4xl md:text-5xl lg:text-6xl my-0 py-0 font-spaceX text-white`}
`;

export const PaymentContainer = styled.div`
${tw`w-auto h-auto p-5 border-[#00FFD1] border-2`}
`;
export const PaymentHeading = styled(Heading2)`
${tw`text-left`}
`;

export const RegisterContainer = styled.div`
${tw`min-h-screen flex flex-col items-center w-full justify-center pt-20 pb-16 px-2 xxs:px-5 xsm:px-10 md:px-20`};
background: url('https://res.cloudinary.com/dmvdbpyqk/image/upload/v1728797925/registration_si85oa.png');
Expand Down
17 changes: 17 additions & 0 deletions src/components/Register/Qrscanner/QrButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { PrimaryButton } from '@/components/shared/Typography/Buttons';
import { useState } from 'react';
import { QrModal } from './QrModal';

export const QrButton = ({ label }) => {
const [isModalOpen, setIsModalOpen] = useState(false);

const handleModal = () => {
setIsModalOpen(!isModalOpen);
};
return (
<>
<PrimaryButton onClick={handleModal}>{label}</PrimaryButton>
<QrModal isOpen={isModalOpen} onClose={handleModal} />
</>
);
};
39 changes: 39 additions & 0 deletions src/components/Register/Qrscanner/QrModal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { closeIcon } from '@/config/content/Footer';
import { QrImgUrl } from '@/config/content/Registration/details';
import { Button, Modal, ModalBody, ModalContent } from '@nextui-org/react';
import Image from 'next/image';

export const QrModal = ({ onClose, isOpen }) => {
return (
<>
<Modal
size='xl'
isOpen={isOpen}
onClose={onClose}
backdrop='blur'
hideCloseButton={true}
placement='center'
className='backdrop-blur-lg'
>
<ModalContent className='relative bg-[#0000002a] h-[60vh] xxs:h-[70vh] md:h-[90vh] md:mt-48 focus:outline-none focus:border-0'>
<Button
color='danger'
variant='light'
onPress={onClose}
className='absolute top-1 right-0 z-10 focus:outline-none focus:border-0'
>
<Image src={closeIcon} alt='close' width={30} height={30} />
</Button>
<ModalBody className='h-full flex flex-col justify-center items-center'>
<Image
src={QrImgUrl}
alt='Qr'
fill
style={{ objectFit: 'fill', borderRadius: '16px' }}
/>
</ModalBody>
</ModalContent>
</Modal>
</>
);
};
22 changes: 22 additions & 0 deletions src/config/content/Registration/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export const formFields = [
id: 'institute',
className: 'w-full',
},

{
label: 'Name of the University (Full Name) ',
type: 'text',
Expand All @@ -199,6 +200,7 @@ export const formFields = [
type: 'file',
id: 'idCard',
},

{
label: 'Referral Code',
type: 'text',
Expand All @@ -220,6 +222,23 @@ export const formFields = [
id: 'gender',
className: 'oneliner',
},
{
label: 'Click to Pay',
type: 'button',
id: 'qr',
className: 'w-full',
},
{
label: 'Upload Payment Screenshot',
type: 'file',
id: 'idCard',
},
{
label: 'Transaction ID',
type: 'text',
id: 'TranscId',
className: 'w-full',
},
{
label: 'By proceeding, you agree to our terms and conditions.',
type: 'checkbox',
Expand Down Expand Up @@ -259,3 +278,6 @@ export const undertakingContent = {
link: 'https://drive.google.com/file/d/1rHV-eF4Z5ihY1VwqYg97FAEiVAYQ3g8E/view?usp=sharing',
text: 'Undertaking Form for Authorization/Permission Letter',
};

export const QrImgUrl =
'https://res.cloudinary.com/dfe8sdlkc/image/upload/v1729884328/85002429435_sbi_gt1in2.webp';

0 comments on commit 4c0dcbe

Please sign in to comment.