Skip to content

Don't need footer with cancel button in read-only side modal forms #2619

@david-crespo

Description

@david-crespo

The X in the corner should be sufficient — there's no operation to "cancel". So it might be cool to add a flag to the form that lets us suppress the footer altogether. onSubmit is already optional, so maybe we just use that to hide the entire footer.

<SideModal.Footer error={!!submitError}>
<Button variant="ghost" size="sm" onClick={onDismiss}>
Cancel
</Button>
{onSubmit && (
<Button
type="submit"
size="sm"
disabled={!!submitDisabled}
disabledReason={submitDisabled}
loading={loading || isSubmitting}
form={id}
>
{label}
</Button>
)}
</SideModal.Footer>

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions