diff --git a/app/lib/RoomClient.js b/app/lib/RoomClient.js index c9ebcf7..833ef3e 100644 --- a/app/lib/RoomClient.js +++ b/app/lib/RoomClient.js @@ -486,6 +486,35 @@ export default class RoomClient }); } + raiseHand() + { + logger.debug('raiseHand()'); + + this._dispatch( + stateActions.setRaiseHandInProgress(true)); + + this._dispatch( + stateActions.setRaiseHandState(true)); + + this._dispatch( + stateActions.setRaiseHandInProgress(false)); + + } + + lowerHand() + { + logger.debug('lowerHand()'); + + this._dispatch( + stateActions.setRaiseHandInProgress(true)); + + this._dispatch( + stateActions.setRaiseHandState(false)); + + this._dispatch( + stateActions.setRaiseHandInProgress(false)); + } + restartIce() { logger.debug('restartIce()'); diff --git a/app/lib/components/Room.jsx b/app/lib/components/Room.jsx index 74284bc..ca0663b 100644 --- a/app/lib/components/Room.jsx +++ b/app/lib/components/Room.jsx @@ -23,6 +23,7 @@ class Room extends React.Component onRoomLinkCopy, onSetAudioMode, onRestartIce, + onToggleHand, onLeaveMeeting } = this.props; @@ -98,6 +99,16 @@ class Room extends React.Component onClick={() => onRestartIce()} /> +
onToggleHand(!me.raiseHand)} + /> +
{ dispatch(requestActions.restartIce()); }, + onToggleHand : (enable) => + { + if (enable) + dispatch(requestActions.raiseHand()); + else + dispatch(requestActions.lowerHand()); + }, onLeaveMeeting : () => { dispatch(requestActions.leaveRoom()); diff --git a/app/lib/redux/reducers/me.js b/app/lib/redux/reducers/me.js index b692b1d..f50d082 100644 --- a/app/lib/redux/reducers/me.js +++ b/app/lib/redux/reducers/me.js @@ -10,6 +10,8 @@ const initialState = webcamInProgress : false, audioOnly : false, audioOnlyInProgress : false, + raiseHand : false, + raiseHandInProgress : false, restartIceInProgress : false }; @@ -70,6 +72,20 @@ const me = (state = initialState, action) => return { ...state, audioOnlyInProgress: flag }; } + case 'SET_RAISE_HAND_STATE': + { + const { enabled } = action.payload; + + return { ...state, raiseHand: enabled }; + } + + case 'SET_RAISE_HAND_STATE_IN_PROGRESS': + { + const { flag } = action.payload; + + return { ...state, raiseHandInProgress: flag }; + } + case 'SET_RESTART_ICE_IN_PROGRESS': { const { flag } = action.payload; diff --git a/app/lib/redux/requestActions.js b/app/lib/redux/requestActions.js index 14210ef..074d315 100644 --- a/app/lib/redux/requestActions.js +++ b/app/lib/redux/requestActions.js @@ -78,6 +78,20 @@ export const disableAudioOnly = () => }; }; +export const raiseHand = () => +{ + return { + type : 'RAISE_HAND' + }; +}; + +export const lowerHand = () => +{ + return { + type : 'LOWER_HAND' + }; +}; + export const restartIce = () => { return { diff --git a/app/lib/redux/roomClientMiddleware.js b/app/lib/redux/roomClientMiddleware.js index 271d700..caab57f 100644 --- a/app/lib/redux/roomClientMiddleware.js +++ b/app/lib/redux/roomClientMiddleware.js @@ -102,6 +102,20 @@ export default ({ dispatch, getState }) => (next) => break; } + case 'RAISE_HAND': + { + client.raiseHand(); + + break; + } + + case 'LOWER_HAND': + { + client.lowerHand(); + + break; + } + case 'RESTART_ICE': { client.restartIce(); diff --git a/app/lib/redux/stateActions.js b/app/lib/redux/stateActions.js index bd19225..48fd0d1 100644 --- a/app/lib/redux/stateActions.js +++ b/app/lib/redux/stateActions.js @@ -70,6 +70,22 @@ export const setAudioOnlyInProgress = (flag) => }; }; +export const setRaiseHandState = (enabled) => +{ + return { + type : 'SET_RAISE_HAND_STATE', + payload : { enabled } + }; +}; + +export const setRaiseHandInProgress = (flag) => +{ + return { + type : 'SET_RAISE_HAND_STATE_IN_PROGRESS', + payload : { flag } + }; +}; + export const setRestartIceInProgress = (flag) => { return { diff --git a/app/stylus/components/Room.styl b/app/stylus/components/Room.styl index 5cd6b26..717df68 100644 --- a/app/stylus/components/Room.styl +++ b/app/stylus/components/Room.styl @@ -232,6 +232,10 @@ } } + &.raise-hand { + background-image: url('/resources/images/leave-meeting.svg'); + } + &.leave-meeting { background-image: url('/resources/images/leave-meeting.svg'); }