Skip to content

Commit d0bc95b

Browse files
committed
Hide dev port display when not available
1 parent 502963b commit d0bc95b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/dashboard/src/app/development-port-display.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
"use client";
22

3+
import { getNodeEnvironment } from "@stackframe/stack-shared/dist/utils/env";
34
import { useState } from "react";
45
import { getPublicEnvVar } from "../lib/env";
56

67

78
export function DevelopmentPortDisplay() {
89
const [isVisible, setIsVisible] = useState(true);
910
const prefix = getPublicEnvVar("NEXT_PUBLIC_STACK_PORT_PREFIX");
10-
if (!prefix || !isVisible) return null;
11+
if (!prefix || !isVisible || !getNodeEnvironment().includes("development")) return null;
1112
const color = ({
1213
"91": "#eee",
1314
"92": "#fff8e0",
1415
"93": "#e0e0ff",
1516
} as any)[prefix as any] || undefined;
17+
if (!color) return null;
1618
return (
1719
<div onClick={() => setIsVisible(false)} className="fixed top-0 left-0 p-2 text-red-700 animate-[dev-port-slide_120s_linear_infinite] flex gap-2" style={{
1820
backgroundColor: color,

0 commit comments

Comments
 (0)