From 1e1d511d21ce1c40cdfff727b29d79cf21ea5219 Mon Sep 17 00:00:00 2001 From: HF Date: Thu, 9 Jan 2020 21:32:37 +0100 Subject: [PATCH] add HistorySelection dialog --- src/actions/index.js | 6 ++ src/actions/types.js | 1 + src/components/App.jsx | 36 +++++++-- src/components/HistorySelect.jsx | 128 +++++++++++++++++++++++++++++++ src/components/SettingsModal.jsx | 19 +++++ src/components/base.tcss | 25 +++++- src/reducers/canvas.js | 32 ++++++-- src/store/rendererHook.js | 1 + 8 files changed, 231 insertions(+), 17 deletions(-) create mode 100644 src/components/HistorySelect.jsx diff --git a/src/actions/index.js b/src/actions/index.js index 568ba65b..061b052f 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -35,6 +35,12 @@ export function toggleChatBox(): Action { }; } +export function toggleHistoricalView(): Action { + return { + type: 'TOGGLE_HISTORICAL_VIEW', + }; +} + export function toggleGrid(): Action { return { type: 'TOGGLE_GRID', diff --git a/src/actions/types.js b/src/actions/types.js index 2265b221..bb9c8b79 100644 --- a/src/actions/types.js +++ b/src/actions/types.js @@ -24,6 +24,7 @@ export type Action = | { type: 'TOGGLE_POTATO_MODE' } | { type: 'TOGGLE_LIGHT_GRID' } | { type: 'TOGGLE_OPEN_MENU' } + | { type: 'TOGGLE_HISTORICAL_VIEW' } | { type: 'SET_NOTIFICATION', notification: string } | { type: 'UNSET_NOTIFICATION' } | { type: 'SET_PLACE_ALLOWED', placeAllowed: boolean } diff --git a/src/components/App.jsx b/src/components/App.jsx index 004b5ed8..c069e767 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -4,8 +4,10 @@ */ import React from 'react'; +import { connect } from 'react-redux'; import { IconContext } from 'react-icons'; +import type { State } from '../reducers'; import CoolDownBox from './CoolDownBox'; import NotifyBox from './NotifyBox'; import CoordinatesBox from './CoordinatesBox'; @@ -20,31 +22,49 @@ import Menu from './Menu'; import ReCaptcha from './ReCaptcha'; import ExpandMenuButton from './ExpandMenuButton'; import ModalRoot from './ModalRoot'; +import HistorySelect from './HistorySelect'; import baseCss from './base.tcss'; -const App = () => ( +const App = ({ isHistoricalView }) => (