mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-05-11 10:56:41 +07:00
redux: fixed performance regression
This commit is contained in:
parent
2171a50ef1
commit
0f3217f5df
8 changed files with 88 additions and 96 deletions
|
@ -1,18 +1,24 @@
|
|||
import React from 'react';
|
||||
|
||||
import { MODES } from '$constants/modes';
|
||||
import { editor } from '$modules/Editor';
|
||||
|
||||
export class CancelDialog extends React.Component {
|
||||
type Props = {
|
||||
stopEditing: Function,
|
||||
setMode: Function,
|
||||
setEditing: Function,
|
||||
};
|
||||
|
||||
export class CancelDialog extends React.Component<Props, void> {
|
||||
cancel = () => {
|
||||
this.props.editor.stopEditing();
|
||||
editor.cancelEditing();
|
||||
// this.props.stopEditing();
|
||||
this.props.setEditing(false);
|
||||
this.props.setMode(MODES.NONE);
|
||||
};
|
||||
|
||||
proceed = () => {
|
||||
this.props.editor.changeMode(MODES.NONE);
|
||||
};
|
||||
|
||||
save = () => {
|
||||
this.props.editor.changeMode(MODES.SAVE);
|
||||
this.props.setMode(MODES.NONE);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
@ -24,13 +30,10 @@ export class CancelDialog extends React.Component {
|
|||
</div>
|
||||
<div className="helper__buttons button-group">
|
||||
<div className="button router-helper__button" onClick={this.cancel}>
|
||||
Закрыть
|
||||
Удалить все
|
||||
</div>
|
||||
<div className="button success router-helper__button" onClick={this.proceed}>
|
||||
Продолжить
|
||||
</div>
|
||||
<div className="button primary router-helper__button" onClick={this.save}>
|
||||
Сохранить
|
||||
<div className="button primary router-helper__button" onClick={this.proceed}>
|
||||
Вернуться
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue