Skip to content

Commit 6c8b2fc

Browse files
authored
Tweaks for small screens and forms (#1138)
* fix: bump dialog z-index * fix: tweak page header layout for small screens * fix: disable save buttons during loading * fix: disable save buttons after success * fix: disable delete buttons during loading
1 parent efbce1f commit 6c8b2fc

File tree

6 files changed

+29
-6
lines changed

6 files changed

+29
-6
lines changed

ui/src/components/form/delete-form/delete-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const DeleteForm = ({
3838
<span>{translate(STRING.CANCEL)}</span>
3939
</Button>
4040
<Button
41-
disabled={isSuccess}
41+
disabled={isLoading || isSuccess}
4242
onClick={onSubmit}
4343
size="small"
4444
variant="destructive"

ui/src/design-system/components/button/save-button.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ export const SaveButton = ({
1111
isSuccess?: boolean
1212
onClick?: () => void
1313
}) => (
14-
<Button onClick={onClick} size="small" type="submit" variant="success">
14+
<Button
15+
disabled={isLoading || isSuccess}
16+
onClick={onClick}
17+
size="small"
18+
type="submit"
19+
variant="success"
20+
>
1521
<span>{isSuccess ? translate(STRING.SAVED) : translate(STRING.SAVE)}</span>
1622
{isSuccess ? (
1723
<CheckIcon className="w-4 h-4" />

ui/src/design-system/components/dialog/dialog.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $dialog-padding-medium: 32px;
99
background-color: rgba(0, 0, 0, 0.2);
1010
position: fixed;
1111
inset: 0;
12-
z-index: 3;
12+
z-index: 50;
1313
}
1414

1515
.loadingWrapper {
@@ -36,7 +36,7 @@ $dialog-padding-medium: 32px;
3636
max-width: calc(100% - (2 * $dialog-padding-large));
3737
height: calc(100vh - (2 * $dialog-padding-large));
3838
height: calc(100dvh - (2 * $dialog-padding-large));
39-
z-index: 3;
39+
z-index: 50;
4040

4141
&.compact {
4242
width: 384px;

ui/src/design-system/components/page-header/page-header.module.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@
3434
}
3535

3636
@media only screen and (max-width: $small-screen-breakpoint) {
37+
.wrapper {
38+
align-items: flex-start;
39+
flex-direction: column;
40+
gap: 16px;
41+
}
42+
43+
.actions {
44+
align-items: flex-start;
45+
flex-wrap: wrap;
46+
}
47+
3748
.details {
3849
flex-direction: column;
3950
align-items: flex-start;

ui/src/design-system/components/page-header/page-header.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export const PageHeader = ({
4949
</div>
5050
</div>
5151
</div>
52-
<div className={classNames(styles.row, 'no-print')}>{children}</div>
52+
<div className={classNames(styles.row, styles.actions, 'no-print')}>
53+
{children}
54+
</div>
5355
</div>
5456
)

ui/src/design-system/components/sort-control.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import classNames from 'classnames'
12
import { ArrowUpDownIcon } from 'lucide-react'
23
import { buttonVariants, Select } from 'nova-ui-kit'
34
import { STRING, translate } from 'utils/language'
@@ -24,7 +25,10 @@ export const SortControl = ({ columns, setSort, sort }: SortControlProps) => {
2425
>
2526
<BasicTooltip asChild content={translate(STRING.SORT_BY)}>
2627
<Select.Trigger
27-
className={buttonVariants({ size: 'small', variant: 'outline' })}
28+
className={classNames(
29+
buttonVariants({ size: 'small', variant: 'outline' }),
30+
'w-auto'
31+
)}
2832
>
2933
<ArrowUpDownIcon className="w-4 h-4" />
3034
<span>{column ? column.name : translate(STRING.SORT_BY)}</span>

0 commit comments

Comments
 (0)