1
1
import _ from 'lodash' ;
2
2
import React , { PureComponent } from 'react' ;
3
3
import { ScrollView , StyleSheet , TextInput } from 'react-native' ;
4
- import {
5
- Keyboard ,
6
- TouchableOpacity ,
7
- Text ,
8
- View ,
9
- TextField ,
10
- Image ,
11
- Colors ,
12
- Spacings ,
13
- Switch ,
14
- Constants ,
15
- Typography ,
16
- Button
17
- } from 'react-native-ui-lib' ;
4
+ import { Keyboard , Text , View , Colors , Spacings , Constants , Typography , Button } from 'react-native-ui-lib' ;
18
5
const KeyboardAccessoryView = Keyboard . KeyboardAccessoryView ;
19
6
const KeyboardUtils = Keyboard . KeyboardUtils ;
20
7
@@ -76,10 +63,16 @@ export default class KeyboardInputViewScreen extends PureComponent {
76
63
} ) ;
77
64
}
78
65
66
+ onHeightChanged = keyboardAccessoryViewHeight => {
67
+ if ( Constants . isIOS ) {
68
+ this . setState ( { keyboardAccessoryViewHeight} ) ;
69
+ }
70
+ } ;
71
+
79
72
keyboardAccessoryViewContent = ( ) => {
80
73
return (
81
74
< View style = { styles . keyboardContainer } >
82
- < View style = { styles . inputContainer } >
75
+ < View row padding-s5 >
83
76
< TextInput
84
77
maxHeight = { 200 }
85
78
style = { styles . textInput }
@@ -93,7 +86,7 @@ export default class KeyboardInputViewScreen extends PureComponent {
93
86
< Button label = "Close" link onPress = { KeyboardUtils . dismiss } style = { styles . button } />
94
87
</ View >
95
88
96
- < View style = { styles . keyboardModesContainer } >
89
+ < View row >
97
90
{ this . getToolbarButtons ( ) . map ( ( button , index ) => (
98
91
< Button label = { button . text } link onPress = { button . onPress } key = { index } style = { styles . button } />
99
92
) ) }
@@ -104,7 +97,7 @@ export default class KeyboardInputViewScreen extends PureComponent {
104
97
105
98
render ( ) {
106
99
return (
107
- < View style = { styles . container } >
100
+ < View flex bg-dark80 >
108
101
< ScrollView
109
102
contentContainerStyle = { styles . scrollContainer }
110
103
keyboardDismissMode = { TrackInteractive ? 'interactive' : 'none' }
@@ -117,7 +110,7 @@ export default class KeyboardInputViewScreen extends PureComponent {
117
110
118
111
< KeyboardAccessoryView
119
112
renderContent = { this . keyboardAccessoryViewContent }
120
- onHeightChanged = { Constants . isIOS ? height => this . setState ( { keyboardAccessoryViewHeight : height } ) : undefined }
113
+ onHeightChanged = { this . onHeightChanged }
121
114
trackInteractive = { TrackInteractive }
122
115
kbInputRef = { this . textInputRef }
123
116
kbComponent = { this . state . customKeyboard . component }
@@ -132,21 +125,11 @@ export default class KeyboardInputViewScreen extends PureComponent {
132
125
}
133
126
134
127
const styles = StyleSheet . create ( {
135
- container : {
136
- flex : 1 ,
137
- backgroundColor : Colors . dark80
138
- } ,
139
128
scrollContainer : {
140
129
paddingHorizontal : Spacings . s5 ,
141
130
flex : 1 ,
142
131
justifyContent : 'center'
143
132
} ,
144
- inputContainer : {
145
- flexDirection : 'row' ,
146
- alignItems : 'center' ,
147
- justifyContent : 'space-between' ,
148
- padding : Spacings . s5
149
- } ,
150
133
textInput : {
151
134
flex : 1 ,
152
135
padding : Spacings . s2 ,
@@ -159,8 +142,5 @@ const styles = StyleSheet.create({
159
142
backgroundColor : Colors . white ,
160
143
borderWidth : 1 ,
161
144
borderColor : Colors . dark60
162
- } ,
163
- keyboardModesContainer : {
164
- flexDirection : 'row'
165
145
}
166
146
} ) ;
0 commit comments