Skip to content

Commit 94d3948

Browse files
chore: create 'content' container in route template
1 parent e30d966 commit 94d3948

18 files changed

+47
-55
lines changed

Diff for: src/app/routes/__root.tsx

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Sidebar from "@/components/layout/Sidebar.tsx";
21
import OfflineNotification from "@/components/layout/Offline.tsx";
2+
import Sidebar from "@/components/layout/Sidebar.tsx";
33
import {
44
createRootRouteWithContext,
55
Link,
@@ -43,13 +43,11 @@ export const Route = createRootRouteWithContext<RouterContext>()({
4343
notFoundComponent: () => (
4444
<div className="flex h-full flex-row">
4545
<Sidebar>
46-
<div className="flex h-full flex-grow flex-col">
47-
<div className="flex h-full flex-col justify-center text-center @container/content">
48-
<h1 className="mb-4 text-4xl font-bold">404 / not found</h1>
49-
<Link to="/" className="selected">
50-
Go to dashboard
51-
</Link>
52-
</div>
46+
<div className="flex min-h-full grow flex-col items-center justify-center overflow-y-auto @container/content">
47+
<h1 className="mb-4 text-4xl font-bold">404 / not found</h1>
48+
<Link to="/dashboard" className="selected">
49+
Go to dashboard
50+
</Link>
5351
</div>
5452
</Sidebar>
5553
</div>

Diff for: src/app/routes/_with_menu/account/route.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { createFileRoute, Outlet } from "@tanstack/react-router";
33

44
export const Route = createFileRoute("/_with_menu/account")({
55
component: () => (
6-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
6+
<>
77
<Topbar title="My account" />
88
<Outlet />
9-
</div>
9+
</>
1010
),
1111
});

Diff for: src/app/routes/_with_menu/dashboard.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/dashboard")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Dashboard</title>
1111
<meta
@@ -16,6 +16,6 @@ export const Route = createFileRoute("/_with_menu/dashboard")({
1616

1717
<Topbar title="Dashboard" />
1818
<DashboardPage />
19-
</div>
19+
</>
2020
),
2121
});

Diff for: src/app/routes/_with_menu/dorms.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/dorms")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Dorms</title>
1111
<meta
@@ -16,6 +16,6 @@ export const Route = createFileRoute("/_with_menu/dorms")({
1616

1717
<Topbar title="Dorms" />
1818
<DormsPage />
19-
</div>
19+
</>
2020
),
2121
});

Diff for: src/app/routes/_with_menu/extension.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/extension")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Browser extension</title>
1111
<meta
@@ -16,6 +16,6 @@ export const Route = createFileRoute("/_with_menu/extension")({
1616

1717
<Topbar title="Browser extension" />
1818
<ExtensionPage />
19-
</div>
19+
</>
2020
),
2121
});

Diff for: src/app/routes/_with_menu/maps.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const Route = createFileRoute("/_with_menu/maps")({
1717
component: function RouteComponent() {
1818
const { sceneId, q } = Route.useSearch();
1919
return (
20-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
20+
<>
2121
<Helmet>
2222
<title>Maps</title>
2323
<meta
@@ -29,7 +29,7 @@ export const Route = createFileRoute("/_with_menu/maps")({
2929
<Topbar title="Maps" />
3030
<MapsPageTabs />
3131
<MapsPage sceneId={sceneId} q={q} />
32-
</div>
32+
</>
3333
);
3434
},
3535
});

Diff for: src/app/routes/_with_menu/music-room.index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/music-room/")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Music room</title>
1111
<meta name="description" content="Book the Music room in Innopolis." />
1212
</Helmet>
1313

1414
<Topbar title="Music room" />
1515
<MusicRoomPage />
16-
</div>
16+
</>
1717
),
1818
});

Diff for: src/app/routes/_with_menu/music-room.instructions.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/music-room/instructions")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Music room</title>
1111
<meta name="description" content="Book the Music room in Innopolis." />
1212
</Helmet>
1313

1414
<Topbar title="Music room" />
1515
<MusicRoomInstructions />
16-
</div>
16+
</>
1717
),
1818
});

Diff for: src/app/routes/_with_menu/room-booking.index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Helmet } from "react-helmet-async";
66

