diff --git a/package.json b/package.json index f62fb13cee..c7750459a7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "type": "git", "url": "https://github.com/zurichat/zc_main" }, - "bugs": { "url": "https://github.com/zurichat/zc_main/issues" }, @@ -49,3 +48,4 @@ }, "dependencies": {} } + diff --git a/packages/main/src/components/media-chat/VideoChat.jsx b/packages/main/src/components/media-chat/VideoChat.jsx deleted file mode 100644 index 0ba2dfca67..0000000000 --- a/packages/main/src/components/media-chat/VideoChat.jsx +++ /dev/null @@ -1,34 +0,0 @@ -import { AGORA_APP_ID, AGORA_TOKEN } from "@zuri/utilities"; -import AgoraUIKit from "agora-react-uikit"; -import { useState } from "react"; -import styles from "./VideoChat.module.css"; - -const VideoChat = () => { - const [videoCall, setVideoCall] = useState(false); - - const rtcProps = { - appId: AGORA_APP_ID, - channel: "plug", - token: AGORA_TOKEN - }; - - const callbacks = { - EndCall: () => setVideoCall(false) - }; - - return videoCall ? ( -
- -
- ) : ( - - ); -}; - -export default VideoChat; diff --git a/packages/main/src/components/media-chat/video/VideoRoom.jsx b/packages/main/src/components/media-chat/video/VideoRoom.jsx new file mode 100644 index 0000000000..5b90d61943 --- /dev/null +++ b/packages/main/src/components/media-chat/video/VideoRoom.jsx @@ -0,0 +1,129 @@ +import { useState, useEffect } from "react"; +import AgoraUIKit from "agora-react-uikit"; +import { AGORA_APP_ID, AGORA_TOKEN } from "@zuri/utilities"; +import styles from "./styles/videoRoom.css"; +import axios from "axios"; + +const VideoRoom = ({ workspaceId }) => { + const [videoCall, setVideoCall] = useState(false); + const [token, setToken] = useState(null); + const fetchToken = () => { + axios + .get( + `https://staging.api.zuri.chat/rtc/${workspaceId}/publisher/userAccount` + ) + .then(response => { + if (response.status === 200) { + setToken(response.data.data.token); + setVideoCall(true); + } + }) + .catch(error => console.log(error)); + }; + useEffect(() => { + fetchToken(); + }, []); + const rtcProps = { + appId: AGORA_APP_ID, + channel: workspaceId, + token: token + }; + const callbacks = { + EndCall: () => setVideoCall(false) + }; + + const styleProps = { + videoMode: { max: "cover" }, + UIKitContainer: { + position: "relative", + background: "#838383", + overflow: "hidden" + }, + minViewContainer: { + maxWidth: "auto", + maxHeight: "168px", + position: "absolute", + top: "0px", + right: "0px", + display: "flex", + justifyContent: "flex-end" + }, + minViewStyles: { + maxWidth: "128px", + maxHeight: "128px", + margin: "32px 40px 0 0", + overflow: "hidden", + borderRadius: "10px", + boxShadow: "1px 1px 15px 3px rgba(184, 88, 32, 0.2)" + }, + minViewOverlayContainer: { + background: "red" + }, + + maxViewContainer: { + position: "absolute", + width: "100%", + height: "100%" + }, + maxViewStyles: {}, + localBtnContainer: { + background: "#00b87c" + }, + localBtnStyles: { + endCall: { + minHeight: "48px", + minWidth: "48px", + background: "rgb(220,60,60)", + border: "none" + }, + muteLocalAudio: { + minHeight: "48px", + minWidth: "48px", + background: "transparent", + border: "none" + }, + muteLocalVideo: { + minHeight: "48px", + minWidth: "48px", + background: "transparent", + border: "none" + } + } + }; + return videoCall ? ( +
+ +
+ ) : ( +
+ +
+ ); +}; + +export default VideoRoom; diff --git a/packages/main/src/components/media-chat/video/styles/videoRoom.css b/packages/main/src/components/media-chat/video/styles/videoRoom.css new file mode 100644 index 0000000000..409422284e --- /dev/null +++ b/packages/main/src/components/media-chat/video/styles/videoRoom.css @@ -0,0 +1,5 @@ +.joinBtn { + padding: 12px 24px; + font-size: 21px; + background-color: #20c997; +} \ No newline at end of file diff --git a/packages/main/src/components/protected/sidebar/assets/icons/videos.svg b/packages/main/src/components/protected/sidebar/assets/icons/videos.svg new file mode 100644 index 0000000000..f2d60f460d --- /dev/null +++ b/packages/main/src/components/protected/sidebar/assets/icons/videos.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/main/src/components/protected/sidebar/components/EditWorkspaceModal.jsx b/packages/main/src/components/protected/sidebar/components/EditWorkspaceModal.jsx index 9520fac272..eb0cfb91ca 100644 --- a/packages/main/src/components/protected/sidebar/components/EditWorkspaceModal.jsx +++ b/packages/main/src/components/protected/sidebar/components/EditWorkspaceModal.jsx @@ -8,7 +8,7 @@ import { useTranslation } from "react-i18next"; const EditWorkspaceModal = ({ workSpace, editDetails, setEditDetails }) => { const { t } = useTranslation(); - + // getting current workspace id const currentWorkspace = localStorage.getItem("currentWorkspace"); const orgs = JSON.parse(sessionStorage.getItem("organisations")); diff --git a/packages/main/src/components/protected/sidebar/components/Sidebar.jsx b/packages/main/src/components/protected/sidebar/components/Sidebar.jsx index 4ed3a3f7b2..a5c6b28576 100644 --- a/packages/main/src/components/protected/sidebar/components/Sidebar.jsx +++ b/packages/main/src/components/protected/sidebar/components/Sidebar.jsx @@ -1,20 +1,19 @@ import { useState, useEffect, useRef, useCallback } from "react"; +import { navigateToUrl } from "single-spa"; import styles from "../styles/Sidebar.module.css"; import { useTranslation } from "react-i18next"; - +// import videoIcon from "../assets/icons/videos.svg"; import threadIcon from "../assets/icons/thread-icon.svg"; import dmIcon from "../assets/icons/dm-icon.svg"; -import liveicon from "../assets/icons/newlive.svg"; -import phoneicon from "../assets/icons/phone.svg"; import draftIcon from "../assets/icons/draft-icon.svg"; import { subscribeToChannel } from "@zuri/utilities"; import { ACTIONS } from "../reducers/sidebar.reducer"; import Header from "./Header"; -import Room from "./Room"; import SingleRoom from "./SingleRoom"; import Category from "./Category"; import Starred from "./Starred"; import { storeSideBarInfo } from "../../../../utils/cache-sidebar"; +import { FiVideo } from "react-icons/fi"; const categories = []; @@ -231,7 +230,7 @@ const Sidebar = props => {
- <> +
{ image={dmIcon} link={`/workspace/${currentWorkspaceShort}/plugin-chat/all-dms`} /> - - -
{singleItems} {categorizedItems} - +
+
+
+ navigateToUrl( + `/workspace/${currentWorkspaceShort}/video-chat` + ) + } + > + + Video call +
+
)} diff --git a/packages/main/src/components/protected/sidebar/styles/Drop.module.css b/packages/main/src/components/protected/sidebar/styles/Drop.module.css index 0b1efc1fb5..b4fcacb01f 100644 --- a/packages/main/src/components/protected/sidebar/styles/Drop.module.css +++ b/packages/main/src/components/protected/sidebar/styles/Drop.module.css @@ -47,6 +47,7 @@ .item__img { margin-left: 0.1rem; + width: 14px; } .item__list, diff --git a/packages/main/src/components/protected/sidebar/styles/Sidebar.module.css b/packages/main/src/components/protected/sidebar/styles/Sidebar.module.css index 1d6c0308fa..e2576a73d8 100644 --- a/packages/main/src/components/protected/sidebar/styles/Sidebar.module.css +++ b/packages/main/src/components/protected/sidebar/styles/Sidebar.module.css @@ -54,8 +54,12 @@ } .subCon2 { - height: 100%; + height: 90vh; width: unset; + display: flex; + flex-direction: column; + justify-content: space-between; + gap: 20px; } .subCon2::-webkit-scrollbar { @@ -264,3 +268,32 @@ .displayCategory { display: block; } + +.videoCall { + height: 50px; + border-top: 2px solid rgba(128, 128, 128, 0.5); + display: flex; + justify-content: flex-start; + align-items: center; + gap: 20px; + padding: 0px 20px; + cursor: pointer; +} + +.videoCall:hover { + background-color: #7ed5af; +} + +.videoCall:active { + background-color: #7ed5af; +} +.videoCall > div { + width: 100%; +} + +.videoCall > div > div { + display: flex; + justify-content: space-between; + align-items: center; + gap: 20px; +} diff --git a/packages/main/src/pages/protected/workspace/Workspace.jsx b/packages/main/src/pages/protected/workspace/Workspace.jsx index d1ef2a82d1..f7a7f8dd4e 100644 --- a/packages/main/src/pages/protected/workspace/Workspace.jsx +++ b/packages/main/src/pages/protected/workspace/Workspace.jsx @@ -6,7 +6,6 @@ import { useLocation, useRouteMatch } from "react-router-dom"; -import LiveBroadcast from "../../../components/media-chat/LiveBroadcast"; import useParamHook from "./useParamHook"; import { ExtraSidebarWrapperStyle, @@ -16,8 +15,16 @@ import { WorkspaceWrapperStyle } from "./Workspace.style"; -import VideoChat from "../../../components/media-chat/VideoChat"; -import VoiceCall from "../../../components/media-chat/VoiceCall/VoiceCall"; +// import { GeneralLoading } from "../../../components"; + +import { useMediaQuery } from "@chakra-ui/react"; +import { + BsFillCaretDownFill, + BsFillQuestionCircleFill, + BsGearFill, + BsPlusCircle +} from "react-icons/bs"; +import VideoRoom from "../../../components/media-chat/video/VideoRoom"; import { Sidebar, TopBar } from "../../../components/protected"; import ExtraSidebar from "../../../components/protected/extra-sidebar"; import WorkspaceLoading from "../../../components/general-loading/WorkspaceLoading"; @@ -84,38 +91,29 @@ export default function Index() { -
- -
-
- - -

Welcome to your Workspace

-
- - - +
+ + +

Welcome to your Workspace

+
+ + + - - - - - - + {/*

MarketPlace

} + /> */} - {/*

MarketPlace

} - /> */} - - {/* All other routes not by main go to Single SPA */} - {/* -
-

SHOULD SHOW PLUGINS

-
-
*/} -
+ {/* All other routes not by main go to Single SPA */} + {/* +
+

SHOULD SHOW PLUGINS

+
+
*/} + +