mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-29 19:24:27 +01:00
feat: wired the registeration journey with the api, success modal, reactive data
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user