I have a Modal screen component as well as the Swiper component to return. The onTapCard prop for thr Swiper component should change the state of the modal popup to make it visible. When the card is clicked, the modal should render the same image and text that is on the card that was clicked. The Modal component with the Swiper component is shown below where 'pictures' is the input data array in state. Any help would be appreciated.
I would make sure to increase the index of your pictures array each time you swipe, so when you tap on the card the appropriate information will be available.
I have a Modal screen component as well as the Swiper component to return. The onTapCard prop for thr Swiper component should change the state of the modal popup to make it visible. When the card is clicked, the modal should render the same image and text that is on the card that was clicked. The Modal component with the Swiper component is shown below where 'pictures' is the input data array in state. Any help would be appreciated.
HomeScreen extends Component { constructor (props) { super(props) this.state = { isVisible: false, currentPic: null, pictures: [... ], }; this.setCurrentPic = this.setCurrentPic.bind(this); };
setCurrentPic(id) { this.setState({currentPic: id}); }
onSwiped = (type) => { console.log(
${type}
) };swipeLeft = () => { this.swiper.swipeLeft() };
render () { return (
} }
export default HomeScreen;