Sou novo no assunto, tenho que fazer um app que tudo que for escrito na caixa de teste chame tenha um botao para impressao
Segue script feito ate agora
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, {Fragment} from 'react';
import { Component} from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Image,
Alert,
Button,
Text,
TextInput,
StatusBar,
} from 'react-native';
import {
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
export default class App extends Component{
constructor(){
super();
this.state = {value: ''};
}
ButtonCall = () =>{
const {value} = this.state;
Alert.alert
("Imprimindo...");
}
render() {
return (
<Fragment>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
<Text style={styles.footer}>Engine: Hermes</Text>
</View>
)}
<View style={styles.body}>
<View style={styles.scrollView}>
<Image
style={styles.logoPolishop}
source={require('./polishop.jpg')}/>
</View>
<View style={styles.sectionContainer}>
<TextInput
style={{height: 250, fontSize: 20, marginTop: 150}}
placeholder="Digite aqui seu texto para imprimir"
onChangeText={ (value) => this.setState({value})
}
/>
<Text style={{marginTop: 0}}>________________________________________________________________________</Text>
<View>
<Button
onPress={this.ButtonCall}
title = "Imprimir"
/>
</View>
</View>
</View>
</ScrollView>
</SafeAreaView>
</Fragment>
);
};
}
const styles = StyleSheet.create({
scrollView: {
backgroundColor: '#ff0000',
},
engine: {
position: 'absolute',
right: 0,
},
body: {
backgroundColor: '#ffffff',
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
logoPolishop:{
marginTop: -40,
width: 340,
right: -50,
height: 70,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
color: Colors.black,
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
color: Colors.dark,
},
highlight: {
fontWeight: '700',
},
footer: {
color: Colors.dark,
fontSize: 12,
fontWeight: '600',
padding: 4,
paddingRight: 12,
textAlign: 'right',
},
});