diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 0000000..849e3ae --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,30 @@ +## Issue + + + +## What did you do? + + + +## Screenshot / Video + + + +## Note for Deployment + + diff --git a/apps/gacha/src/app/_components/form/modal-form-forgot-password.tsx b/apps/gacha/src/app/_components/form/modal-form-forgot-password.tsx index cf41f53..4f42d91 100644 --- a/apps/gacha/src/app/_components/form/modal-form-forgot-password.tsx +++ b/apps/gacha/src/app/_components/form/modal-form-forgot-password.tsx @@ -4,24 +4,28 @@ import { Modal, Stepper, } from '@imphnen-frontend-service/ui/molecules'; +import { useQueryState } from '../../../hooks/use-query-state'; interface IModalFormForgotPasswordProps { isOpen: boolean; onClose: () => void; - currentStep: number; - nextStep: () => void; - prevStep: () => void; - resetStep: () => void; } const ModalFormForgotPassword = ({ isOpen, onClose, - currentStep, - nextStep, - prevStep, - resetStep, }: IModalFormForgotPasswordProps) => { + const { + step: currentStep, + nextStep, + prevStep, + resetStep, + } = useQueryState('step', { + defaultValue: 1, + maxValue: 3, + minValue: 1, + }); + return ( void; +} + +const ModalFormRegister = ({ isOpen, onClose }: IModalFormRegisterProps) => { + const { + step: currentStep, + nextStep, + prevStep, + resetStep, + } = useQueryState('registerStep', { + defaultValue: 1, + maxValue: 2, + minValue: 1, + }); + + return ( + { + onClose(); + resetStep(); + }} + > + + +

+ Register +

+

+ {currentStep === 1 ? 'Info Akun' : 'Informasi Pengiriman Hadiah'} +

+
+ + {currentStep === 1 && } + {currentStep === 2 && ( + + )} + +
+ ); +}; + +interface IStepOneProps { + nextStep: () => void; + onClose: () => void; +} + +const StepOne = ({ nextStep, onClose }: IStepOneProps) => ( + <> + + + + + + +); + +interface IStepTwoProps { + nextStep: () => void; + prevStep: () => void; +} + +const StepTwo = ({ nextStep, prevStep }: IStepTwoProps) => ( + <> + + +
+ + +
+ +); + +export default ModalFormRegister; diff --git a/apps/gacha/src/app/page.tsx b/apps/gacha/src/app/page.tsx index 6a58c4a..1d2ad4f 100644 --- a/apps/gacha/src/app/page.tsx +++ b/apps/gacha/src/app/page.tsx @@ -2,9 +2,9 @@ import { ArrowDownOutlined } from '@ant-design/icons'; import { Button } from '@imphnen-frontend-service/ui/atoms'; import { cn } from '@imphnen-frontend-service/utils'; import { FC, Fragment, ReactElement, useEffect, useState } from 'react'; -import { useQueryState } from '../hooks/use-query-state'; import ModalFormForgotPassword from './_components/form/modal-form-forgot-password'; import ModalFormLogin from './_components/form/modal-form-login'; +import ModalFormRegister from './_components/form/modal-form-register'; interface GachaItemProps { src: string; @@ -15,17 +15,7 @@ interface GachaItemProps { export const Components: FC = (): ReactElement => { const [showModalForgotPassword, setShowModalForgotPassword] = useState(false); const [showModalLogin, setShowModalLogin] = useState(false); - - const { - step: currentStep, - nextStep, - prevStep, - resetStep, - } = useQueryState('step', { - defaultValue: 1, - maxValue: 3, - minValue: 1, - }); + const [showModalRegister, setShowModalRegister] = useState(false); const scrollToRoulette = () => { const rouletteSection = document.getElementById('roulette'); @@ -80,7 +70,6 @@ export const Components: FC = (): ReactElement => { const handleForgotPasswordClick = () => { setShowModalLogin(false); setShowModalForgotPassword(true); - resetStep(); }; return ( @@ -242,6 +231,9 @@ export const Components: FC = (): ReactElement => { + {/* Diffuser & Cloud */} @@ -252,21 +244,26 @@ export const Components: FC = (): ReactElement => { isOpen={showModalLogin} onClose={() => setShowModalLogin(false)} onForgotPassword={handleForgotPasswordClick} - key={currentStep} + key="login" + /> + + {/* Register Modal */} + { + setShowModalRegister(false); + }} + key="register" /> {/* Forgot Password Modal */} { setShowModalForgotPassword(false); setShowModalLogin(true); }} - nextStep={nextStep} - prevStep={prevStep} - resetStep={resetStep} - key={currentStep} + key="forgot-password" /> );