diff --git a/Form/withForm.tsx b/Form/withForm.tsx index e9daf1b..5a23c2e 100644 --- a/Form/withForm.tsx +++ b/Form/withForm.tsx @@ -11,7 +11,7 @@ type FormProps = { }; export type WithFormProps = P & FormProps; type CleanedFormProps

= Omit; -export function withForm>(WrappedForm: React.ComponentType>, method: (client: ApiClient, project: OwnerResponse, props: P) => (body: T) => CancelablePromise, submitText: string, trMethod?: (initialData: T, props: CleanedFormProps

) => T) { +export function withForm>(WrappedForm: React.ComponentType>, method: (client: ApiClient, project: OwnerResponse, props: P) => (body: T) => CancelablePromise | any, submitText: string, trMethod?: (initialData: T, props: CleanedFormProps

) => T) { return function GameFormWrapper({ refresh, afterSubmit, initialData, ...props }: P) { const client = useApiClient(); const company = useOwner(); diff --git a/useModal.tsx b/useModal.tsx index 31d193c..5815e1c 100644 --- a/useModal.tsx +++ b/useModal.tsx @@ -3,14 +3,14 @@ import { useCallback } from "react"; export default function useModal( Component: React.ComponentType, - title: string + defaulTitle: string ) { - const openModal = useCallback((params: T) => { + const openModal = useCallback((params: T, title?: string) => { modals.open({ - title, + title: title ?? defaulTitle, children: modals.closeAll()} {...params} />, }); - }, [Component, title]); + }, [Component, defaulTitle ]); return openModal; } \ No newline at end of file