@@ -3,11 +3,12 @@ import {EditText, IconButton, Typography, useDooboo} from 'dooboo-ui';
3
3
import { Stack } from 'expo-router' ;
4
4
5
5
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' ;
8
8
import { KeyboardAvoidingView } from 'react-native-keyboard-controller' ;
9
+ import { useHeaderHeight } from '@react-navigation/elements' ;
9
10
10
- const Container = styled . View `
11
+ const Container = styled . SafeAreaView `
11
12
background-color : ${ ( { theme} ) => theme . bg . basic } ;
12
13
13
14
flex : 1 ;
@@ -19,6 +20,8 @@ const Container = styled.View`
19
20
export default function Index ( ) : JSX . Element {
20
21
const { theme} = useDooboo ( ) ;
21
22
const [ text , setText ] = useState ( '' ) ;
23
+ const ref = useRef < ElementRef < typeof EditText > > ( null ) ;
24
+ const headerHeight = useHeaderHeight ( ) ;
22
25
23
26
return (
24
27
< Container >
@@ -28,24 +31,33 @@ export default function Index(): JSX.Element {
28
31
} }
29
32
/>
30
33
< KeyboardAvoidingView
34
+ keyboardVerticalOffset = { headerHeight }
31
35
style = { css `
32
36
flex : 1 ;
33
37
width : 100% ;
34
38
` }
35
39
behavior = "padding"
36
40
>
37
- < View
41
+ < Pressable
42
+ onPress = { ( ) => ref ?. current ?. blur ( ) }
38
43
style = { css `
39
44
flex : 1 ;
40
- background-color : ${ theme . bg . paper } ;
41
-
42
- justify-content : center;
43
- align-items : center;
44
45
` }
45
46
>
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 >
48
59
< EditText
60
+ ref = { ref }
49
61
onChangeText = { setText }
50
62
value = { text }
51
63
decoration = "boxed"
0 commit comments