Skip to content

Commit b1ca38c

Browse files
committed
1 parent 01eb988 commit b1ca38c

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

app/index.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import {EditText, IconButton, Typography, useDooboo} from 'dooboo-ui';
33
import {Stack} from 'expo-router';
44

55
import {t} from '../src/STRINGS';
6-
import {View} from 'react-native';
7-
import {useState} from 'react';
6+
import {Pressable, View} from 'react-native';
7+
import {ElementRef, useRef, useState} from 'react';
88
import {KeyboardAvoidingView} from 'react-native-keyboard-controller';
9+
import {useHeaderHeight} from '@react-navigation/elements';
910

10-
const Container = styled.View`
11+
const Container = styled.SafeAreaView`
1112
background-color: ${({theme}) => theme.bg.basic};
1213
1314
flex: 1;
@@ -19,6 +20,8 @@ const Container = styled.View`
1920
export default function Index(): JSX.Element {
2021
const {theme} = useDooboo();
2122
const [text, setText] = useState('');
23+
const ref = useRef<ElementRef<typeof EditText>>(null);
24+
const headerHeight = useHeaderHeight();
2225

2326
return (
2427
<Container>
@@ -28,24 +31,33 @@ export default function Index(): JSX.Element {
2831
}}
2932
/>
3033
<KeyboardAvoidingView
34+
keyboardVerticalOffset={headerHeight}
3135
style={css`
3236
flex: 1;
3337
width: 100%;
3438
`}
3539
behavior="padding"
3640
>
37-
<View
41+
<Pressable
42+
onPress={() => ref?.current?.blur()}
3843
style={css`
3944
flex: 1;
40-
background-color: ${theme.bg.paper};
41-
42-
justify-content: center;
43-
align-items: center;
4445
`}
4546
>
46-
<Typography.Heading5>Hi there!</Typography.Heading5>
47-
</View>
47+
<View
48+
style={css`
49+
flex: 1;
50+
background-color: ${theme.bg.paper};
51+
52+
justify-content: center;
53+
align-items: center;
54+
`}
55+
>
56+
<Typography.Heading5>Hi there!</Typography.Heading5>
57+
</View>
58+
</Pressable>
4859
<EditText
60+
ref={ref}
4961
onChangeText={setText}
5062
value={text}
5163
decoration="boxed"

bun.lockb

523 Bytes
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
"@expo/react-native-action-sheet": "^4.1.0",
2323
"@react-native-async-storage/async-storage": "1.23.1",
2424
"@react-native-community/datetimepicker": "8.0.1",
25+
"@react-navigation/elements": "^1.3.31",
2526
"@shopify/flash-list": "1.6.4",
2627
"date-fns": "^3.6.0",
27-
"dooboo-ui": "^0.2.34",
28+
"dooboo-ui": "^0.2.36",
2829
"expo": "~51.0.31",
2930
"expo-constants": "~16.0.2",
3031
"expo-device": "~6.0.2",

0 commit comments

Comments
 (0)