MCPcopy Create free account
hub / github.com/bytebase/bytebase / BytebaseLogo

Function BytebaseLogo

frontend/src/react/components/BytebaseLogo.tsx:19–67  ·  view source on GitHub ↗
({ className, redirect }: Props)

Source from the content-addressed store, hash-verified

17 *
18 */
19export function BytebaseLogo({ className, redirect }: Props) {
20 const { t } = useTranslation();
21 const workspace = useWorkspace();
22 const { record } = useRecentVisit();
23 const navigate = useNavigate();
24 const customLogo = workspace?.logo ?? "";
25
26 const content = (
27 <span className="h-full w-full select-none flex flex-row justify-center items-center">
28 {customLogo ? (
29 <img
30 src={customLogo}
31 alt={t("settings.general.workspace.logo")}
32 className="h-full object-contain"
33 />
34 ) : (
35 <img
36 src={logoFull}
37 alt="Bytebase"
38 className="h-8 md:h-10 w-auto object-contain"
39 />
40 )}
41 </span>
42 );
43
44 return (
45 <div
46 className={cn(
47 "shrink-0 max-w-44 flex items-center overflow-hidden",
48 className
49 )}
50 >
51 {redirect ? (
52 <RouterLink
53 to={{ name: redirect }}
54 className="h-full w-full cursor-pointer"
55 onClick={() => {
56 const route = navigate.resolve({ name: redirect });
57 record(route.fullPath);
58 }}
59 >
60 {content}
61 </RouterLink>
62 ) : (
63 content
64 )}
65 </div>
66 );
67}

Callers

nothing calls this directly

Calls 6

useWorkspaceFunction · 0.90
useRecentVisitFunction · 0.90
useNavigateFunction · 0.90
cnFunction · 0.90
resolveMethod · 0.80
tFunction · 0.50

Tested by

no test coverage detected