Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(FormDialog): 構造をシンプル化 #5213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ const formDialogContentInner = tv({
extend: dialogContentInner,
slots: {
// 領域を狭くしたときにwrapperも縮むようにflexを使用
wrapper: 'shr-flex shr-flex-col',
// 領域を狭くしたときにwrapperも縮むようにflexを使用
form: 'shr-overflow-y-auto shr-flex-auto shr-flex shr-flex-col',
contentWrapper: 'shr-overflow-y-auto shr-flex-auto',
form: 'shr-contents',
},
})

Expand Down Expand Up @@ -88,19 +85,16 @@ export const FormDialogContentInner: FC<FormDialogContentInnerProps> = ({
)
const isRequestProcessing = responseMessage && responseMessage.status === 'processing'

const { form, contentWrapper, wrapper, actionArea, buttonArea, message } =
formDialogContentInner()
const { form, wrapper, actionArea, buttonArea, message } = formDialogContentInner()

return (
// eslint-disable-next-line smarthr/a11y-heading-in-sectioning-content, smarthr/a11y-prohibit-sectioning-content-in-form
<Section className={wrapper()}>
// eslint-disable-next-line smarthr/best-practice-for-layouts, smarthr/a11y-heading-in-sectioning-content
<Stack gap={0} as={Section} className={wrapper()}>
<DialogHeader title={title} subtitle={subtitle} titleTag={titleTag} titleId={titleId} />
<form onSubmit={handleSubmitAction} className={form()}>
<div className={contentWrapper()}>
<DialogBody contentPadding={contentPadding} contentBgColor={contentBgColor}>
{children}
</DialogBody>
</div>
<DialogBody contentPadding={contentPadding} contentBgColor={contentBgColor}>
{children}
</DialogBody>
<Stack gap={0.5} className={actionArea()}>
<Cluster justify="space-between">
{subActionArea}
Expand Down Expand Up @@ -132,6 +126,6 @@ export const FormDialogContentInner: FC<FormDialogContentInnerProps> = ({
)}
</Stack>
</form>
</Section>
</Stack>
)
}
Loading