I have an Image class in React, and I have a button that should implement expand on click, on every image. I decided to use a Modal popup so when I click, the Image will show bigger in the Modal popup. I find it hard to set the Modal as an image.
Thank you in advance.
This is from the Image
class in React:
<FontAwesome
className="image-icon"
name="expand"
title="expand"
onClick={this.showModal}
/>
<Modal show={this.state.isExpand} handleClose={this.hideModal} />
Modal:
const Modal = ({ handleClose, show }) => {
const showHideClassName = show ? 'modal display-block' : 'modal display-none';
return (
<div className={showHideClassName}>
<section className="modal-main">
<button onClick={handleClose}>close</button>
</section>
</div>
);
};
url
variable in? – stef