mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 19:19:47 +00:00
Suggestions from code review
This commit is contained in:
@@ -67,7 +67,6 @@ export default class Cropper extends Component<Props, State> {
|
||||
componentWillReceiveProps({ crop }: Props, nextState: State) {
|
||||
const current = nextState.crop || this.state.crop;
|
||||
if (crop !== this.props.crop && !shallowEqual(crop, current)) {
|
||||
// this.setState({ crop: nextProps.crop });
|
||||
this.setCrop(crop);
|
||||
}
|
||||
}
|
||||
@@ -257,8 +256,8 @@ export default class Cropper extends Component<Props, State> {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
addEventListener('keydown', this.onKeyDown);
|
||||
addEventListener('keyup', this.onKeyUp);
|
||||
removeEventListener('keydown', this.onKeyDown);
|
||||
removeEventListener('keyup', this.onKeyUp);
|
||||
}
|
||||
|
||||
render({ size }: Props, { crop, pan }: State) {
|
||||
|
||||
@@ -35,15 +35,7 @@
|
||||
/* Accept pointer input even though this is unpainted transparent */
|
||||
pointer-events: all;
|
||||
cursor: move;
|
||||
|
||||
/* animation: ants 1s linear forwards infinite; */
|
||||
}
|
||||
/*
|
||||
@keyframes ants {
|
||||
0% { stroke-dashoffset: 0; }
|
||||
100% { stroke-dashoffset: -12; }
|
||||
}
|
||||
*/
|
||||
|
||||
.edge {
|
||||
fill: #aaa;
|
||||
|
||||
Reference in New Issue
Block a user