Last active
March 25, 2021 16:10
-
-
Save EthanBonsignori/175d7469c3672472cd23435f0b0266b9 to your computer and use it in GitHub Desktop.
First revision of CropModal - simple displaying of Modal and logging of the imageBase64 prop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Modal from 'react-modal'; | |
| // For accessibility (http://reactcommunity.org/react-modal/accessibility/) | |
| Modal.setAppElement('#root'); | |
| function CropModal(props) { | |
| const { | |
| isOpen, | |
| toggleModal, | |
| imageBase64, | |
| } = props; | |
| console.log(imageBase64); | |
| return ( | |
| <Modal | |
| className="modal" | |
| isOpen={isOpen} | |
| onRequestClose={toggleModal} | |
| > | |
| <h2>Crop Your Image</h2> | |
| // Crop element will go here | |
| </Modal> | |
| ); | |
| }; | |
| export default CropModal; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Find the tutorial here: https://ethanbon.com/blog/uploading-cropped-profile-images-to-digital-ocean-spaces-1