diff --git a/frontend/app/components/Assist/ChatControls/ChatControls.css b/frontend/app/components/Assist/ChatControls/ChatControls.css new file mode 100644 index 000000000..7ec77f758 --- /dev/null +++ b/frontend/app/components/Assist/ChatControls/ChatControls.css @@ -0,0 +1,29 @@ +.controls { + height: 38px; + /* margin-top: 5px; */ + /* background-color: white; */ + /* border-top: solid thin #CCC; */ +} + +.btnWrapper { + display: flex; + align-items: center; + height: 24px; + font-size: 12px; + color: $gray-medium; + + &.disabled { + /* background-color: red; */ + & svg { + fill: red; + } + } +} + +.endButton { + background-color: $red; + border-radius: 3px; + padding: 2px 8px; + color: white; + font-size: 12px; +} \ No newline at end of file diff --git a/frontend/app/components/Assist/ChatControls/ChatControls.tsx b/frontend/app/components/Assist/ChatControls/ChatControls.tsx new file mode 100644 index 000000000..6ca747455 --- /dev/null +++ b/frontend/app/components/Assist/ChatControls/ChatControls.tsx @@ -0,0 +1,54 @@ +import React, { useState } from 'react' +import stl from './ChatControls.css' +import cn from 'classnames' +import { Button, Icon } from 'UI' + +interface Props { + stream: MediaStream | null, + endCall: () => void +} +function ChatControls({ stream, endCall } : Props) { + const [audioEnabled, setAudioEnabled] = useState(true) + const [videoEnabled, setVideoEnabled] = useState(true) + + const toggleAudio = () => { + if (!stream) { return; } + const aEn = !audioEnabled + stream.getAudioTracks().forEach(track => track.enabled = aEn); + setAudioEnabled(aEn); + } + + const toggleVideo = () => { + if (!stream) { return; } + const vEn = !videoEnabled; + stream.getVideoTracks().forEach(track => track.enabled = vEn); + setVideoEnabled(vEn) + } + + return ( +
+
+
+ +
+ +
+ +
+
+
+ +
+
+ ) +} + +export default ChatControls diff --git a/frontend/app/components/Assist/ChatControls/index.js b/frontend/app/components/Assist/ChatControls/index.js new file mode 100644 index 000000000..0b52c7325 --- /dev/null +++ b/frontend/app/components/Assist/ChatControls/index.js @@ -0,0 +1 @@ +export { default } from './ChatControls' \ No newline at end of file diff --git a/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx b/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx index e84b836bf..63d67dc0f 100644 --- a/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx +++ b/frontend/app/components/Assist/ChatWindow/ChatWindow.tsx @@ -1,29 +1,35 @@ import React, { useState, FC } from 'react' import VideoContainer from '../components/VideoContainer' -import { Icon, Popup } from 'UI' +import { Icon, Popup, Button } from 'UI' import cn from 'classnames' +import Counter from 'App/components/shared/SessionItem/Counter' +import stl from './chatWindow.css' +import ChatControls from '../ChatControls/ChatControls' export interface Props { incomeStream: MediaStream | null, - localStream: MediaStream | null - // call: (oStream: MediaStream, cb: (iStream: MediaStream)=>void)=>void + localStream: MediaStream | null, + userId: String, + endCall: () => void } -const ChatWindow: FC = function ChatWindow({ incomeStream, localStream }) { +const ChatWindow: FC = function ChatWindow({ userId, incomeStream, localStream, endCall }) { const [minimize, setMinimize] = useState(false) return (
-
+
- + */}
- + {/* @@ -33,14 +39,16 @@ const ChatWindow: FC = function ChatWindow({ incomeStream, localStream }) size="tiny" inverted position="top center" - /> + /> */}
-
+
-
- +
+ +
-
+ +
) } diff --git a/frontend/app/components/Assist/ChatWindow/chatWindow.css b/frontend/app/components/Assist/ChatWindow/chatWindow.css index 48e7501bc..2fc4e451e 100644 --- a/frontend/app/components/Assist/ChatWindow/chatWindow.css +++ b/frontend/app/components/Assist/ChatWindow/chatWindow.css @@ -1,8 +1,15 @@ -.wrapepr { +.wrapper { background-color: white; - border: solid thin #CCC; + border: solid thin #000; border-radius: 3px; position: fixed; - height: 400px; width: 300px; +} + +.headerTitle { + font-size: 12px; + max-width: 180px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } \ No newline at end of file diff --git a/frontend/app/components/Assist/assist.stories.js b/frontend/app/components/Assist/assist.stories.js index 2bff5204d..6259d45bd 100644 --- a/frontend/app/components/Assist/assist.stories.js +++ b/frontend/app/components/Assist/assist.stories.js @@ -3,6 +3,6 @@ import ChatWindow from './ChatWindow'; storiesOf('Assist', module) .add('ChatWindow', () => ( - + )) diff --git a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx index 652ac7099..d3a219f57 100644 --- a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx +++ b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx @@ -56,15 +56,16 @@ function AssistActions({ toggleChatWindow, userId, calling }: Props) { + { inCall ? 'End Meeting' : 'Start Meeting' }
} content={ `Call ${userId}` } @@ -73,7 +74,7 @@ function AssistActions({ toggleChatWindow, userId, calling }: Props) { position="top right" />
- { inCall && } + { inCall && }
) diff --git a/frontend/app/components/Assist/components/VideoContainer/VideoContainer.css b/frontend/app/components/Assist/components/VideoContainer/VideoContainer.css index 9a21f02c0..fc45fc800 100644 --- a/frontend/app/components/Assist/components/VideoContainer/VideoContainer.css +++ b/frontend/app/components/Assist/components/VideoContainer/VideoContainer.css @@ -1,6 +1,6 @@ -.controls { - margin-bottom: 8px; - margin-right: 15px; +.controls { + height: 28px; + background-color: red; } .btnWrapper { diff --git a/frontend/app/components/Assist/components/VideoContainer/VideoContainer.tsx b/frontend/app/components/Assist/components/VideoContainer/VideoContainer.tsx index 10bd09c66..42a5279b7 100644 --- a/frontend/app/components/Assist/components/VideoContainer/VideoContainer.tsx +++ b/frontend/app/components/Assist/components/VideoContainer/VideoContainer.tsx @@ -5,12 +5,13 @@ import stl from './VideoContainer.css' interface Props { stream: MediaStream | null - muted?: boolean + muted?: boolean, + height?: number } -function VideoContainer({ stream, muted = false }: Props) { - const [audioEnabled, setAudioEnabled] = useState(true) - const [videoEnabled, setVideoEnabled] = useState(true) +function VideoContainer({ stream, muted = false, height = 280 }: Props) { + // const [audioEnabled, setAudioEnabled] = useState(true) + // const [videoEnabled, setVideoEnabled] = useState(true) const ref = useRef(null); useEffect(() => { @@ -19,25 +20,25 @@ function VideoContainer({ stream, muted = false }: Props) { } }, [ ref.current, stream ]) - const toggleAudio = () => { - if (!stream) { return; } - const aEn = !audioEnabled - stream.getAudioTracks().forEach(track => track.enabled = aEn); - setAudioEnabled(aEn); - } + // const toggleAudio = () => { + // if (!stream) { return; } + // const aEn = !audioEnabled + // stream.getAudioTracks().forEach(track => track.enabled = aEn); + // setAudioEnabled(aEn); + // } - const toggleVideo = () => { - if (!stream) { return; } - const vEn = !videoEnabled; - stream.getVideoTracks().forEach(track => track.enabled = vEn); - setVideoEnabled(vEn) - } + // const toggleVideo = () => { + // if (!stream) { return; } + // const vEn = !videoEnabled; + // stream.getVideoTracks().forEach(track => track.enabled = vEn); + // setVideoEnabled(vEn) + // } return ( -
-
-