From 91a9ba7757985e06c6852a6989a28a2610dd8f6a Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Mon, 15 Apr 2019 15:52:27 +0200 Subject: [PATCH] Refactor CustomIconButtons --- app/src/actions/Connection.ts | 4 +-- app/src/components/Layout/PauseButton.tsx | 8 ++---- app/src/components/Sidebar/Sidebar.tsx | 28 ++++++++----------- app/src/components/helper/Copy.tsx | 12 ++++---- .../components/helper/CustomIconButton.tsx | 13 ++++++--- 5 files changed, 29 insertions(+), 36 deletions(-) diff --git a/app/src/actions/Connection.ts b/app/src/actions/Connection.ts index 1c94079..b4ff095 100644 --- a/app/src/actions/Connection.ts +++ b/app/src/actions/Connection.ts @@ -1,13 +1,13 @@ import * as q from '../../../backend/src/Model' import * as url from 'url' import { Action, ActionTypes } from '../reducers/Connection' -import { Action as SettingsAction, ActionTypes as SettingsActionTypes } from '../reducers/Settings' +import { ActionTypes as SettingsActionTypes } from '../reducers/Settings' import { AppState } from '../reducers' import { DataSourceState, MqttOptions } from '../../../backend/src/DataSource' import { Dispatch } from 'redux' import { globalActions } from '.' +import { resetStore as resetTreeStore, showTree } from './Tree' import { showError } from './Global' -import { showTree, resetStore as resetTreeStore } from './Tree' import { TopicViewModel } from '../model/TopicViewModel' import { addMqttConnectionEvent, diff --git a/app/src/components/Layout/PauseButton.tsx b/app/src/components/Layout/PauseButton.tsx index 9588cdf..91039fb 100644 --- a/app/src/components/Layout/PauseButton.tsx +++ b/app/src/components/Layout/PauseButton.tsx @@ -71,12 +71,8 @@ class PauseButton extends React.Component { return (
- - -
- {this.props.paused ? : } -
-
+ + {this.props.paused ? : }
{this.props.paused ? this.renderBufferStats() : null} diff --git a/app/src/components/Sidebar/Sidebar.tsx b/app/src/components/Sidebar/Sidebar.tsx index f8e2d98..6b12603 100644 --- a/app/src/components/Sidebar/Sidebar.tsx +++ b/app/src/components/Sidebar/Sidebar.tsx @@ -70,12 +70,8 @@ class Sidebar extends React.Component { } return ( - this.deleteTopic(this.props.node)}> - - - - - + this.deleteTopic(this.props.node)} tooltip="Clear this topic"> + ) } @@ -88,17 +84,15 @@ class Sidebar extends React.Component { } return ( - this.deleteTopic(this.props.node, true, deleteLimit)}> - - {topicCount >= deleteLimit ? '50+' : topicCount}} - color="secondary" - > - - - - + {topicCount >= deleteLimit ? '50+' : topicCount}} + color="secondary" + > + this.deleteTopic(this.props.node, true, deleteLimit)} tooltip={`Deletes up to ${deleteLimit} sub-topics with a single click`}> + + + ) } diff --git a/app/src/components/helper/Copy.tsx b/app/src/components/helper/Copy.tsx index 49bf06a..6568f6a 100644 --- a/app/src/components/helper/Copy.tsx +++ b/app/src/components/helper/Copy.tsx @@ -48,13 +48,11 @@ class Copy extends React.Component { return ( - - - - {icon} - - - + + + {icon} + + ({ @@ -26,7 +27,11 @@ class CustomIconButton extends React.Component { public render() { return ( - {this.props.children} + + + {this.props.children} + + ) } }