mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
fixed trash dialog
This commit is contained in:
parent
87670770b0
commit
67eeaa7293
1 changed files with 29 additions and 16 deletions
|
@ -1,18 +1,27 @@
|
|||
import React from 'react';
|
||||
import { Icon } from '~/components/panels/Icon';
|
||||
import React, { FC } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import * as EDITOR_ACTIONS from '~/redux/editor/actions';
|
||||
|
||||
type Props = {
|
||||
clearPoly: () => void,
|
||||
clearStickers: () => void,
|
||||
clearAll: () => void,
|
||||
clearCancel: () => void,
|
||||
const mapStateToProps = () => ({});
|
||||
const mapDispatchToProps = {
|
||||
editorClearPoly: EDITOR_ACTIONS.editorClearPoly,
|
||||
editorClearStickers: EDITOR_ACTIONS.editorClearStickers,
|
||||
editorClearAll: EDITOR_ACTIONS.editorClearAll,
|
||||
editorClearCancel: EDITOR_ACTIONS.editorClearCancel,
|
||||
};
|
||||
|
||||
width: number,
|
||||
}
|
||||
type Props = ReturnType<typeof mapStateToProps> &
|
||||
typeof mapDispatchToProps & {
|
||||
width: number;
|
||||
};
|
||||
|
||||
export const TrashDialog = ({
|
||||
clearPoly, clearStickers, clearAll, clearCancel, width,
|
||||
}: Props) => (
|
||||
const TrashDialogUnconnected: FC<Props> = ({
|
||||
editorClearPoly,
|
||||
editorClearStickers,
|
||||
editorClearAll,
|
||||
editorClearCancel,
|
||||
width,
|
||||
}) => (
|
||||
<div className="control-dialog" style={{ width }}>
|
||||
<div className="helper trash-helper desktop-only">
|
||||
<div className="helper__text danger">
|
||||
|
@ -22,21 +31,25 @@ export const TrashDialog = ({
|
|||
<div className="helper trash-helper">
|
||||
<div className="helper__buttons flex_1 trash-buttons">
|
||||
<div className="button-group">
|
||||
<div className="button router-helper__button" onClick={clearPoly}>
|
||||
<div className="button router-helper__button" onClick={editorClearPoly}>
|
||||
Маршрут
|
||||
</div>
|
||||
<div className="button router-helper__button" onClick={clearStickers}>
|
||||
<div className="button router-helper__button" onClick={editorClearStickers}>
|
||||
Стикеры
|
||||
</div>
|
||||
<div className="button router-helper__button" onClick={clearAll}>
|
||||
<div className="button router-helper__button" onClick={editorClearAll}>
|
||||
ВСЕ
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex_1" />
|
||||
<div className="button primary router-helper__button" onClick={clearCancel}>
|
||||
<div className="button primary router-helper__button" onClick={editorClearCancel}>
|
||||
Отмена
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const TrashDialog = connect(mapStateToProps, mapDispatchToProps)(TrashDialogUnconnected);
|
||||
|
||||
export { TrashDialog };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue