on 368f024 help sign in
bridge/src/components/L2/Modal.tsx
26 lines 506 B history raw
1import React, { MouseEvent } from 'react';
2import { Box } from '@tlon/indigo-react';
4import './Modal.scss';
6export interface ModalProps {
7 show: boolean;
8 hide: () => void;
9 children: React.ReactNode;
12export default function Modal({ show, hide, children }: ModalProps) {
13 const dontHide = (e: MouseEvent) => {
14 e.stopPropagation();
15 };
17 if (!show) {
18 return null;
19 }
21 return (
22 <Box className="modal" onClick={hide}>
23 <Box onClick={dontHide}>{children}</Box>
24 </Box>
25 );