MCPcopy Create free account
hub / github.com/coder/coder / NavbarView

Function NavbarView

site/src/modules/dashboard/Navbar/NavbarView.tsx:47–175  ·  view source on GitHub ↗
({
	user,
	buildInfo,
	supportLinks,
	onSignOut,
	canViewDeployment,
	canViewOrganizations,
	canViewHealth,
	canViewAuditLog,
	canViewConnectionLog,
	canViewAIBridge,
	canViewAISettings,
	canCreateChat,
	proxyContextValue,
})

Source from the content-addressed store, hash-verified

45};
46
47export const NavbarView: FC<NavbarViewProps> = ({
48 user,
49 buildInfo,
50 supportLinks,
51 onSignOut,
52 canViewDeployment,
53 canViewOrganizations,
54 canViewHealth,
55 canViewAuditLog,
56 canViewConnectionLog,
57 canViewAIBridge,
58 canViewAISettings,
59 canCreateChat,
60 proxyContextValue,
61}) => {
62 const prerelease = getPrereleaseFlag(buildInfo);
63
64 return (
65 <div
66 className={cn(
67 "sticky top-0 bg-surface-primary z-40 border-0 border-b border-solid h-[72px] min-h-[72px] flex items-center leading-none px-6",
68 prerelease &&
69 cn(
70 "[&:before]:content-[''] [&:before]:absolute [&:before]:left-0",
71 "[&:before]:right-0 [&:before]:h-1 [&:before]:top-0",
72 "[&:before]:bg-[repeating-linear-gradient(-45deg,_transparent,_transparent_4px,_hsl(var(--stripe-color)_/_0.5)_4px,_hsl(var(--stripe-color)_/_0.5)_8px)]",
73 ),
74 )}
75 style={{
76 "--stripe-color":
77 prerelease === "rc"
78 ? "var(--border-sky)"
79 : prerelease === "devel"
80 ? "var(--content-warning)"
81 : undefined,
82 }}
83 >
84 <NavLink to="/workspaces">
85 <ProductLogo className="h-7" />
86 </NavLink>
87
88 <NavItems
89 className="ml-4 hidden md:flex"
90 user={user}
91 canCreateChat={canCreateChat}
92 />
93
94 {prerelease && buildInfo?.version && (
95 <a
96 href={buildInfo.external_url}
97 target="_blank"
98 rel="noreferrer"
99 className="absolute top-0 left-1/2 -translate-x-1/2 no-underline z-10"
100 >
101 <Badge
102 variant={prerelease === "rc" ? "info" : "warning"}
103 size="sm"
104 className="font-mono rounded-t-none border-t-0"

Callers

nothing calls this directly

Calls 5

getPrereleaseFlagFunction · 0.90
cnFunction · 0.90
isNavbarLinkFunction · 0.85
filterMethod · 0.80

Tested by

no test coverage detected