File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 Platform ,
1212} from 'react-native' ;
1313import React , { useContext , useEffect , useState } from 'react' ;
14+ import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
1415import Spinner from '../../components/Spinner' ;
1516import {
1617 useTextToImage ,
@@ -34,6 +35,7 @@ const MODELS: ModelOption<TextToImageModelSources>[] = [
3435] ;
3536
3637export default function TextToImageScreen ( ) {
38+ const { bottom } = useSafeAreaInsets ( ) ;
3739 const [ inferenceStepIdx , setInferenceStepIdx ] = useState < number > ( 0 ) ;
3840 const [ image , setImage ] = useState < string | null > ( null ) ;
3941 const [ steps , setSteps ] = useState < number > ( 40 ) ;
@@ -173,7 +175,7 @@ export default function TextToImageScreen() {
173175
174176 < StatsBar inferenceTime = { generationTime } />
175177
176- < View style = { styles . inputRow } >
178+ < View style = { [ styles . inputRow , { marginBottom : bottom || 12 } ] } >
177179 < TextInput
178180 style = { styles . textInput }
179181 placeholder = "Enter prompt..."
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import ColorPalette from '../colors';
22import FontAwesome from '@expo/vector-icons/FontAwesome' ;
33import DeviceInfo from 'react-native-device-info' ;
44import { View , TouchableOpacity , StyleSheet , Text } from 'react-native' ;
5+ import { useSafeAreaInsets } from 'react-native-safe-area-context' ;
56
67export const BottomBar = ( {
78 handleCameraPress,
@@ -10,8 +11,10 @@ export const BottomBar = ({
1011 handleCameraPress : ( isCamera : boolean ) => void ;
1112 runForward : ( ) => void ;
1213} ) => {
14+ const { bottom } = useSafeAreaInsets ( ) ;
15+
1316 return (
14- < View style = { styles . bottomContainer } >
17+ < View style = { [ styles . bottomContainer , { paddingBottom : bottom || 16 } ] } >
1518 < View style = { styles . bottomIconsContainer } >
1619 < TouchableOpacity onPress = { ( ) => handleCameraPress ( false ) } >
1720 < FontAwesome name = "photo" size = { 24 } color = { ColorPalette . primary } />
@@ -40,8 +43,8 @@ const styles = StyleSheet.create({
4043 width : '100%' ,
4144 gap : 15 ,
4245 alignItems : 'center' ,
43- padding : 16 ,
44- flex : 1 ,
46+ paddingTop : 16 ,
47+ paddingHorizontal : 16 ,
4548 } ,
4649 bottomIconsContainer : {
4750 flexDirection : 'row' ,
You can’t perform that action at this time.
0 commit comments