From b6c926d2c845143873cce209166a3c9c66eb3ed6 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Wed, 27 Apr 2022 16:47:23 -0700 Subject: [PATCH] Additional in-room PTT styling --- src/Facepile.jsx | 40 ++++++++++++++----- src/Facepile.module.css | 8 ++++ src/button/Button.jsx | 24 ++++++++++++ src/room/PTTCallView.jsx | 68 ++++++++++++++++++--------------- src/room/PTTCallView.module.css | 49 +++++++++++++++++++----- 5 files changed, 139 insertions(+), 50 deletions(-) diff --git a/src/Facepile.jsx b/src/Facepile.jsx index 53b0b948..a7a998a8 100644 --- a/src/Facepile.jsx +++ b/src/Facepile.jsx @@ -4,35 +4,55 @@ import classNames from "classnames"; import { Avatar } from "./Avatar"; import { getAvatarUrl } from "./matrix-utils"; -export function Facepile({ className, client, participants, ...rest }) { +export function Facepile({ + className, + client, + participants, + max, + size, + ...rest +}) { + const _size = size === "md" ? 36 : 24; + const _overlap = size === "md" ? 8 : 2; + return (
member.name).join(", ")} + style={{ width: participants.length * _size + _overlap }} {...rest} > - {participants.slice(0, 3).map((member, i) => { + {participants.slice(0, max).map((member, i) => { const avatarUrl = member.user?.avatarUrl; return ( ); })} - {participants.length > 3 && ( + {participants.length > max && ( )}
); } + +Facepile.defaultProps = { + max: 3, + size: "xs", +}; diff --git a/src/Facepile.module.css b/src/Facepile.module.css index 4add90ec..1fe52633 100644 --- a/src/Facepile.module.css +++ b/src/Facepile.module.css @@ -4,8 +4,16 @@ position: relative; } +.facepile.md { + height: 36px; +} + .facepile .avatar { position: absolute; top: 0; border: 1px solid var(--bgColor2); } + +.facepile.md .avatar { + border: 2px solid var(--bgColor2); +} diff --git a/src/button/Button.jsx b/src/button/Button.jsx index ab6ed776..1e31fde7 100644 --- a/src/button/Button.jsx +++ b/src/button/Button.jsx @@ -7,6 +7,8 @@ import { ReactComponent as VideoIcon } from "../icons/Video.svg"; import { ReactComponent as DisableVideoIcon } from "../icons/DisableVideo.svg"; import { ReactComponent as HangupIcon } from "../icons/Hangup.svg"; import { ReactComponent as ScreenshareIcon } from "../icons/Screenshare.svg"; +import { ReactComponent as SettingsIcon } from "../icons/Settings.svg"; +import { ReactComponent as AddUserIcon } from "../icons/AddUser.svg"; import { useButton } from "@react-aria/button"; import { mergeProps, useObjectRef } from "@react-aria/utils"; import { TooltipTrigger } from "../Tooltip"; @@ -127,3 +129,25 @@ export function HangupButton({ className, ...rest }) { ); } + +export function SettingsButton({ className, ...rest }) { + return ( + + + {() => "Settings"} + + ); +} + +export function InviteButton({ className, ...rest }) { + return ( + + + {() => "Invite"} + + ); +} diff --git a/src/room/PTTCallView.jsx b/src/room/PTTCallView.jsx index 29d90da9..e8b818f6 100644 --- a/src/room/PTTCallView.jsx +++ b/src/room/PTTCallView.jsx @@ -2,7 +2,7 @@ import React from "react"; import { useModalTriggerState } from "../Modal"; import { SettingsModal } from "../settings/SettingsModal"; import { InviteModal } from "./InviteModal"; -import { Button } from "../button"; +import { Button, HangupButton, InviteButton, SettingsButton } from "../button"; import { Header, LeftNav, RightNav, RoomSetupHeaderInfo } from "../Header"; import { ReactComponent as AddUserIcon } from "../icons/AddUser.svg"; import { ReactComponent as SettingsIcon } from "../icons/Settings.svg"; @@ -38,39 +38,45 @@ export function PTTCallView({ - - - - - + -
-
-

{`${participants.length} user${ - participants.length > 1 ? "s" : "" - } connected`}

- -
- -

Press and hold spacebar to talk

- {userMediaFeeds.map((callFeed) => ( - +

{`${participants.length} ${ + participants.length > 1 ? "people" : "person" + } connected`}

+ - ))} +
+
+

Talking...

+

00:01:24

+
+
+ +

Press and hold spacebar to talk

+ {userMediaFeeds.map((callFeed) => ( + + ))} +
+
+ settingsModalState.open()} /> + + inviteModalState.open()} /> +
{settingsModalState.isOpen && ( diff --git a/src/room/PTTCallView.module.css b/src/room/PTTCallView.module.css index f513b798..8e37b449 100644 --- a/src/room/PTTCallView.module.css +++ b/src/room/PTTCallView.module.css @@ -2,6 +2,7 @@ position: relative; display: flex; flex-direction: column; + justify-content: center; overflow: hidden; min-height: 100%; position: fixed; @@ -9,32 +10,62 @@ width: 100%; } -.headerSeparator { - width: calc(100% - 40px); - height: 1px; - margin: 0 20px; - background-color: #21262C; -} - .center { width: 100%; display: flex; flex: 1; flex-direction: column; - justify-content: center; align-items: center; + margin-top: 48px; } .actionTip { margin-top: 42px; + margin-bottom: 45px; font-size: 17px; } .participants { - margin: 24px 20px 0 20px; + display: flex; + flex-direction: column; + margin: 20px; + margin-bottom: 67px; } .participants > p { color: #A9B2BC; margin-bottom: 8px; +} + +.facepile { + align-self: center; +} + +.talkingInfo { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 38px; +} + +.pttButtonContainer { + display: flex; + flex-direction: column; + align-items: center; +} + +.footer { + position: relative; + display: flex; + justify-content: center; + align-items: center; + height: 64px; +} + +.footer > * { + margin-right: 30px; +} + +.footer > :last-child { + margin-right: 0px; } \ No newline at end of file