From 3bda9de4d50a4a65d436fb75a794b3cb4246e94b Mon Sep 17 00:00:00 2001 From: harshithpabbati Date: Tue, 11 Jan 2022 17:17:43 +0530 Subject: [PATCH] Add invite others view when there's only 1 participant in the call --- .../components/Call/InviteOthers.js | 67 +++++++++++++++++++ .../fitness-demo/components/Call/VideoView.js | 5 +- custom/shared/components/Card/Card.js | 20 ++++-- custom/shared/components/Input/Input.js | 8 ++- 4 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 custom/fitness-demo/components/Call/InviteOthers.js diff --git a/custom/fitness-demo/components/Call/InviteOthers.js b/custom/fitness-demo/components/Call/InviteOthers.js new file mode 100644 index 0000000..0d8590c --- /dev/null +++ b/custom/fitness-demo/components/Call/InviteOthers.js @@ -0,0 +1,67 @@ +import React from 'react'; +import Button from '@custom/shared/components/Button'; +import { Card, CardBody, CardHeader } from '@custom/shared/components/Card'; +import { TextInput } from '@custom/shared/components/Input'; +import Tile from '@custom/shared/components/Tile'; +import { DEFAULT_ASPECT_RATIO } from '@custom/shared/constants'; +import { useParticipants } from '@custom/shared/contexts/ParticipantsProvider'; + +export const InviteOthers = () => { + const { localParticipant } = useParticipants(); + + return ( +
+
+ + + Waiting for others to join! + + +
+ + +
+
+
+
+
+ +
+ +
+ ) +} + +export default InviteOthers; \ No newline at end of file diff --git a/custom/fitness-demo/components/Call/VideoView.js b/custom/fitness-demo/components/Call/VideoView.js index 167e6c5..1f8efa5 100644 --- a/custom/fitness-demo/components/Call/VideoView.js +++ b/custom/fitness-demo/components/Call/VideoView.js @@ -1,8 +1,9 @@ import React, { useEffect } from 'react'; import { useParticipants } from '@custom/shared/contexts/ParticipantsProvider'; import { useUIState, VIEW_MODE_SPEAKER } from '@custom/shared/contexts/UIStateProvider'; -import { GridView } from '../GridView/GridView'; +import { GridView } from '../GridView'; import { SpeakerView } from '../SpeakerView'; +import InviteOthers from './InviteOthers'; export const VideoView = () => { const { viewMode, setIsShowingScreenshare } = useUIState(); @@ -14,6 +15,8 @@ export const VideoView = () => { }, [screens, setIsShowingScreenshare]); if (!participants.length) return null; + if (participants.length === 1) return ; + return viewMode === VIEW_MODE_SPEAKER ? : ; }; diff --git a/custom/shared/components/Card/Card.js b/custom/shared/components/Card/Card.js index 40e6954..5b1f871 100644 --- a/custom/shared/components/Card/Card.js +++ b/custom/shared/components/Card/Card.js @@ -2,14 +2,21 @@ import React from 'react'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -export const Card = ({ children, className }) => ( -
+export const Card = ({ children, className, variant }) => ( +
{children}
); @@ -26,7 +33,6 @@ export const CardHeader = ({ children }) => ( h2 { font-size: 1.375rem; margin: 0px; - color: var(--text-default); } & + :global(.card-body) { diff --git a/custom/shared/components/Input/Input.js b/custom/shared/components/Input/Input.js index 947334a..bd72bd6 100644 --- a/custom/shared/components/Input/Input.js +++ b/custom/shared/components/Input/Input.js @@ -113,7 +113,7 @@ const InputContainer = ({ children, prefix, className }) => ( opacity: 1; } .dark :global(input)::-moz-placeholder { - ccolor: var(--text-mid); + color: var(--text-mid); opacity: 1; } .dark :global(input)::-ms-input-placeholder { @@ -126,6 +126,12 @@ const InputContainer = ({ children, prefix, className }) => ( border: 0px; box-shadow: none; } + + .border :global(input) { + background: transparent; + border: 1px solid var(--reverse); + color: var(--reverse); + } `}
);