aboutsummaryrefslogtreecommitdiff
path: root/src/components/ImageCropAreaSelect/ImageCropAreaSelect.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ImageCropAreaSelect/ImageCropAreaSelect.tsx')
-rw-r--r--src/components/ImageCropAreaSelect/ImageCropAreaSelect.tsx19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/components/ImageCropAreaSelect/ImageCropAreaSelect.tsx b/src/components/ImageCropAreaSelect/ImageCropAreaSelect.tsx
index b4540da..07d1534 100644
--- a/src/components/ImageCropAreaSelect/ImageCropAreaSelect.tsx
+++ b/src/components/ImageCropAreaSelect/ImageCropAreaSelect.tsx
@@ -1,7 +1,7 @@
-import React, {useCallback, useState} from 'react';
+import React, { useCallback, useState } from 'react';
import Cropper from 'react-easy-crop';
-import {makeStyles} from '@material-ui/core/styles';
-import {Slider} from "@material-ui/core";
+import { makeStyles } from '@material-ui/core/styles';
+import { Slider } from '@material-ui/core';
interface Area {
x: number;
@@ -22,17 +22,18 @@ const useStyles = makeStyles(theme => ({
height: 'calc(100vh - 130px)',
background: '#333',
[theme.breakpoints.up('sm')]: {
- height: 400,
+ height: 400
}
},
sliderContainer: {
- padding: 20,
+ padding: 20
}
}));
-const ImageCropAreaSelect: React.FC<PropTypes> = ({image, setArea}) => {
+const ImageCropAreaSelect: React.FC<PropTypes> = ({ image, setArea }) => {
const classes = useStyles();
- const [crop, setCrop] = useState({x: 0, y: 0});
+ const [crop, setCrop] = useState({ x: 0, y: 0 });
+ // eslint-disable-next-line
const [zoom, setZoom] = useState<any>(1);
const onCropComplete = useCallback((areaPercentage: Area, areaPixels: Area): void => {
@@ -62,11 +63,11 @@ const ImageCropAreaSelect: React.FC<PropTypes> = ({image, setArea}) => {
max={3}
step={0.01}
aria-labelledby="Zoom"
- onChange={(e, zoom) => setZoom(zoom)}
+ onChange={() => setZoom(zoom)}
/>
</div>
</div>
- )
+ );
};
export default ImageCropAreaSelect;