From 3c7ae5e0a81387daf7be8cd848ed894912076b1e Mon Sep 17 00:00:00 2001 From: David Totraev Date: Sat, 23 Nov 2024 22:36:35 +0500 Subject: [PATCH] fix: dialog title --- .changeset/clever-trains-relax.md | 5 +++ src/components/Dialog/Dialog.stories.tsx | 3 +- .../Dialog/components/DialogHeader.tsx | 33 +++++++++++-------- 3 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 .changeset/clever-trains-relax.md diff --git a/.changeset/clever-trains-relax.md b/.changeset/clever-trains-relax.md new file mode 100644 index 0000000..4bdea9b --- /dev/null +++ b/.changeset/clever-trains-relax.md @@ -0,0 +1,5 @@ +--- +"@babylonlabs-io/bbn-core-ui": patch +--- + +fix dialog subtitle diff --git a/src/components/Dialog/Dialog.stories.tsx b/src/components/Dialog/Dialog.stories.tsx index 1492120..1bc7e57 100644 --- a/src/components/Dialog/Dialog.stories.tsx +++ b/src/components/Dialog/Dialog.stories.tsx @@ -41,12 +41,13 @@ export const Default: Story = { }} > { setVisibility(false); }} > - Bitcoin Inscriptions + Subtitle diff --git a/src/components/Dialog/components/DialogHeader.tsx b/src/components/Dialog/components/DialogHeader.tsx index 1d7d949..e597bc6 100644 --- a/src/components/Dialog/components/DialogHeader.tsx +++ b/src/components/Dialog/components/DialogHeader.tsx @@ -5,22 +5,27 @@ import { Heading } from "@/components/Heading"; import { IconButton } from "@/components/Button"; export interface DialogHeaderProps extends DetailedHTMLProps, HTMLDivElement> { + title: string; onClose?: () => void; } -export const DialogHeader = ({ className, children, onClose }: DialogHeaderProps) => ( -
- {children} +export const DialogHeader = ({ className, children, title, onClose }: DialogHeaderProps) => ( + <> +
+ {title} - {Boolean(onClose) && ( - - - - - - )} -
+ {Boolean(onClose) && ( + + + + + + )} +
+ + {children} + );