Skip to content

Commit a5730e4

Browse files
committed
Improves the branches page filters
1 parent 36c32ce commit a5730e4

1 file changed

Lines changed: 17 additions & 29 deletions

File tree

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@ const PurchaseSchema = z.discriminatedUnion("action", [
132132
}),
133133
z.object({
134134
action: z.literal("quota-increase"),
135-
amount: z.coerce
136-
.number()
137-
.int("Must be a whole number")
138-
.min(1, "Amount must be greater than 0"),
135+
amount: z.coerce.number().int("Must be a whole number").min(1, "Amount must be greater than 0"),
139136
}),
140137
]);
141138

@@ -329,23 +326,16 @@ export default function Page() {
329326
</MainCenteredContainer>
330327
) : (
331328
<>
332-
<div className="flex items-center justify-between gap-x-2 p-2">
329+
<div className="flex items-center justify-between gap-x-1.5 p-2">
333330
<BranchFilters />
334-
<div className="flex items-center justify-end gap-x-2">
335-
<PaginationControls
336-
currentPage={currentPage}
337-
totalPages={totalPages}
338-
showPageNumbers={false}
339-
/>
340-
</div>
331+
<PaginationControls
332+
currentPage={currentPage}
333+
totalPages={totalPages}
334+
showPageNumbers={false}
335+
/>
341336
</div>
342337

343-
<div
344-
className={cn(
345-
"grid max-h-full min-h-full overflow-x-auto",
346-
totalPages > 1 ? "grid-rows-[1fr_auto]" : "grid-rows-[1fr]"
347-
)}
348-
>
338+
<div className="grid max-h-full min-h-full grid-rows-[1fr] overflow-x-auto">
349339
<Table>
350340
<TableHeader>
351341
<TableRow>
@@ -438,14 +428,6 @@ export default function Page() {
438428
)}
439429
</TableBody>
440430
</Table>
441-
<div
442-
className={cn(
443-
"flex min-h-full",
444-
totalPages > 1 && "justify-end border-t border-grid-dimmed px-2 py-3"
445-
)}
446-
>
447-
<PaginationControls currentPage={currentPage} totalPages={totalPages} />
448-
</div>
449431
</div>
450432

451433
<div className="flex w-full items-start justify-between">
@@ -545,12 +527,12 @@ export function BranchFilters() {
545527

546528
return (
547529
<div className="flex w-full items-center justify-between gap-2">
548-
<SearchInput placeholder="Search branch name" resetParams={["page"]} />
530+
<SearchInput placeholder="Search branch name" resetParams={["page"]} />
549531
<Switch
550532
checked={showArchived ?? false}
551533
onCheckedChange={handleArchivedChange}
552534
label="Show archived"
553-
variant="small"
535+
variant="secondary/small"
554536
/>
555537
</div>
556538
);
@@ -673,7 +655,13 @@ function PurchaseBranchesModal({
673655
const [open, setOpen] = useState(false);
674656
useEffect(() => {
675657
const data = fetcher.data;
676-
if (fetcher.state === "idle" && data !== null && typeof data === "object" && "ok" in data && data.ok) {
658+
if (
659+
fetcher.state === "idle" &&
660+
data !== null &&
661+
typeof data === "object" &&
662+
"ok" in data &&
663+
data.ok
664+
) {
677665
setOpen(false);
678666
}
679667
}, [fetcher.state, fetcher.data]);

0 commit comments

Comments
 (0)