@@ -38,7 +38,7 @@ const CallView = ( {isRecording, isPlaying, audioPlayer, handleStopCall, handleC
setIsCallView(false)} />
- >
+
)
}
diff --git a/client/web/src/components/CallView/style.css b/client/web/src/components/CallView/style.css
index 814f4780a..e1572b5de 100644
--- a/client/web/src/components/CallView/style.css
+++ b/client/web/src/components/CallView/style.css
@@ -88,4 +88,15 @@
align-items: center;
justify-content: space-between;
flex-grow: 1;
+}
+
+.call-screen {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+ flex-grow: 1;
+ width: 100%;
+ height: 30vh;
+ padding: 20px;
}
\ No newline at end of file
diff --git a/client/web/src/components/Common/IconButton.js b/client/web/src/components/Common/IconButton.js
index 72d62762f..831f0d7df 100644
--- a/client/web/src/components/Common/IconButton.js
+++ b/client/web/src/components/Common/IconButton.js
@@ -8,9 +8,10 @@
import React from 'react';
import './styles.css';
-const IconButton = ({ Icon, className, onClick, bgcolor="default"}) => {
+const IconButton = ({ Icon, className, onClick, bgcolor="default", disabled=false}) => {
return (
-
+
);
diff --git a/client/web/src/components/Common/styles.css b/client/web/src/components/Common/styles.css
index 4a5d73e73..af1d70090 100644
--- a/client/web/src/components/Common/styles.css
+++ b/client/web/src/components/Common/styles.css
@@ -78,3 +78,8 @@
.icon-button:hover .icon-instance-node-small {
filter: brightness(2);
}
+
+.icon-button.disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
\ No newline at end of file
diff --git a/client/web/src/components/TextView/index.js b/client/web/src/components/TextView/index.js
index 43713a789..018c44e84 100644
--- a/client/web/src/components/TextView/index.js
+++ b/client/web/src/components/TextView/index.js
@@ -5,13 +5,17 @@
* created by Lynchee on 7/16/23
*/
-import React, { useEffect, useRef } from 'react';
+import React, { useEffect, useRef, useState} from 'react';
import './style.css';
-import { TbPower, TbMicrophone } from 'react-icons/tb';
+import { TbPower, TbPhoneCall, TbMicrophone, TbPlayerStopFilled, TbKeyboard } from 'react-icons/tb';
import IconButton from '../Common/IconButton';
+import { MdVoiceChat } from 'react-icons/md';
+import Button from '../Common/Button';
-const TextView = ({ send, isPlaying, stopAudioPlayback, textAreaValue, setTextAreaValue, messageInput, setMessageInput, handleDisconnect, setIsCallView, useSearch, setUseSearch }) => {
+const TextView = ({ send, isPlaying, stopAudioPlayback, textAreaValue, setTextAreaValue, messageInput, setMessageInput, handleDisconnect, setIsCallView, useSearch, setUseSearch, callActive, startRecording, stopRecording }) => {
+ const [keyboard, SetKeyboard] = useState(true);
const chatWindowRef = useRef(null);
+ const talking = useRef(false);
// always show the latest chat log
useEffect(() => {
@@ -51,8 +55,29 @@ const TextView = ({ send, isPlaying, stopAudioPlayback, textAreaValue, setTextAr
setUseSearch(!useSearch);
};
+ const handlePushTalk = () => {
+ if (!talking.current) {
+ startRecording();
+ talking.current = true;
+ if (isPlaying) {
+ stopAudioPlayback();
+ }
+ } else {
+ stopRecording();
+ talking.current = false;
+ }
+ }
+
+ const handleKeyboardClick = () => {
+ SetKeyboard(true);
+ }
+
+ const handleAudioClick = () => {
+ SetKeyboard(false);
+ }
+
return (
- <>
+
-
-
-
+
+
+
+
+
+ { !callActive.current && (
+
+ {keyboard ?
+ :
+
+ }
+
+ )}
-
+
+ { !callActive.current && !keyboard ?
+
:
+
+ }
+
)
}
diff --git a/client/web/src/components/TextView/style.css b/client/web/src/components/TextView/style.css
index 0ac29af80..012a8c642 100644
--- a/client/web/src/components/TextView/style.css
+++ b/client/web/src/components/TextView/style.css
@@ -3,11 +3,26 @@
color: white;
font-size: 17px;
width: 100%;
- height: 100%;
+ height: 25vh;
border: none;
resize: none;
}
+.input-container {
+ display: flex;
+ align-items: center;
+}
+
+.text-screen {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+ flex-grow: 1;
+ width: 100%;
+ padding: 20px;
+}
+
/* text input */
input[type="text"]{font: 15px/24px 'Muli', sans-serif; color: white; width: 100%; box-sizing: border-box; letter-spacing: 1px;}
:focus{outline: none;}
@@ -39,24 +54,6 @@ input[type="text"]{font: 15px/24px "Lato", Arial, sans-serif; color: white; widt
.message-input:focus ~ .focus-border i:before,
.message-input:focus ~ .focus-border i:after{height: 100%; transition: 0.4s;}
-.send-btn {
- font-family: "Prompt", Helvetica;
- font-size: 1rem;
- border-color: #6785d3;
- color: #fff;
- box-shadow: 0 0 10px 0 #6785d3 inset, 0 0 10px 4px #6785d3;
- transition: all 150ms ease-in-out;
- cursor: pointer;
- background-color: transparent;
- padding: 0.6em 2em;
- border-radius: 1.5em;
-}
-
-.send-btn:hover {
- box-shadow: 0 0 40px 40px #6785d3 inset, 0 0 0 0 #6785d3;
- outline: 0;
-}
-
.options-container {
display: flex;
align-items: center;
@@ -67,6 +64,28 @@ input[type="text"]{font: 15px/24px "Lato", Arial, sans-serif; color: white; widt
}
.search-checkbox {
- margin-top: 5px;
+ margin-top: 15px;
+ color: white;
+}
+
+.white {
+ color: white;
+}
+
+.talk-on {
+ color: red;
+}
+
+.talk-off {
color: white;
}
+
+.recording-animation {
+ animation: pulsate 1s infinite;
+}
+
+@keyframes pulsate {
+ 0% { transform: scale(1); }
+ 50% { transform: scale(1.1); }
+ 100% { transform: scale(1); }
+}
\ No newline at end of file