Suggestions from code review

This commit is contained in:
Jason Miller
2021-06-07 14:59:26 -04:00
parent 543c2e73fb
commit 7918938d8a
6 changed files with 8 additions and 85 deletions

View File

@@ -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) {

View File

@@ -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;