File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"use client" ;
22
3+ import { getNodeEnvironment } from "@stackframe/stack-shared/dist/utils/env" ;
34import { useState } from "react" ;
45import { getPublicEnvVar } from "../lib/env" ;
56
67
78export 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 ,
You can’t perform that action at this time.
0 commit comments