Skip to content

Commit 38e67cc

Browse files
authored
Use flex box properly and use description as intended (#15565)
1 parent 3fe26f1 commit 38e67cc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

apps/web/components/eventtype/AssignmentWarningDialog.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface AssignmentWarningDialogProps {
1212
leaveWithoutAssigningHosts: MutableRefObject<boolean>;
1313
id: number;
1414
}
15+
1516
const AssignmentWarningDialog = (props: AssignmentWarningDialogProps) => {
1617
const { t } = useLocale();
1718
const {
@@ -24,11 +25,12 @@ const AssignmentWarningDialog = (props: AssignmentWarningDialogProps) => {
2425
const router = useRouter();
2526
return (
2627
<Dialog open={isOpenAssignmentWarnDialog} onOpenChange={setIsOpenAssignmentWarnDialog}>
27-
<DialogContent title={t("leave_without_assigning_anyone")} Icon="circle-alert" type="confirmation">
28-
<div className="text-subtle text-sm">
29-
<p className="mt-3">{t("leave_without_adding_attendees")}</p>
30-
<p className="mt-4">{t("no_availability_shown_to_bookers")}</p>
31-
</div>
28+
<DialogContent
29+
title={t("leave_without_assigning_anyone")}
30+
description={`${t("leave_without_adding_attendees")} ${t("no_availability_shown_to_bookers")}`}
31+
Icon="circle-alert"
32+
enableOverflow
33+
type="confirmation">
3234
<DialogFooter className="mt-6">
3335
<Button
3436
onClick={(e) => {

packages/ui/components/dialog/Dialog.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps
134134
{type === "confirmation" && (
135135
<div className="flex">
136136
{icon && (
137-
<div className="bg-emphasis mr-4 inline-flex h-10 w-10 items-center justify-center rounded-full">
137+
<div className="bg-emphasis flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full">
138138
<Icon name={icon} className="text-emphasis h-4 w-4" />
139139
</div>
140140
)}
141-
<div className="w-full">
141+
<div className="ml-4 flex-grow">
142142
<DialogHeader title={title} subtitle={props.description} />
143143
<div data-testid="dialog-confirmation">{children}</div>
144144
</div>
@@ -167,7 +167,7 @@ export function DialogHeader(props: DialogHeaderProps) {
167167
id="modal-title">
168168
{props.title}
169169
</h3>
170-
{props.subtitle && <div className="text-subtle text-sm">{props.subtitle}</div>}
170+
{props.subtitle && <p className="text-subtle text-sm">{props.subtitle}</p>}
171171
</div>
172172
);
173173
}

0 commit comments

Comments
 (0)