Skip to content

Commit e91c887

Browse files
committed
Layout improvements
1 parent 54bccff commit e91c887

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

apps/webapp/app/components/errors/ConfigureErrorAlerts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function ConfigureErrorAlerts({
102102

103103
return (
104104
<div className="grid h-full grid-rows-[auto_1fr_auto] overflow-hidden">
105-
<div className="flex items-center justify-between border-b border-grid-bright px-4 py-3">
105+
<div className="flex items-center justify-between border-b border-grid-bright px-3 py-2">
106106
<Header2>Configure alerts</Header2>
107107
<LinkButton
108108
to={closeHref}

apps/webapp/app/components/layout/AppLayout.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ export function MainBody({ children }: { children: React.ReactNode }) {
2020
}
2121

2222
/** This container should be placed around the content on a page */
23-
export function PageContainer({ children }: { children: React.ReactNode }) {
24-
return <div className="grid h-full grid-rows-[auto_1fr] overflow-hidden">{children}</div>;
23+
export function PageContainer({
24+
children,
25+
className,
26+
}: {
27+
children: React.ReactNode;
28+
className?: string;
29+
}) {
30+
return (
31+
<div className={cn("grid h-full grid-rows-[auto_1fr] overflow-hidden", className)}>
32+
{children}
33+
</div>
34+
);
2535
}
2636

2737
export function PageBody({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export default function Page() {
196196
}, [location.search]);
197197

198198
return (
199-
<>
199+
<div className="grid h-full grid-rows-[auto_1fr] overflow-hidden">
200200
<NavBar>
201201
<PageTitle title="Errors" />
202202
<PageAccessories>
@@ -271,7 +271,7 @@ export default function Page() {
271271
</TypedAwait>
272272
</Suspense>
273273
</PageBody>
274-
</>
274+
</div>
275275
);
276276
}
277277

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { parse } from "@conform-to/zod";
2-
import { Outlet, useSearchParams } from "@remix-run/react";
2+
import { Outlet } from "@remix-run/react";
33
import { type ActionFunctionArgs, type LoaderFunctionArgs, json } from "@remix-run/server-runtime";
44
import { typedjson, useTypedLoaderData } from "remix-typedjson";
55
import { PageContainer } from "~/components/layout/AppLayout";
@@ -22,6 +22,7 @@ import {
2222
type CreateAlertChannelOptions,
2323
CreateAlertChannelService,
2424
} from "~/v3/services/alerts/createAlertChannel.server";
25+
import { useSearchParams } from "~/hooks/useSearchParam";
2526

2627
export const loader = async ({ request, params }: LoaderFunctionArgs) => {
2728
const userId = await requireUserId(request);
@@ -152,12 +153,12 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
152153

153154
export default function Page() {
154155
const { alertData, connectToSlackHref } = useTypedLoaderData<typeof loader>();
155-
const [searchParams] = useSearchParams();
156-
const showAlerts = searchParams.has("alerts");
156+
const { has } = useSearchParams();
157+
const showAlerts = has("alerts") ?? false;
157158

158159
return (
159-
<PageContainer>
160-
<ResizablePanelGroup orientation="horizontal" className="h-full overflow-hidden">
160+
<PageContainer className="grid-rows-[1fr]">
161+
<ResizablePanelGroup orientation="horizontal" className="h-full max-h-full overflow-hidden">
161162
<ResizablePanel id="errors-main" min="300px">
162163
<Outlet />
163164
</ResizablePanel>

0 commit comments

Comments
 (0)