From 1822e82abd31f32bc797b6631d10a968869d46cf Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond <evhan55@gmail.com> Date: Fri, 14 Sep 2018 15:13:46 -0400 Subject: [PATCH] Renaming viewAlert to showAlert. --- src/containers/alerts.jsx | 4 ++-- src/lib/vm-listener-hoc.jsx | 8 ++++---- src/reducers/alerts.js | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/containers/alerts.jsx b/src/containers/alerts.jsx index 12b7b6b3e..96d8151cd 100644 --- a/src/containers/alerts.jsx +++ b/src/containers/alerts.jsx @@ -1,7 +1,7 @@ import {connect} from 'react-redux'; import { - viewAlert + showAlert } from '../reducers/alerts'; import AlertsComponent from '../components/alerts/alerts.jsx'; @@ -12,7 +12,7 @@ const mapStateToProps = state => ({ }); const mapDispatchToProps = dispatch => ({ - onViewAlert: () => dispatch(viewAlert()) + onShowAlert: () => dispatch(showAlert()) }); export default connect( diff --git a/src/lib/vm-listener-hoc.jsx b/src/lib/vm-listener-hoc.jsx index 7c3d22c87..9d7e3ecd0 100644 --- a/src/lib/vm-listener-hoc.jsx +++ b/src/lib/vm-listener-hoc.jsx @@ -9,7 +9,7 @@ import {updateTargets} from '../reducers/targets'; import {updateBlockDrag} from '../reducers/block-drag'; import {updateMonitors} from '../reducers/monitors'; import {setRunningState, setTurboState} from '../reducers/vm-status'; -import {viewAlert} from '../reducers/alerts'; +import {showAlert} from '../reducers/alerts'; /* * Higher Order Component to manage events emitted by the VM @@ -37,7 +37,7 @@ const vmListenerHOC = function (WrappedComponent) { this.props.vm.on('TURBO_MODE_OFF', this.props.onTurboModeOff); this.props.vm.on('PROJECT_RUN_START', this.props.onProjectRunStart); this.props.vm.on('PROJECT_RUN_STOP', this.props.onProjectRunStop); - this.props.vm.on('PERIPHERAL_CONNECTED', this.props.onViewAlert); + this.props.vm.on('PERIPHERAL_CONNECTED', this.props.onShowAlert); } componentDidMount () { if (this.props.attachKeyboardEvents) { @@ -95,7 +95,7 @@ const vmListenerHOC = function (WrappedComponent) { onProjectRunStop, onTurboModeOff, onTurboModeOn, - onViewAlert, + onShowAlert, /* eslint-enable no-unused-vars */ ...props } = this.props; @@ -139,7 +139,7 @@ const vmListenerHOC = function (WrappedComponent) { onProjectRunStop: () => dispatch(setRunningState(false)), onTurboModeOn: () => dispatch(setTurboState(true)), onTurboModeOff: () => dispatch(setTurboState(false)), - onViewAlert: () => dispatch(viewAlert()) + onShowAlert: () => dispatch(showAlert()) }); return connect( mapStateToProps, diff --git a/src/reducers/alerts.js b/src/reducers/alerts.js index 22bdfa760..255cc3173 100644 --- a/src/reducers/alerts.js +++ b/src/reducers/alerts.js @@ -1,5 +1,5 @@ const CLOSE_ALERT = 'scratch-gui/alerts/CLOSE_ALERT'; -const VIEW_ALERT = 'scratch-gui/alerts/VIEW_ALERT'; +const SHOW_ALERT = 'scratch-gui/alerts/SHOW_ALERT'; const initialState = { message: 'testing alerts!!', @@ -9,7 +9,7 @@ const initialState = { const reducer = function (state, action) { if (typeof state === 'undefined') state = initialState; switch (action.type) { - case VIEW_ALERT: + case SHOW_ALERT: return Object.assign({}, state, { visible: true }); @@ -26,13 +26,13 @@ const closeAlert = function () { return {type: CLOSE_ALERT}; }; -const viewAlert = function () { - return {type: VIEW_ALERT}; +const showAlert = function () { + return {type: SHOW_ALERT}; }; export { reducer as default, initialState as alertsInitialState, closeAlert, - viewAlert + showAlert }; -- GitLab