initial commit for new hats app

This commit is contained in:
Ichsan Kurniawan
2025-12-19 13:57:55 +07:00
parent aa949d71ff
commit 7e172f5cf7
314 changed files with 31102 additions and 208 deletions
+32
View File
@@ -0,0 +1,32 @@
import React, { MouseEvent, ReactNode, useEffect, useState } from 'react';
type Props = {
onClose: (e: MouseEvent<HTMLElement>) => any,
children: ReactNode
};
const CustomModal: React.FC<Props> = ({ children, onClose }) => {
const [isMounted, setIsMounted] = useState(false)
useEffect(() => {
setIsMounted(true)
return () => {
setIsMounted(false)
}
}, [])
return (
<>
<div className={`${isMounted ? 'open' : 'close'} custom-modal-background`} onClick={onClose}>
<div className={`${isMounted ? 'open' : 'close'} custom-modal`} style={{ translate: '-50% -50%' }}>
<div className="w-full overflow-y-auto" style={{ maxHeight: '90vh' }}>
{children}
</div>
</div>
</div>
</>
);
}
export default CustomModal;