7
7
*/
8
8
9
9
import React , { useState } from 'react' ;
10
- import { Button , StyleSheet , ScrollView , View , Text } from 'react-native' ;
10
+ import { Button , StyleSheet , View , Text , TextInput } from 'react-native' ;
11
11
12
12
import { Colors } from 'react-native/Libraries/NewAppScreen' ;
13
13
@@ -44,16 +44,22 @@ const App: () => Node = () => {
44
44
< View style = { styles . sectionContainer } >
45
45
< Text style = { styles . sectionTitle } > AWS SDK for JavaScript (v2):</ Text >
46
46
< Button title = "Call with v2" onPress = { fetchV2Response } />
47
- < ScrollView style = { styles . resultWindow } >
48
- < Text style = { styles . sectionDescription } > { v2Response } </ Text >
49
- </ ScrollView >
47
+ < TextInput
48
+ style = { styles . sectionDescription }
49
+ multiline = { true }
50
+ placeholder = "v2 response will be populated here"
51
+ value = { v2Response }
52
+ />
50
53
</ View >
51
54
< View style = { styles . sectionContainer } >
52
55
< Text style = { styles . sectionTitle } > AWS SDK for JavaScript (v3):</ Text >
53
56
< Button title = "Call with v3" onPress = { fetchV3Response } />
54
- < ScrollView style = { styles . resultWindow } >
55
- < Text style = { styles . sectionDescription } > { v3Response } </ Text >
56
- </ ScrollView >
57
+ < TextInput
58
+ style = { styles . sectionDescription }
59
+ multiline = { true }
60
+ placeholder = "v3 response will be populated here"
61
+ value = { v3Response }
62
+ />
57
63
</ View >
58
64
</ View >
59
65
) ;
@@ -64,8 +70,8 @@ const styles = StyleSheet.create({
64
70
flex : 1 ,
65
71
} ,
66
72
sectionContainer : {
73
+ flex : 1 ,
67
74
borderWidth : 1 ,
68
- flex : 2 ,
69
75
padding : 16 ,
70
76
} ,
71
77
sectionTitle : {
@@ -74,13 +80,12 @@ const styles = StyleSheet.create({
74
80
fontWeight : '600' ,
75
81
color : Colors . black ,
76
82
} ,
77
- resultWindow : {
78
- backgroundColor : Colors . lighter ,
79
- } ,
80
83
sectionDescription : {
84
+ flex : 1 ,
81
85
fontSize : 14 ,
82
86
fontWeight : '400' ,
83
87
color : Colors . dark ,
88
+ backgroundColor : Colors . lighter ,
84
89
} ,
85
90
} ) ;
86
91
0 commit comments