diff --git a/src/components/alerts/alert.css b/src/components/alerts/alert.css index 236af5caf2f3147bc0c066021bfb90fd51f4d9bb..3a3584bfd2ad676ab925d8ad5c495eee8b10e1c7 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 9d7e3ecd0772fbfa44a547e985b5d9ed0796a5a6..4359e986559a833c4a93108c68bf9fb00dd8173f 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 255cc3173fd323ec89896ecb07e37753cb01bdc6..7442394e774594a1dab5eb4d87aa098a832e4d6b 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;