Skip to content

chore(react-native): populate SDK response in TextInput #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions packages/react-native/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React, {useState} from 'react';
import {Button, StyleSheet, ScrollView, View, Text} from 'react-native';
import {Button, StyleSheet, View, Text, TextInput} from 'react-native';

import {Colors} from 'react-native/Libraries/NewAppScreen';

Expand Down Expand Up @@ -44,16 +44,22 @@ const App: () => Node = () => {
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>AWS SDK for JavaScript (v2):</Text>
<Button title="Call with v2" onPress={fetchV2Response} />
<ScrollView style={styles.resultWindow}>
<Text style={styles.sectionDescription}>{v2Response}</Text>
</ScrollView>
<TextInput
style={styles.sectionDescription}
multiline={true}
placeholder="v2 response will be populated here"
value={v2Response}
/>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>AWS SDK for JavaScript (v3):</Text>
<Button title="Call with v3" onPress={fetchV3Response} />
<ScrollView style={styles.resultWindow}>
<Text style={styles.sectionDescription}>{v3Response}</Text>
</ScrollView>
<TextInput
style={styles.sectionDescription}
multiline={true}
placeholder="v3 response will be populated here"
value={v3Response}
/>
</View>
</View>
);
Expand All @@ -64,8 +70,8 @@ const styles = StyleSheet.create({
flex: 1,
},
sectionContainer: {
flex: 1,
borderWidth: 1,
flex: 2,
padding: 16,
},
sectionTitle: {
Expand All @@ -74,13 +80,12 @@ const styles = StyleSheet.create({
fontWeight: '600',
color: Colors.black,
},
resultWindow: {
backgroundColor: Colors.lighter,
},
sectionDescription: {
flex: 1,
fontSize: 14,
fontWeight: '400',
color: Colors.dark,
backgroundColor: Colors.lighter,
},
});

Expand Down