From cb5b3e946811af701688039586e14b436d9030f7 Mon Sep 17 00:00:00 2001 From: Timo K Date: Fri, 29 Jul 2022 15:07:35 +0200 Subject: [PATCH] review changes --- src/form/Form.tsx | 35 +++++++++++++++--------------- src/home/CallList.tsx | 4 ++-- src/home/JoinExistingCallModal.tsx | 1 + src/home/RegisteredView.tsx | 1 + 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/form/Form.tsx b/src/form/Form.tsx index 944724b..55dadae 100644 --- a/src/form/Form.tsx +++ b/src/form/Form.tsx @@ -19,21 +19,22 @@ import React, { FormEventHandler, forwardRef } from "react"; import styles from "./Form.module.css"; -export const Form = forwardRef< - HTMLFormElement, - { - className: string; - onSubmit: FormEventHandler; - children: JSX.Element[]; +interface FormProps { + className: string; + onSubmit: FormEventHandler; + children: JSX.Element[]; +} + +export const Form = forwardRef( + ({ children, className, onSubmit }, ref) => { + return ( +
+ {children} +
+ ); } ->(({ children, className, onSubmit }, ref) => { - return ( -
- {children} -
- ); -}); +); diff --git a/src/home/CallList.tsx b/src/home/CallList.tsx index b7611aa..8b25723 100644 --- a/src/home/CallList.tsx +++ b/src/home/CallList.tsx @@ -29,7 +29,7 @@ import { GroupCallRoom } from "./useGroupCallRooms"; interface CallListProps { rooms: GroupCallRoom[]; client: MatrixClient; - disableFacepile: boolean; + disableFacepile?: boolean; } export function CallList({ rooms, client, disableFacepile }: CallListProps) { return ( @@ -62,7 +62,7 @@ interface CallTileProps { roomId: string; participants: RoomMember[]; client: MatrixClient; - disableFacepile: boolean; + disableFacepile?: boolean; } function CallTile({ name, diff --git a/src/home/JoinExistingCallModal.tsx b/src/home/JoinExistingCallModal.tsx index 0c17ede..b26c45d 100644 --- a/src/home/JoinExistingCallModal.tsx +++ b/src/home/JoinExistingCallModal.tsx @@ -21,6 +21,7 @@ import { Modal, ModalContent } from "../Modal"; import { Button } from "../button"; import { FieldRow } from "../input/Input"; import styles from "./JoinExistingCallModal.module.css"; + interface Props { onJoin: (e: PressEvent) => void; onClose: (e: PressEvent) => void; diff --git a/src/home/RegisteredView.tsx b/src/home/RegisteredView.tsx index 7a87bdc..4d190dd 100644 --- a/src/home/RegisteredView.tsx +++ b/src/home/RegisteredView.tsx @@ -37,6 +37,7 @@ import { JoinExistingCallModal } from "./JoinExistingCallModal"; import { Title } from "../typography/Typography"; import { Form } from "../form/Form"; import { CallType, CallTypeDropdown } from "./CallTypeDropdown"; + interface Props { client: MatrixClient; isPasswordlessUser: boolean;