tangled
alpha
login
or
join now
roost.moe
/
recipes.blue
2
fork
atom
The recipes.blue monorepo
recipes.blue
recipes
appview
atproto
2
fork
atom
overview
issues
1
pulls
pipelines
feat: update menus
Hayden Young
1 year ago
77e4977e
1f830fad
+37
-31
4 changed files
expand all
collapse all
unified
split
apps
api
src
index.ts
web
src
components
app-sidebar.tsx
nav-main.tsx
lib
utils.ts
+5
-2
apps/api/src/index.ts
···
51
51
52
52
app.use(cors({
53
53
origin: (origin, _ctx) => {
54
54
-
if (env.ENV == 'development') origin;
55
55
-
54
54
+
if (env.ENV == 'development') {
55
55
+
const host = _ctx.req.header('Host');
56
56
+
console.log(`https://${host}`);
57
57
+
return `https://${host}`;
58
58
+
}
56
59
return env.CORS_ORIGINS.includes(origin)
57
60
? origin
58
61
: 'https://cookware.hayden.moe';
+30
-27
apps/web/src/components/app-sidebar.tsx
···
1
1
import * as React from "react"
2
2
import {
3
3
-
NotebookPen,
4
4
-
Settings2,
5
5
-
Users,
3
3
+
Book,
4
4
+
CookingPot,
5
5
+
ForkKnife,
6
6
} from "lucide-react"
7
7
8
8
import { NavMain } from "@/components/nav-main"
···
11
11
Sidebar,
12
12
SidebarContent,
13
13
SidebarFooter,
14
14
+
SidebarHeader,
15
15
+
SidebarMenu,
16
16
+
SidebarMenuButton,
17
17
+
SidebarMenuItem,
14
18
SidebarRail,
15
19
} from "@/components/ui/sidebar"
16
20
import { Suspense } from "react"
···
18
22
import { Link } from "@tanstack/react-router"
19
23
20
24
const data = {
21
21
-
user: {
22
22
-
name: "shadcn",
23
23
-
email: "m@example.com",
24
24
-
avatar: "/avatars/shadcn.jpg",
25
25
-
},
26
26
-
27
25
navMain: [
28
26
{
29
29
-
title: "Community",
27
27
+
title: "Recipes",
30
28
url: "#",
31
31
-
icon: Users,
29
29
+
icon: ForkKnife,
32
30
isActive: true,
33
31
items: [
34
32
{
···
40
38
title: "Starred",
41
39
url: "#",
42
40
},
43
43
-
{
44
44
-
title: "Settings",
45
45
-
url: "#",
46
46
-
},
47
41
],
48
42
},
49
43
{
50
50
-
title: "Yours",
44
44
+
title: "Cookbooks",
51
45
url: "#",
52
52
-
icon: NotebookPen,
46
46
+
icon: Book,
53
47
items: [
54
48
{
55
55
-
title: "Recipes",
56
56
-
url: "#",
49
49
+
title: "Browse",
50
50
+
url: "/",
57
51
},
58
58
-
],
59
59
-
},
60
60
-
{
61
61
-
title: "Settings",
62
62
-
url: "#",
63
63
-
icon: Settings2,
64
64
-
items: [
65
52
{
66
66
-
title: "General",
53
53
+
title: "Starred",
67
54
url: "#",
68
55
},
69
56
],
···
74
61
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
75
62
return (
76
63
<Sidebar collapsible="icon" {...props}>
64
64
+
<SidebarHeader>
65
65
+
<SidebarMenu>
66
66
+
<SidebarMenuItem>
67
67
+
<SidebarMenuButton size="lg" asChild>
68
68
+
<a href="#">
69
69
+
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
70
70
+
<CookingPot className="size-4" />
71
71
+
</div>
72
72
+
<div className="flex flex-col gap-0.5 leading-none">
73
73
+
<span className="font-semibold">Cookware</span>
74
74
+
</div>
75
75
+
</a>
76
76
+
</SidebarMenuButton>
77
77
+
</SidebarMenuItem>
78
78
+
</SidebarMenu>
79
79
+
</SidebarHeader>
77
80
<SidebarContent>
78
81
<NavMain items={data.navMain} />
79
82
</SidebarContent>
+1
-1
apps/web/src/components/nav-main.tsx
···
36
36
}) {
37
37
return (
38
38
<SidebarGroup>
39
39
-
<SidebarGroupLabel>Cookware</SidebarGroupLabel>
39
39
+
<SidebarGroupLabel>Community</SidebarGroupLabel>
40
40
<SidebarMenu>
41
41
{items.map((item) => (
42
42
<Collapsible
+1
-1
apps/web/src/lib/utils.ts
···
5
5
return twMerge(clsx(inputs))
6
6
}
7
7
8
8
-
export const SERVER_URL = 'cookware.fly.dev' as const;
8
8
+
export const SERVER_URL = import.meta.env.VITE_API_SERVICE;