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
.imgcrop__mainDiv{ | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
margin: 30px; | |
}; | |
.imgcrop__header { | |
position: relative; |
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
const downloadBase64File = (base64Data, filename) => { | |
// from raw data to Image!! | |
var element = document.createElement('a'); | |
element.setAttribute('href', base64Data); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); | |
document.body.removeChild(element); | |
} |
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 React, { Component } from 'react'; | |
import "./App.css" | |
import ReactCrop from 'react-image-crop'; | |
// This has to done as the image crop guide needs this css open to work! (They Did it Like That, UGHH!) | |
import 'react-image-crop/dist/ReactCrop.css'; | |
/* Import Image Functions Here */ | |
import { | |
base64StringtoFile, | |
extractImageFileExtensionFromBase64, |
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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
ReactDOM.render( | |
<App />, | |
document.getElementById('root') | |
); |