Skip to content

Commit 1321241

Browse files
authored
✨ Add meta title support to all pages (#2039)
1 parent 5a7c5b1 commit 1321241

File tree

9 files changed

+59
-2
lines changed

9 files changed

+59
-2
lines changed

frontend/src/routes/__root.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { ReactQueryDevtools } from "@tanstack/react-query-devtools"
2-
import { createRootRoute, Outlet } from "@tanstack/react-router"
2+
import { createRootRoute, HeadContent, Outlet } from "@tanstack/react-router"
33
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"
44
import ErrorComponent from "@/components/Common/ErrorComponent"
55
import NotFound from "@/components/Common/NotFound"
66

77
export const Route = createRootRoute({
88
component: () => (
99
<>
10+
<HeadContent />
1011
<Outlet />
1112
<TanStackRouterDevtools position="bottom-right" />
1213
<ReactQueryDevtools initialIsOpen={false} />

frontend/src/routes/_layout/admin.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ function getUsersQueryOptions() {
1818

1919
export const Route = createFileRoute("/_layout/admin")({
2020
component: Admin,
21+
head: () => ({
22+
meta: [
23+
{
24+
title: "Admin - FastAPI Cloud",
25+
},
26+
],
27+
}),
2128
})
2229

2330
function UsersTableContent() {

frontend/src/routes/_layout/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import useAuth from "@/hooks/useAuth"
44

55
export const Route = createFileRoute("/_layout/")({
66
component: Dashboard,
7+
head: () => ({
8+
meta: [
9+
{
10+
title: "Dashboard - FastAPI Cloud",
11+
},
12+
],
13+
}),
714
})
815

916
function Dashboard() {
@@ -16,7 +23,7 @@ function Dashboard() {
1623
Hi, {currentUser?.full_name || currentUser?.email} 👋
1724
</h1>
1825
<p className="text-muted-foreground">
19-
Welcome back, nice to see you again!
26+
Welcome back, nice to see you again!!!
2027
</p>
2128
</div>
2229
</div>

frontend/src/routes/_layout/items.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ function getItemsQueryOptions() {
1818

1919
export const Route = createFileRoute("/_layout/items")({
2020
component: Items,
21+
head: () => ({
22+
meta: [
23+
{
24+
title: "Items - FastAPI Cloud",
25+
},
26+
],
27+
}),
2128
})
2229

2330
function ItemsTableContent() {

frontend/src/routes/_layout/settings.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ const tabsConfig = [
1414

1515
export const Route = createFileRoute("/_layout/settings")({
1616
component: UserSettings,
17+
head: () => ({
18+
meta: [
19+
{
20+
title: "Settings - FastAPI Cloud",
21+
},
22+
],
23+
}),
1724
})
1825

1926
function UserSettings() {

frontend/src/routes/login.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ export const Route = createFileRoute("/login")({
4141
})
4242
}
4343
},
44+
head: () => ({
45+
meta: [
46+
{
47+
title: "Log In - FastAPI Cloud",
48+
},
49+
],
50+
}),
4451
})
4552

4653
function Login() {

frontend/src/routes/recover-password.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ export const Route = createFileRoute("/recover-password")({
3939
})
4040
}
4141
},
42+
head: () => ({
43+
meta: [
44+
{
45+
title: "Recover Password - FastAPI Cloud",
46+
},
47+
],
48+
}),
4249
})
4350

4451
function RecoverPassword() {

frontend/src/routes/reset-password.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ export const Route = createFileRoute("/reset-password")({
5757
throw redirect({ to: "/login" })
5858
}
5959
},
60+
head: () => ({
61+
meta: [
62+
{
63+
title: "Reset Password - FastAPI Cloud",
64+
},
65+
],
66+
}),
6067
})
6168

6269
function ResetPassword() {

frontend/src/routes/signup.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ export const Route = createFileRoute("/signup")({
4848
})
4949
}
5050
},
51+
head: () => ({
52+
meta: [
53+
{
54+
title: "Sign Up - FastAPI Cloud",
55+
},
56+
],
57+
}),
5158
})
5259

5360
function SignUp() {

0 commit comments

Comments
 (0)