From 746dff9e6d23b9986f01f0713f742a693ad4a3fa Mon Sep 17 00:00:00 2001 From: David Crespo Date: Tue, 13 Jun 2023 17:26:26 -0500 Subject: [PATCH] only use modal title prop --- app/components/EquivalentCliCommand.tsx | 4 +--- app/components/form/FullPageForm.tsx | 8 +++++--- app/pages/project/images/ImagesPage.tsx | 3 +-- libs/ui/lib/modal/Modal.stories.tsx | 8 ++------ libs/ui/lib/modal/Modal.tsx | 6 ++++-- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/components/EquivalentCliCommand.tsx b/app/components/EquivalentCliCommand.tsx index 96b45a0585..451a242fec 100644 --- a/app/components/EquivalentCliCommand.tsx +++ b/app/components/EquivalentCliCommand.tsx @@ -23,9 +23,7 @@ export default function EquivalentCliCommand({ command }: { command: string }) { - - CLI Command - + {/* todo: fix the token to disable contextual alternates in the mono font */}
diff --git a/app/components/form/FullPageForm.tsx b/app/components/form/FullPageForm.tsx
index 4df3205ba3..0fdb96b304 100644
--- a/app/components/form/FullPageForm.tsx
+++ b/app/components/form/FullPageForm.tsx
@@ -112,9 +112,11 @@ export function FullPageForm({
 }
 
 const ConfirmNavigation = ({ blocker }: { blocker: Blocker }) => (
-   blocker.reset?.()}>
-    Confirm Navigation
-
+   blocker.reset?.()}
+    title="Confirm navigation"
+  >
     
       Are you sure you want to leave this page? 
You will lose all progress on this form. diff --git a/app/pages/project/images/ImagesPage.tsx b/app/pages/project/images/ImagesPage.tsx index a1ebe0cc62..f6094b8be3 100644 --- a/app/pages/project/images/ImagesPage.tsx +++ b/app/pages/project/images/ImagesPage.tsx @@ -109,8 +109,7 @@ const PromoteImageModal = ({ onDismiss, imageName }: PromoteModalProps) => { } return ( - - Promote image +

diff --git a/libs/ui/lib/modal/Modal.stories.tsx b/libs/ui/lib/modal/Modal.stories.tsx index 3d5aec246a..0f21cb6b4c 100644 --- a/libs/ui/lib/modal/Modal.stories.tsx +++ b/libs/ui/lib/modal/Modal.stories.tsx @@ -19,9 +19,7 @@ export function Default() { return ( <> - - Title - +

@@ -72,9 +70,7 @@ export function Sticky() { return ( <> - - Title - +

diff --git a/libs/ui/lib/modal/Modal.tsx b/libs/ui/lib/modal/Modal.tsx index 1db4f81024..6e51faa970 100644 --- a/libs/ui/lib/modal/Modal.tsx +++ b/libs/ui/lib/modal/Modal.tsx @@ -64,7 +64,7 @@ export function Modal({ children, onDismiss, title, isOpen }: ModalProps) { > {title && ( - {title} + {title} )} {children} @@ -77,7 +77,9 @@ export function Modal({ children, onDismiss, title, isOpen }: ModalProps) { ) } -Modal.Title = ({ children, id }: { children?: React.ReactNode; id?: string }) => ( +// not exported because we want to use the `title` prop on Modal so the aria +// label gets hooked up properly +const ModalTitle = ({ children, id }: { children?: React.ReactNode; id?: string }) => (

{children}