about summary refs log tree commit diff
path: root/src/view/com/modals/WebModal.tsx
blob: fed2fae91f8fd3843c5d4e5b9f421f0060da19cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 * Use this for the Web build only.
 * It's intended to replace the BottomSheet.
 *
 * Note: the dataSet properties are used to leverage custom CSS in public/index.html
 */
import React from 'react'
// @ts-ignore no declarations available -prf
import {TouchableWithoutFeedback, View} from 'react-native-web'

type Props = {onClose: () => void}
export const Modal: React.FC<Props> = ({onClose, children}) => {
  return (
    <TouchableWithoutFeedback onPress={onClose}>
      <View dataSet={{'modal-overlay': 1}}>
        <View dataSet={{'modal-container': 1}}>{children}</View>
      </View>
    </TouchableWithoutFeedback>
  )
}