From 0366e3517bf60875025b13411cbbd2c0de75b9be Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond <evhan55@gmail.com> Date: Fri, 14 Sep 2018 15:20:43 -0400 Subject: [PATCH] Changing alert to 'peripheral error'. --- src/components/alerts/alert.css | 2 ++ src/lib/vm-listener-hoc.jsx | 4 ++-- src/reducers/alerts.js | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/alerts/alert.css b/src/components/alerts/alert.css index 236af5caf..3a3584bfd 100644 --- a/src/components/alerts/alert.css +++ b/src/components/alerts/alert.css @@ -17,6 +17,8 @@ background: orange; height: 60px; width: 300px; + line-height: 60px; + color: $ui-white; z-index: 20; overflow: hidden; box-shadow: 0px 5px 25px 5px $ui-black-transparent; diff --git a/src/lib/vm-listener-hoc.jsx b/src/lib/vm-listener-hoc.jsx index 9d7e3ecd0..4359e9865 100644 --- a/src/lib/vm-listener-hoc.jsx +++ b/src/lib/vm-listener-hoc.jsx @@ -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.onShowAlert); + this.props.vm.on('PERIPHERAL_ERROR', this.props.onShowAlert); } componentDidMount () { if (this.props.attachKeyboardEvents) { @@ -110,10 +110,10 @@ const vmListenerHOC = function (WrappedComponent) { onMonitorsUpdate: PropTypes.func.isRequired, onProjectRunStart: PropTypes.func.isRequired, onProjectRunStop: PropTypes.func.isRequired, + onShowAlert: PropTypes.func.isRequired, onTargetsUpdate: PropTypes.func.isRequired, onTurboModeOff: PropTypes.func.isRequired, onTurboModeOn: PropTypes.func.isRequired, - onViewAlert: PropTypes.func.isRequired, username: PropTypes.string, vm: PropTypes.instanceOf(VM).isRequired }; diff --git a/src/reducers/alerts.js b/src/reducers/alerts.js index 255cc3173..7442394e7 100644 --- a/src/reducers/alerts.js +++ b/src/reducers/alerts.js @@ -2,7 +2,7 @@ const CLOSE_ALERT = 'scratch-gui/alerts/CLOSE_ALERT'; const SHOW_ALERT = 'scratch-gui/alerts/SHOW_ALERT'; const initialState = { - message: 'testing alerts!!', + message: 'Peripheral error', visible: false }; @@ -15,7 +15,7 @@ const reducer = function (state, action) { }); case CLOSE_ALERT: return Object.assign({}, state, { - message: 'closing alert!' + message: 'Closing alert!' }); default: return state; -- GitLab