77
export const Route = createFileRoute("/_with_menu/room-booking/")({
88
component: () => (
9-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
9+
<>
1010
<Helmet>
1111
<title>Room booking</title>
1212
<meta
@@ -18,6 +18,6 @@ export const Route = createFileRoute("/_with_menu/room-booking/")({
1818
<Topbar title="Room booking" />
1919
<BookingPageTabs />
2020
<RoomBookingPage />
21-
</div>
21+
</>
2222
),
2323
});

Diff for: src/app/routes/_with_menu/room-booking.list.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Helmet } from "react-helmet-async";
66

77
export const Route = createFileRoute("/_with_menu/room-booking/list")({
88
component: () => (
9-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
9+
<>
1010
<Helmet>
1111
<title>Room booking</title>
1212
<meta
@@ -18,6 +18,6 @@ export const Route = createFileRoute("/_with_menu/room-booking/list")({
1818
<Topbar title="Room booking" />
1919
<BookingPageTabs />
2020
<BookingsListPage />
21-
</div>
21+
</>
2222
),
2323
});

Diff for: src/app/routes/_with_menu/room-booking.rules.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Helmet } from "react-helmet-async";
66

77
export const Route = createFileRoute("/_with_menu/room-booking/rules")({
88
component: () => (
9-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
9+
<>
1010
<Helmet>
1111
<title>Room booking</title>
1212
<meta
@@ -18,6 +18,6 @@ export const Route = createFileRoute("/_with_menu/room-booking/rules")({
1818
<Topbar title="Room booking" />
1919
<BookingPageTabs />
2020
<RoomBookingRules />
21-
</div>
21+
</>
2222
),
2323
});

Diff for: src/app/routes/_with_menu/route.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const Route = createFileRoute("/_with_menu")({
55
component: () => (
66
<div className="flex h-full flex-row">
77
<Sidebar>
8-
<div className="flex h-full flex-grow flex-col">
8+
<div className="flex min-h-full grow flex-col overflow-y-auto @container/content">
99
<Outlet />
1010
</div>
1111
</Sidebar>

Diff for: src/app/routes/_with_menu/schedule/$category.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ export const Route = createFileRoute("/_with_menu/schedule/$category")({
1414
}
1515

1616
return (
17-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
17+
<>
1818
<Helmet>
1919
<title>{categoryInfo.title} — Schedule</title>
2020
<meta name="description" content={categoryInfo.shortDescription} />
2121
</Helmet>
2222

2323
<Topbar title={`Schedule — ${categoryInfo.title}`} />
2424
<ScheduleList category={category} />
25-
</div>
25+
</>
2626
);
2727
},
2828

Diff for: src/app/routes/_with_menu/schedule/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/schedule/")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Schedule</title>
1111
<meta
@@ -18,6 +18,6 @@ export const Route = createFileRoute("/_with_menu/schedule/")({
1818
</Helmet>
1919
<Topbar title="Schedule" />
2020
<ScheduleMainPage />
21-
</div>
21+
</>
2222
),
2323
});

Diff for: src/app/routes/_with_menu/scholarship.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/scholarship")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Scholarship calculator</title>
1111
<meta
@@ -19,6 +19,6 @@ export const Route = createFileRoute("/_with_menu/scholarship")({
1919

2020
<Topbar title="Scholarship" />
2121
<ScholarshipPage />
22-
</div>
22+
</>
2323
),
2424
});

Diff for: src/app/routes/_with_menu/search.tsx

+9-11
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,16 @@ export const Route = createFileRoute("/_with_menu/search")({
2020
const { q } = Route.useSearch();
2121
return (
2222
<Suspense>
23-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
24-
<Helmet>
25-
<title>Search</title>
26-
<meta
27-
name="description"
28-
content="Search anything at Innopolis University."
29-
/>
30-
</Helmet>
23+
<Helmet>
24+
<title>Search</title>
25+
<meta
26+
name="description"
27+
content="Search anything at Innopolis University."
28+
/>
29+
</Helmet>
3130

32-
<Topbar title="Search" />
33-
<SearchPage searchQuery={q} />
34-
</div>
31+
<Topbar title="Search" />
32+
<SearchPage searchQuery={q} />
3533
</Suspense>
3634
);
3735
},

Diff for: src/app/routes/_with_menu/sport.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Helmet } from "react-helmet-async";
55

66
export const Route = createFileRoute("/_with_menu/sport")({
77
component: () => (
8-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
8+
<>
99
<Helmet>
1010
<title>Sport bot</title>
1111
<meta
@@ -16,6 +16,6 @@ export const Route = createFileRoute("/_with_menu/sport")({
1616

1717
<Topbar title="Sport" />
1818
<SportPage />
19-
</div>
19+
</>
2020
),
2121
});

Diff for: src/components/schedule/EventGroupPage.tsx

+3-7
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ export function EventGroupPage({ alias }: { alias: string }) {
1818
const [exportModalOpen, setExportModalOpen] = useState(false);
1919

2020
if (!group) {
21-
return (
22-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
23-
<Topbar title="Group" />
24-
</div>
25-
);
21+
return <Topbar title="Group" />;
2622
}
2723

2824
return (
29-
<div className="flex min-h-full flex-col overflow-y-auto @container/content">
25+
<>
3026
<Helmet>
3127
<title>{group.name} group — Schedule</title>
3228
<meta name="description" content={group.description ?? undefined} />
@@ -87,6 +83,6 @@ export function EventGroupPage({ alias }: { alias: string }) {
8783
open={exportModalOpen}
8884
onOpenChange={setExportModalOpen}
8985
/>
90-
</div>
86+
</>
9187
);
9288
}

0 commit comments

Comments
 (0)