Fix mute/unmute styling
This commit is contained in:
parent
f57b520622
commit
4e2d1c5dcd
7 changed files with 21 additions and 39 deletions
|
@ -52,6 +52,7 @@ export function PopoverMenu({ children, placement, ...rest }) {
|
||||||
<popoverTrigger.type
|
<popoverTrigger.type
|
||||||
{...popoverTrigger.props}
|
{...popoverTrigger.props}
|
||||||
{...menuTriggerProps}
|
{...menuTriggerProps}
|
||||||
|
on={popoverMenuState.isOpen}
|
||||||
ref={buttonRef}
|
ref={buttonRef}
|
||||||
/>
|
/>
|
||||||
{popoverMenuState.isOpen &&
|
{popoverMenuState.isOpen &&
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
color: var(--textColor1);
|
color: var(--textColor1);
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popoverMenuItem > * {
|
.popoverMenuItem > * {
|
||||||
|
|
|
@ -334,7 +334,7 @@ function RoomSetupView({
|
||||||
}))}
|
}))}
|
||||||
>
|
>
|
||||||
<VideoButton
|
<VideoButton
|
||||||
enabled={localVideoMuted}
|
muted={localVideoMuted}
|
||||||
onClick={toggleLocalVideoMuted}
|
onClick={toggleLocalVideoMuted}
|
||||||
/>
|
/>
|
||||||
</DropdownButton>
|
</DropdownButton>
|
||||||
|
@ -532,10 +532,7 @@ function InRoomView({
|
||||||
)}
|
)}
|
||||||
<div className={styles.footer}>
|
<div className={styles.footer}>
|
||||||
<MicButton muted={microphoneMuted} onPress={toggleMicrophoneMuted} />
|
<MicButton muted={microphoneMuted} onPress={toggleMicrophoneMuted} />
|
||||||
<VideoButton
|
<VideoButton muted={localVideoMuted} onPress={toggleLocalVideoMuted} />
|
||||||
enabled={localVideoMuted}
|
|
||||||
onPress={toggleLocalVideoMuted}
|
|
||||||
/>
|
|
||||||
{canScreenshare && !isSafari && (
|
{canScreenshare && !isSafari && (
|
||||||
<ScreenshareButton
|
<ScreenshareButton
|
||||||
enabled={isScreensharing}
|
enabled={isScreensharing}
|
||||||
|
|
|
@ -16,12 +16,13 @@ import { ReactComponent as CheckIcon } from "./icons/Check.svg";
|
||||||
import { useButton } from "@react-aria/button";
|
import { useButton } from "@react-aria/button";
|
||||||
|
|
||||||
export const RoomButton = forwardRef(
|
export const RoomButton = forwardRef(
|
||||||
({ on, className, children, ...rest }, ref) => {
|
({ on, off, className, children, ...rest }, ref) => {
|
||||||
const { buttonProps } = useButton(rest, ref);
|
const { buttonProps } = useButton(rest, ref);
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className={classNames(styles.roomButton, className, {
|
className={classNames(styles.roomButton, className, {
|
||||||
[styles.on]: on,
|
[styles.on]: on,
|
||||||
|
[styles.off]: off,
|
||||||
})}
|
})}
|
||||||
{...buttonProps}
|
{...buttonProps}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
@ -83,7 +84,7 @@ export function DropdownButton({ onChange, options, value, children }) {
|
||||||
|
|
||||||
export function MicButton({ muted, ...rest }) {
|
export function MicButton({ muted, ...rest }) {
|
||||||
return (
|
return (
|
||||||
<RoomButton {...rest} on={muted}>
|
<RoomButton {...rest} off={muted}>
|
||||||
<ButtonTooltip>
|
<ButtonTooltip>
|
||||||
{muted ? "Unmute microphone" : "Mute microphone"}
|
{muted ? "Unmute microphone" : "Mute microphone"}
|
||||||
</ButtonTooltip>
|
</ButtonTooltip>
|
||||||
|
@ -92,24 +93,20 @@ export function MicButton({ muted, ...rest }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function VideoButton({ enabled, ...rest }) {
|
export function VideoButton({ muted, ...rest }) {
|
||||||
return (
|
return (
|
||||||
<RoomButton {...rest} on={enabled}>
|
<RoomButton {...rest} off={muted}>
|
||||||
<ButtonTooltip>
|
<ButtonTooltip>
|
||||||
{enabled ? "Turn off camera" : "Turn on camera"}
|
{muted ? "Turn on camera" : "Turn off camera"}
|
||||||
</ButtonTooltip>
|
</ButtonTooltip>
|
||||||
{enabled ? <DisableVideoIcon /> : <VideoIcon />}
|
{muted ? <DisableVideoIcon /> : <VideoIcon />}
|
||||||
</RoomButton>
|
</RoomButton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ScreenshareButton({ enabled, className, ...rest }) {
|
export function ScreenshareButton({ enabled, className, ...rest }) {
|
||||||
return (
|
return (
|
||||||
<RoomButton
|
<RoomButton {...rest} on={enabled}>
|
||||||
className={classNames(styles.screenshareButton, className)}
|
|
||||||
{...rest}
|
|
||||||
on={enabled}
|
|
||||||
>
|
|
||||||
<ButtonTooltip>
|
<ButtonTooltip>
|
||||||
{enabled ? "Stop sharing screen" : "Share screen"}
|
{enabled ? "Stop sharing screen" : "Share screen"}
|
||||||
</ButtonTooltip>
|
</ButtonTooltip>
|
||||||
|
|
|
@ -41,7 +41,8 @@ limitations under the License.
|
||||||
.roomButton:active {
|
.roomButton:active {
|
||||||
}
|
}
|
||||||
|
|
||||||
.roomButton.on {
|
.roomButton.on,
|
||||||
|
.roomButton.off {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,10 +67,14 @@ limitations under the License.
|
||||||
background-color: #ff5b55;
|
background-color: #ff5b55;
|
||||||
}
|
}
|
||||||
|
|
||||||
.screenshareButton.on svg * {
|
.roomButton.on svg * {
|
||||||
fill: #0dbd8b;
|
fill: #0dbd8b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.roomButton.off svg * {
|
||||||
|
fill: #21262c;
|
||||||
|
}
|
||||||
|
|
||||||
.dropdownButtonContainer {
|
.dropdownButtonContainer {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,12 +47,9 @@ export function UserMenu({ userName, signedIn, onLogin, onLogout }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverMenu onAction={onAction} placement="bottom right">
|
<PopoverMenu onAction={onAction} placement="bottom right">
|
||||||
<HeaderButton>
|
<HeaderButton className={styles.userButton}>
|
||||||
<ButtonTooltip>Profile</ButtonTooltip>
|
<ButtonTooltip>Profile</ButtonTooltip>
|
||||||
<div className={styles.userButton}>
|
<UserIcon />
|
||||||
<UserIcon />
|
|
||||||
<span>{userName}</span>
|
|
||||||
</div>
|
|
||||||
</HeaderButton>
|
</HeaderButton>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Popover {...props} label="User menu">
|
<Popover {...props} label="User menu">
|
||||||
|
|
|
@ -1,19 +1,3 @@
|
||||||
.userButton {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
color: var(--textColor1);
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.userButton svg * {
|
.userButton svg * {
|
||||||
fill: var(--textColor1);
|
fill: var(--textColor1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.userButton > * {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.userButton > :last-child {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue