import React,{useState} from 'react'
import {View,TextInput,Button,Text,TouchableOpacity} from 'react-native'
const App=()=>{
const [text,setText]=useState('')
const [t1,setT1]=useState('0')
return(
<View style={{borderWidth:2}}>
<TextInput style={{borderWidth:2,margin:10,height:30}} value={text} editable={false} placeholder='0'/>
<View style={{flexDirection: 'row'}}>
<TouchableOpacity style={{ backgroundColor: 'black', width:42,height:40,margin:12,
marginTop:6, alignItems:'center',justifyContent: 'center'}} onPress={()=>setText(text+'1')}>
<Text style={{fontSize:15,color:'white'}}>1</Text>
</TouchableOpacity>
<TouchableOpacity style={{ backgroundColor: 'black', width:42,height:40,margin:12,
marginTop:6, alignItems:'center',justifyContent: 'center'}} onPress={()=>setText(text+'2')}>
<Text style={{fontSize:15,color:'white'}}>2</Text>
</TouchableOpacity>
<TouchableOpacity style={{ backgroundColor: 'black', width:42,height:40,margin:12,
marginTop:6,alignItems:'center',justifyContent: 'center'}} onPress={()=>setText(text+'3')}>
<Text style={{fontSize:15,color:'white'}}>3</Text>
</TouchableOpacity>
<TouchableOpacity style={{ backgroundColor: 'black', width:42,height:40,margin:12,
marginTop:6,alignItems:'center',justifyContent: 'center'}} onPress={
()=>{
setT1(t1+'+'+text);
setText('');
}
}>
<Text style={{fontSize:15,color:'white'}}>+</Text>
</TouchableOpacity>
<TouchableOpacity style={{ backgroundColor: 'black', width:42,height:40,margin:12,
marginTop:6,alignItems:'center',justifyContent: 'center'}} onPress>
<Text style={{fontSize:15,color:'white'}}>=</Text>
</TouchableOpacity>
</View>
<Text>this is text {text}</Text>
<Text>this is t1 {t1}</Text>
</View>
);
}
export default App;