This commit is contained in:
zadit
2025-02-18 22:39:26 +07:00
parent 9e7c80ddad
commit 066878ccbd
4 changed files with 87 additions and 15 deletions

View File

@@ -35,6 +35,7 @@ import CreateUserWithCoupon from "../pages/CreateUserWithCoupon";
const Modal = ({ user, shop, isOpen, onClose, modalContent, setModal, handleMoveToTransaction,welcomePageConfig, onModalCloseFunction }) => {
const [shopImg, setShopImg] = useState('');
const [updateKey, setUpdateKey] = useState(0);
useEffect(() => {
if (welcomePageConfig) {
@@ -43,6 +44,10 @@ const Modal = ({ user, shop, isOpen, onClose, modalContent, setModal, handleMove
}
}, [welcomePageConfig]);
useEffect(() => {
setUpdateKey(updateKey+1);
}, [shop]);
if (!isOpen) return null;
// Function to handle clicks on the overlay
@@ -63,7 +68,7 @@ const Modal = ({ user, shop, isOpen, onClose, modalContent, setModal, handleMove
};
if(modalContent == '') handleOverlayClick();
return (
<div onClick={handleOverlayClick} className={styles.modalOverlay}>
<div key={updateKey} onClick={handleOverlayClick} className={styles.modalOverlay}>
<div className={styles.modalContent} onClick={handleContentClick}>
{modalContent === "edit_account" && <AccountUpdatePage user={user} />}