From 67eeaa7293b36f2560e7a3ac62983d14828d6b57 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Thu, 9 Jan 2020 11:47:01 +0700 Subject: [PATCH] fixed trash dialog --- src/components/dialogs/TrashDialog.tsx | 45 +++++++++++++++++--------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/components/dialogs/TrashDialog.tsx b/src/components/dialogs/TrashDialog.tsx index fcb19c9..e22abab 100644 --- a/src/components/dialogs/TrashDialog.tsx +++ b/src/components/dialogs/TrashDialog.tsx @@ -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 mapDispatchToProps & { + width: number; + }; -export const TrashDialog = ({ - clearPoly, clearStickers, clearAll, clearCancel, width, -}: Props) => ( +const TrashDialogUnconnected: FC = ({ + editorClearPoly, + editorClearStickers, + editorClearAll, + editorClearCancel, + width, +}) => (
@@ -22,21 +31,25 @@ export const TrashDialog = ({
-
+
Маршрут
-
+
Стикеры
-
+
ВСЕ
-
+
Отмена
); + +const TrashDialog = connect(mapStateToProps, mapDispatchToProps)(TrashDialogUnconnected); + +export { TrashDialog };