feat: wired the registeration journey with the api, success modal, reactive data

This commit is contained in:
MTG2000
2022-09-08 14:53:08 +03:00
parent 97d31c3360
commit a0f09aaa33
35 changed files with 878 additions and 118 deletions

View File

@@ -1,12 +1,12 @@
import React, { PropsWithChildren } from 'react'
interface Props {
className?: string
}
export default function InfoCard(props: PropsWithChildren<Props>) {
return (
<div className="bg-gray-50 p-16 rounded-12 border border-gray-200 mt-24">
<div className={`bg-gray-50 p-16 rounded-12 border border-gray-200 ${props.className}`}>
<p className="text-body5 text-gray-600">
{props.children}
</p>

View File

@@ -17,7 +17,11 @@ ReactModal.setAppElement('#root');
export default function Modal({ onClose, children, ...props }: Props) {
const dispatch = useAppDispatch()
const dispatch = useAppDispatch();
const onAfterClose = () => {
dispatch(removeClosedModal(props.id))
}
return <ReactModal
isOpen={props.isOpen}
@@ -25,7 +29,7 @@ export default function Modal({ onClose, children, ...props }: Props) {
overlayClassName='fixed w-full inset-0 overflow-x-hidden z-[2020] no-scrollbar'
className=' '
closeTimeoutMS={1000}
onAfterClose={() => dispatch(removeClosedModal(props.id))}
onAfterClose={onAfterClose}
contentElement={(_props, children) => <div {..._props} className={`${_props.className} w-screen min-h-screen relative flex flex-col justify-center items-center md:py-64 md:px-16 inset-0`}>
<div
onClick={onClose}

View File

@@ -71,10 +71,9 @@ export default function ModalsContainer() {
<div className="z-[2020]">
{openModals.map((modal, idx) => {
const Child = ALL_MODALS[modal.Modal];
return (
<Modal
key={idx}
key={modal.id}
isOpen={modal.isOpen}
onClose={onClose}
direction={direction}