Skip to content

Commit

Permalink
[PM-1541] Adjust the dialogs max-width (#5036)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Apr 25, 2023
1 parent 85277aa commit 76673eb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form [formGroup]="formGroup" [bitSubmit]="submit">
<bit-dialog [disablePadding]="!loading">
<bit-dialog [disablePadding]="!loading" dialogSize="large">
<span bitDialogTitle>
{{ title }}
<span class="tw-text-sm tw-normal-case tw-text-muted" *ngIf="!loading && params.name">{{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form [formGroup]="formGroup" [bitSubmit]="submit">
<bit-dialog dialogSize="default">
<bit-dialog dialogSize="large">
<ng-container bitDialogTitle>{{ title | i18n }}</ng-container>
<div bitDialogContent class="tw-relative">
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<bit-dialog>
<bit-dialog dialogSize="large">
<span bitDialogTitle>
{{ "importError" | i18n }}
</span>
Expand All @@ -13,7 +13,9 @@
</ng-container>
<ng-template body>
<tr bitRow *ngFor="let line of errorLines">
<td bitCell class="tw-break-all">[{{ line.id }}] [{{ line.type }}] {{ line.key }}</td>
<td bitCell class="tw-whitespace-nowrap">
[{{ line.id }}] [{{ line.type }}] {{ line.key }}
</td>
<td bitCell>{{ line.errorMessage }}</td>
</tr>
</ng-template>
Expand Down
2 changes: 1 addition & 1 deletion libs/components/src/dialog/dialog/dialog.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div
class="tw-flex tw-w-full tw-flex-col tw-self-center tw-overflow-hidden tw-rounded tw-border tw-border-solid tw-border-secondary-300 tw-bg-background tw-text-main"
[ngClass]="width"
class="tw-flex tw-flex-col tw-overflow-hidden tw-rounded tw-border tw-border-solid tw-border-secondary-300 tw-bg-background tw-text-main"
@fadeIn
>
<div
Expand Down
12 changes: 8 additions & 4 deletions libs/components/src/dialog/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ export class DialogComponent {
return this._disablePadding;
}

@HostBinding("class") classes = ["tw-flex", "tw-flex-col", "tw-py-4", "tw-max-h-screen"];
@HostBinding("class") get classes() {
return ["tw-flex", "tw-flex-col", "tw-max-h-screen", "tw-w-screen", "tw-p-4"].concat(
this.width
);
}

get width() {
switch (this.dialogSize) {
case "small": {
return "tw-w-96";
return "tw-max-w-sm";
}
case "large": {
return "tw-w-75vw";
return "tw-max-w-3xl";
}
default: {
return "tw-w-50vw";
return "tw-max-w-xl";
}
}
}
Expand Down

0 comments on commit 76673eb

Please sign in to comment.