From 590c24a3bdaed674d0a002c6bd4419145ff6e50e Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Mon, 18 Feb 2019 13:01:22 +0100 Subject: [PATCH] Add "Show Activity" switch --- app/src/App.tsx | 1 + app/src/actions/Settings.ts | 6 ++++ app/src/components/Settings.tsx | 22 +++++++++++++- app/src/components/Tree/Tree.tsx | 4 ++- app/src/components/Tree/TreeNode.tsx | 9 +++--- app/src/components/Tree/TreeNodeSubnodes.tsx | 4 +-- app/src/reducers/Settings.ts | 31 +++++++++++++++----- 7 files changed, 60 insertions(+), 17 deletions(-) diff --git a/app/src/App.tsx b/app/src/App.tsx index 4b978ba..3130f29 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -94,6 +94,7 @@ const mapStateToProps = (state: AppState) => { settingsVisible: state.settings.visible, connectionId: state.connection.connectionId, error: state.globalState.error, + highlightTopicUpdates: state.settings.highlightTopicUpdates, } } diff --git a/app/src/actions/Settings.ts b/app/src/actions/Settings.ts index ae90b8f..4f401cc 100644 --- a/app/src/actions/Settings.ts +++ b/app/src/actions/Settings.ts @@ -21,6 +21,12 @@ export const toggleSettingsVisibility = (): Action => { } } +export const togglehighlightTopicUpdates = (): Action => { + return { + type: ActionTypes.SETTINGS_TOGGLE_HIGHLIGHT_ACTIVITY, + } +} + export const setTopicOrder = (topicOrder: TopicOrder = TopicOrder.none): Action => { return { topicOrder, diff --git a/app/src/components/Settings.tsx b/app/src/components/Settings.tsx index 1f24c8b..657e8a4 100644 --- a/app/src/components/Settings.tsx +++ b/app/src/components/Settings.tsx @@ -10,6 +10,7 @@ import { MenuItem, Select, Typography, + Switch, } from '@material-ui/core' import { StyleRulesCallback, withStyles } from '@material-ui/core/styles' @@ -58,6 +59,7 @@ const styles: StyleRulesCallback = theme => ({ interface Props { autoExpandLimit: number + highlightTopicUpdates: boolean visible: boolean store?: any topicOrder: TopicOrder @@ -96,12 +98,29 @@ class Settings extends React.Component { {this.renderAutoExpand()} {this.renderNodeOrder()} + {this.renderhighlightTopicUpdates()} ) } + private renderhighlightTopicUpdates() { + const { highlightTopicUpdates, actions } = this.props + + return ( +
+ Show Activity + +
+ ) + } + private renderAutoExpand() { const { classes, autoExpandLimit } = this.props @@ -132,7 +151,7 @@ class Settings extends React.Component { return (
- Topic order + Topic Order