mirror of
https://github.com/morten-olsen/bob-the-algorithm.git
synced 2026-02-08 00:46:25 +01:00
v3
This commit is contained in:
24
src/ui/components/base/modal/index.tsx
Normal file
24
src/ui/components/base/modal/index.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ReactNode } from 'react';
|
||||
import Wrapper from './react-modal';
|
||||
import { Popup } from '../popup';
|
||||
type ModalProps = {
|
||||
visible: boolean;
|
||||
onClose: () => void;
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
const Modal: React.FC<ModalProps> = ({ visible, onClose, children }) => (
|
||||
<Wrapper
|
||||
transparent
|
||||
visible={visible}
|
||||
animationType="slide"
|
||||
onRequestClose={onClose}
|
||||
onDismiss={onClose}
|
||||
>
|
||||
<Popup onClose={onClose}>
|
||||
{children}
|
||||
</Popup>
|
||||
</Wrapper>
|
||||
);
|
||||
|
||||
export { Modal };
|
||||
Reference in New Issue
Block a user