refactor: centralize ENVIRONMENT constant usage in addMenu and constants

This commit is contained in:
2025-11-12 19:17:38 +01:00
parent 3db1ddce23
commit e7d761e4ad
2 changed files with 13 additions and 7 deletions
+10 -4
View File
@@ -1,6 +1,8 @@
import { Plus } from "lucide-react"
import Link from "next/link"
import { ENVIRONMENT } from "@/lib/constants"
import { Button } from "../ui/button"
import {
DropdownMenu,
@@ -64,10 +66,14 @@ export default function AddMenu() {
</Link>
</DropdownMenuItem>
))}
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<ResetButton />
</DropdownMenuItem>
{ENVIRONMENT === "development" && (
<>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<ResetButton />
</DropdownMenuItem>
</>
)}
</DropdownMenuContent>
</DropdownMenu>
)
+3 -3
View File
@@ -1,7 +1,7 @@
export const ENVIRONMENT = process.env.NODE_ENV || "development"
export const SITE_URL =
process.env.NODE_ENV === "development"
? "http://localhost:3000"
: process.env.DOMAIN
ENVIRONMENT === "development" ? "http://localhost:3000" : process.env.DOMAIN
export const SIGN_IN_URL = "/login"