Accompanying changes

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2022-07-30 10:06:28 +02:00
parent 02aaa06cb3
commit 2537088099
No known key found for this signature in database
GPG Key ID: D1D45825D60C24D2
8 changed files with 28 additions and 30 deletions

View File

@ -48,10 +48,10 @@ const resolveAvatarSrc = (client: MatrixClient, src: string, size: number) =>
interface Props extends React.HTMLAttributes<HTMLDivElement> {
bgKey?: string;
src: string;
src?: string;
fallback: string;
size?: Size | number;
className: string;
className?: string;
style?: CSSProperties;
}

View File

@ -139,11 +139,12 @@ export function MicButton({
[index: string]: unknown;
}) {
return (
<TooltipTrigger>
<TooltipTrigger
tooltip={() => (muted ? "Unmute microphone" : "Mute microphone")}
>
<Button variant="toolbar" {...rest} off={muted}>
{muted ? <MuteMicIcon /> : <MicIcon />}
</Button>
{() => (muted ? "Unmute microphone" : "Mute microphone")}
</TooltipTrigger>
);
}
@ -156,11 +157,12 @@ export function VideoButton({
[index: string]: unknown;
}) {
return (
<TooltipTrigger>
<TooltipTrigger
tooltip={() => (muted ? "Turn on camera" : "Turn off camera")}
>
<Button variant="toolbar" {...rest} off={muted}>
{muted ? <DisableVideoIcon /> : <VideoIcon />}
</Button>
{() => (muted ? "Turn on camera" : "Turn off camera")}
</TooltipTrigger>
);
}
@ -175,11 +177,12 @@ export function ScreenshareButton({
[index: string]: unknown;
}) {
return (
<TooltipTrigger>
<TooltipTrigger
tooltip={() => (enabled ? "Stop sharing screen" : "Share screen")}
>
<Button variant="toolbarSecondary" {...rest} on={enabled}>
<ScreenshareIcon />
</Button>
{() => (enabled ? "Stop sharing screen" : "Share screen")}
</TooltipTrigger>
);
}
@ -192,7 +195,7 @@ export function HangupButton({
[index: string]: unknown;
}) {
return (
<TooltipTrigger>
<TooltipTrigger tooltip={() => "Leave"}>
<Button
variant="toolbar"
className={classNames(styles.hangupButton, className)}
@ -200,7 +203,6 @@ export function HangupButton({
>
<HangupIcon />
</Button>
{() => "Leave"}
</TooltipTrigger>
);
}
@ -213,11 +215,10 @@ export function SettingsButton({
[index: string]: unknown;
}) {
return (
<TooltipTrigger>
<TooltipTrigger tooltip={() => "Settings"}>
<Button variant="toolbar" {...rest}>
<SettingsIcon />
</Button>
{() => "Settings"}
</TooltipTrigger>
);
}
@ -230,22 +231,20 @@ export function InviteButton({
[index: string]: unknown;
}) {
return (
<TooltipTrigger>
<TooltipTrigger tooltip={() => "Invite"}>
<Button variant="toolbar" {...rest}>
<AddUserIcon />
</Button>
{() => "Invite"}
</TooltipTrigger>
);
}
export function OptionsButton(props: Omit<Props, "variant">) {
return (
<TooltipTrigger>
<TooltipTrigger tooltip={() => "Options"}>
<Button variant="icon" {...props}>
<OverflowIcon />
</Button>
{() => "Options"}
</TooltipTrigger>
);
}

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React from "react";
import React, { ReactNode } from "react";
import { Link } from "react-router-dom";
import classNames from "classnames";
@ -25,10 +25,10 @@ import {
ButtonSize,
} from "./Button";
interface Props {
className: string;
variant: ButtonVariant;
size: ButtonSize;
children: JSX.Element;
className?: string;
variant?: ButtonVariant;
size?: ButtonSize;
children: ReactNode;
[index: string]: unknown;
}

View File

@ -26,7 +26,7 @@ import styles from "./ProfileModal.module.css";
interface Props {
client: MatrixClient;
onClose: () => {};
onClose: () => void;
[rest: string]: unknown;
}
export function ProfileModal({ client, ...rest }: Props) {

View File

@ -28,11 +28,10 @@ import { Tooltip, TooltipTrigger } from "../Tooltip";
export function GridLayoutMenu({ layout, setLayout }) {
return (
<PopoverMenuTrigger placement="bottom right">
<TooltipTrigger>
<TooltipTrigger tooltip={() => "Layout Type"}>
<Button variant="icon">
{layout === "spotlight" ? <SpotlightIcon /> : <FreedomIcon />}
</Button>
{() => "Layout Type"}
</TooltipTrigger>
{(props) => (
<Menu {...props} label="Grid layout menu" onAction={setLayout}>

View File

@ -61,11 +61,10 @@ export function OverflowMenu({
return (
<>
<PopoverMenuTrigger disableOnState>
<TooltipTrigger placement="top">
<TooltipTrigger tooltip={() => "More"} placement="top">
<Button variant="toolbar">
<OverflowIcon />
</Button>
{() => "More"}
</TooltipTrigger>
{(props) => (
<Menu {...props} label="More menu" onAction={onAction}>

View File

@ -38,6 +38,7 @@ import { usePTTSounds } from "../sound/usePttSounds";
import { PTTClips } from "../sound/PTTClips";
import { GroupCallInspector } from "./GroupCallInspector";
import { OverflowMenu } from "./OverflowMenu";
import { Size } from "../Avatar";
function getPromptText(
networkWaiting: boolean,
@ -112,7 +113,7 @@ export const PTTCallView: React.FC<Props> = ({
const { modalState: feedbackModalState, modalProps: feedbackModalProps } =
useModalTriggerState();
const [containerRef, bounds] = useMeasure({ polyfill: ResizeObserver });
const facepileSize = bounds.width < 800 ? "sm" : "md";
const facepileSize = bounds.width < 800 ? Size.SM : Size.MD;
const showControls = bounds.height > 500;
const pttButtonSize = 232;

View File

@ -27,10 +27,10 @@ import { useModalTriggerState } from "../Modal";
interface RageShakeSubmitOptions {
description: string;
roomId: string;
label: string;
roomId?: string;
label?: string;
sendLogs: boolean;
rageshakeRequestId: string;
rageshakeRequestId?: string;
}
export function useSubmitRageshake(): {