mirror of
https://github.com/morten-olsen/bob-the-algorithm.git
synced 2026-02-08 00:46:25 +01:00
25 lines
497 B
TypeScript
25 lines
497 B
TypeScript
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 };
|