Merge pull request #727 from vector-im/dbkr/fix_join_call_close_button

Fix close button on join call modal
This commit is contained in:
David Baker 2022-11-07 14:07:38 +00:00 committed by GitHub
commit 85959046a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 5 deletions

View file

@ -24,11 +24,13 @@ import { Body } from "./typography/Typography";
interface Props { interface Props {
userIds: Set<string>; userIds: Set<string>;
room: Room; room: Room;
onClose: () => void;
} }
export const IncompatibleVersionModal: React.FC<Props> = ({ export const IncompatibleVersionModal: React.FC<Props> = ({
userIds, userIds,
room, room,
onClose,
...rest ...rest
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();
@ -38,7 +40,12 @@ export const IncompatibleVersionModal: React.FC<Props> = ({
); );
return ( return (
<Modal title={t("Incompatible versions")} isDismissable {...rest}> <Modal
title={t("Incompatible versions")}
isDismissable
onClose={onClose}
{...rest}
>
<ModalContent> <ModalContent>
<Body> <Body>
<Trans> <Trans>

View file

@ -43,7 +43,7 @@ export interface ModalProps extends OverlayProps, AriaDialogProps {
children: ReactNode; children: ReactNode;
className?: string; className?: string;
mobileFullScreen?: boolean; mobileFullScreen?: boolean;
onClose?: () => void; onClose: () => void;
} }
export function Modal({ export function Modal({

View file

@ -25,7 +25,7 @@ import styles from "./JoinExistingCallModal.module.css";
interface Props { interface Props {
onJoin: (e: PressEvent) => void; onJoin: (e: PressEvent) => void;
onClose: (e: PressEvent) => void; onClose: () => void;
// TODO: add used parameters for <Modal> // TODO: add used parameters for <Modal>
[index: string]: unknown; [index: string]: unknown;
} }
@ -33,7 +33,12 @@ export function JoinExistingCallModal({ onJoin, onClose, ...rest }: Props) {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<Modal title={t("Join existing call?")} isDismissable {...rest}> <Modal
title={t("Join existing call?")}
isDismissable
{...rest}
onClose={onClose}
>
<ModalContent> <ModalContent>
<p>{t("This call already exists, would you like to join?")}</p> <p>{t("This call already exists, would you like to join?")}</p>
<FieldRow rightAlign className={styles.buttons}> <FieldRow rightAlign className={styles.buttons}>

View file

@ -59,9 +59,10 @@ const LocalVolume: React.FC<LocalVolumeProps> = ({
// TODO: Extend ModalProps // TODO: Extend ModalProps
interface Props { interface Props {
feed: CallFeed; feed: CallFeed;
onClose: () => void;
} }
export const VideoTileSettingsModal = ({ feed, ...rest }: Props) => { export const VideoTileSettingsModal = ({ feed, onClose, ...rest }: Props) => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
@ -70,6 +71,7 @@ export const VideoTileSettingsModal = ({ feed, ...rest }: Props) => {
title={t("Local volume")} title={t("Local volume")}
isDismissable isDismissable
mobileFullScreen mobileFullScreen
onClose={onClose}
{...rest} {...rest}
> >
<div className={styles.content}> <div className={styles.content}>