Based on my response returned from server i want to change the button upon the status of field friends_status from the below response
{
"responseHeader": {
"type": "314",
"status": "200",
"message": "Successfully found the profile"
},
"neighbourProfile": [{
"friends_status": "210",
},
{
"friends_status": "217",
},
{
"friends_status": "219",
},
{
"friends_status": "200",
}
]
}
I want to change the button text as well as the button.How do i replace button with an image
Updated:
if(neighbours.friend_status == '219'){
<Button color={'#00BFA5'} title="Add"
onPress={console.log('clicked')}/>
}
else if(neighbours.friend_status == '208'){
<Button color={'#ffffff'} title={"Add"} onPress={console.log('clicked')}/>
}
else if(neighbours.friend_status == '216')
{
<TouchableOpacity>
<Image source={require('../Images/ic_reject.png')}/>
<Image source={require('../Images/ic_request_accept.png')}/>
</TouchableOpacity>
}
else if(neighbours.friend_status == '221'){
<TouchableOpacity>
<Image source={require('../Images/ic_reject.png')}/>
<Image source={require('../Images/ic_request_accept.png')}/>
</TouchableOpacity>
}