Skip to content

Commit 9d90d89

Browse files
authored
fix(tui): add footer gap to simple dialogs (#56092)
1 parent acdcdb8 commit 9d90d89

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/tui/src/ui/dialog-export-result.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export function DialogExportResult(props: { path: string; onClose?: () => void }
4646

4747
return (
4848
<DialogLayout
49+
footerGap={2}
4950
header={<DialogHeader title="Session exported" onClose={close} />}
5051
footer={{
5152
actions: {

‎packages/tui/src/ui/dialog-prompt.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export function DialogPrompt(props: DialogPromptProps) {
130130

131131
return (
132132
<DialogLayout
133+
footerGap={2}
133134
header={
134135
<DialogHeader
135136
title={props.title}

‎packages/tui/src/ui/dialog.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,16 @@ export function DialogLayout(
147147
legacyFooter?: JSX.Element
148148
/** Side padding in cells. Defaults to DIALOG_INSET. */
149149
inset?: number
150+
/** Blank rows between the body and the footer under the "new-designs" experiment. Defaults to 1. */
151+
footerGap?: number
150152
}>,
151153
) {
152154
const inset = () => props.inset ?? DIALOG_INSET
153155
const newDesigns = useNewDesigns()
154156
return (
155157
<box id={props.id} paddingLeft={inset()} paddingRight={inset()} paddingBottom={1} gap={1}>
156158
{props.header}
157-
<box>{props.children}</box>
159+
<box paddingBottom={newDesigns() && props.footer ? (props.footerGap ?? 1) - 1 : 0}>{props.children}</box>
158160
<Show when={newDesigns() || props.legacyFooter === undefined} fallback={props.legacyFooter}>
159161
<Show when={props.footer}>
160162
{(footer) => (

0 commit comments

Comments
 (0)