Merge branch 'feature-toolarea' into develop

This commit is contained in:
Håvar Aambø Fosstveit
2018-06-21 09:56:21 +02:00
23 changed files with 1389 additions and 451 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ import consumers from './consumers';
import notifications from './notifications';
import chatmessages from './chatmessages';
import chatbehavior from './chatbehavior';
import toolarea from './toolarea';
const reducers = combineReducers(
{
@@ -17,7 +18,8 @@ const reducers = combineReducers(
consumers,
notifications,
chatmessages,
chatbehavior
chatbehavior,
toolarea
});
export default reducers;
+13
View File
@@ -60,6 +60,19 @@ const peers = (state = initialState, action) =>
return { ...state, [newPeer.name]: newPeer };
}
case 'SET_PEER_SCREEN_IN_PROGRESS':
{
const { peerName, flag } = action.payload;
const peer = state[peerName];
if (!peer)
throw new Error('no Peer found');
const newPeer = { ...peer, peerScreenInProgress: flag };
return { ...state, [newPeer.name]: newPeer };
}
case 'SET_PEER_RAISE_HAND_STATE':
{
const { peerName, raiseHandState } = action.payload;
+30
View File
@@ -0,0 +1,30 @@
const initialState =
{
toolAreaOpen : false,
currentToolTab : 'chat' // chat, settings, layout, users
};
const toolarea = (state = initialState, action) =>
{
switch (action.type)
{
case 'TOGGLE_TOOL_AREA':
{
const toolAreaOpen = !state.toolAreaOpen;
return { ...state, toolAreaOpen };
}
case 'SET_TOOL_TAB':
{
const { toolTab } = action.payload;
return { ...state, currentToolTab: toolTab };
}
default:
return state;
}
};
export default toolarea;
+16
View File
@@ -119,6 +119,22 @@ export const resumePeerVideo = (peerName) =>
};
};
export const pausePeerScreen = (peerName) =>
{
return {
type : 'PAUSE_PEER_SCREEN',
payload : { peerName }
};
};
export const resumePeerScreen = (peerName) =>
{
return {
type : 'RESUME_PEER_SCREEN',
payload : { peerName }
};
};
export const userLogin = () =>
{
return {
+18
View File
@@ -149,6 +149,24 @@ export default ({ dispatch, getState }) => (next) =>
break;
}
case 'PAUSE_PEER_SCREEN':
{
const { peerName } = action.payload;
client.pausePeerScreen(peerName);
break;
}
case 'RESUME_PEER_SCREEN':
{
const { peerName } = action.payload;
client.resumePeerScreen(peerName);
break;
}
case 'RAISE_HAND':
{
client.sendRaiseHandState(true);
+23
View File
@@ -125,6 +125,14 @@ export const setPeerAudioInProgress = (peerName, flag) =>
};
};
export const setPeerScreenInProgress = (peerName, flag) =>
{
return {
type : 'SET_PEER_SCREEN_IN_PROGRESS',
payload : { peerName, flag }
};
};
export const setMyRaiseHandState = (flag) =>
{
return {
@@ -148,6 +156,21 @@ export const toggleSettings = () =>
};
};
export const toggleToolArea = () =>
{
return {
type : 'TOGGLE_TOOL_AREA'
};
};
export const setToolTab = (toolTab) =>
{
return {
type : 'SET_TOOL_TAB',
payload : { toolTab }
};
};
export const setMyRaiseHandStateInProgress = (flag) =>
{
return {