我正在尝试为我选择的值制作一个弹出屏幕。这是在本地存储中。
我正在尝试将值 firstname、lastname、phone 传递给 Popup。
我希望值“h”显示在“呼叫”和“文本”旁边。
{
favContact.map((obj,i)=>{
return (
<View style={[HomePageStyles.ContactList, {width:95}]}>
{/* CONTACT CALL/MESSAGE POPUP */}
<ContactPopup Popup={Popup} setPopup={setPopup} />
{/* CONTACT */}
<TouchableOpacity onPress={() => {setPopup(true)}
}>
{/* CONTACT ICON */}
{ showIcon }
{/* CONTACT NAME */}
<Text numberOfLines={1} style={[Fonts.ContactNameFonts, {textAlign:'center', fontSize:11, paddingHorizontal:15}]}>{obj.firstname}</Text>
</TouchableOpacity>
{/* END OF CONTACT */}
</View>
)
})
}
这是我最喜欢的联系页面。
<Modal isVisible={props.Popup} hideModalContentWhileAnimating={true}
backdropTransitionOutTiming={0}
onBackdropPress={() => props.setPopup(false)}
onSwipeComplete={() => props.setPopup(false)}
swipeDirection="down"
animationInTiming={550} animationOutTiming={850}>
<View style={AddPopupStyles.Container}>
<View style={AddPopupStyles.ImgCont}>
<Image style={AddPopupStyles.Img}source={require('../assets/icons/swipe.png')}/>
</View>
<Text style={AddPopupStyles.Heading}>{firstname}{lastname}</Text>
<TouchableOpacity style={AddPopupStyles.TextCont}
onPress = {() => Communications.phonecall( phone , true)}
>
<Text style={AddPopupStyles.Text}>Call {firstname}{lastname}</Text>
</TouchableOpacity>
<TouchableOpacity style={AddPopupStyles.TextCont}
onPress={() => Communications.text(phone, 'Hey ' + firstname + ', im in need of a Ryde. Are you able to pick me up? This is my current location: ' )}
>
<Text style={AddPopupStyles.Text}>Text</Text>
</TouchableOpacity>
<TouchableOpacity style={AddPopupStyles.TextCont}
onPress={() => {props.setPopup(false)}}
>
<Text style={[AddPopupStyles.Text, AddPopupStyles.CancelText]}>
Cancel
</Text>
</TouchableOpacity>
</View>
</Modal>
这是我的弹出页面。
请各位高手帮帮我。