components/CameraButton.js
import React, {useState} from 'react'; import {View, Pressable, StyleSheet, Platform} from 'react-native'; import {useSafeAreaInsets} from 'react-native-safe-area-context'; import Icon from 'react-native-vector-icons/MaterialIcons'; import UploadModeModal from './UploadModeModal'; const TABBAR_HEIGHT 49; function () { const insets (); const [modalVisible, setModalVisible] = useState(false); const bottom Platform. ({ android: TABBAR_HEIGHT 2, ios: TABBAR_HEIGHT 2 insets.bottom 4, }); return ( <> <View style={[styles.wrapper, {bottom}]}> <Pressable android_ripple={{ color: '#ffffff', }} style={styles.circle} onPress={() => setModalVisible(true)}> <Icon name="camera-alt" color="white" size={24} /> </Pressable> </View> <UploadModeModal visible={modalVisible} onClose={() => setModalVisible(false)} /> </> ); } ( )