improvement: treatments UI/UX updated again to minimize clicking and scrolling.
This commit is contained in:
@@ -397,8 +397,17 @@ export function CasesPage() {
|
||||
mobileDetailOpen && selectedCaseId ? 'hidden lg:flex' : 'flex'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<div className="min-w-0 flex-1">
|
||||
{canEdit ? (
|
||||
<Button
|
||||
type="button"
|
||||
size="lg"
|
||||
fullWidth
|
||||
disabled={creatingCase}
|
||||
onClick={() => void handleAddCase()}
|
||||
>
|
||||
{t('addCase')}
|
||||
</Button>
|
||||
) : null}
|
||||
<SearchBar
|
||||
embedded
|
||||
value={search}
|
||||
@@ -408,19 +417,6 @@ export function CasesPage() {
|
||||
}}
|
||||
placeholder={t('searchPlaceholder')}
|
||||
/>
|
||||
</div>
|
||||
{canEdit ? (
|
||||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
className="shrink-0"
|
||||
disabled={creatingCase}
|
||||
onClick={() => void handleAddCase()}
|
||||
>
|
||||
{t('addCase')}
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="grid gap-2 sm:grid-cols-2">
|
||||
<label className="space-y-1">
|
||||
@@ -661,6 +657,25 @@ export function CasesPage() {
|
||||
page,
|
||||
});
|
||||
}}
|
||||
onDeleted={() => {
|
||||
const remainingOnPage = cases.filter((item) => item.id !== selectedCase.id);
|
||||
const nextPage = remainingOnPage.length === 0 && page > 1 ? page - 1 : page;
|
||||
setSelectedCaseId(null);
|
||||
setSelectedCase(null);
|
||||
setMobileDetailOpen(false);
|
||||
if (nextPage !== page) {
|
||||
setPage(nextPage);
|
||||
return;
|
||||
}
|
||||
void loadCases({
|
||||
q: search,
|
||||
clinicOrganizationId: clinicId,
|
||||
prosthesisTypeCode,
|
||||
sentFrom,
|
||||
sentTo,
|
||||
page: nextPage,
|
||||
});
|
||||
}}
|
||||
onError={toast.showError}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user