MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / CommunityLink

Function CommunityLink

apps/web/ui/CommunityLink/index.tsx:22–58  ·  view source on GitHub ↗
({
  className,
  community,
  onClick,
  getHomeUrl,
  selected,
  CustomLink,
}: Props)

Source from the content-addressed store, hash-verified

20}
21
22export default function CommunityLink({
23 className,
24 community,
25 onClick,
26 getHomeUrl,
27 selected,
28 CustomLink,
29}: Props) {
30 const href = getHomeUrl(community);
31 if (href === '/') return <></>;
32
33 return (
34 <Tooltip text={community.name || 'Community'} position="right">
35 {CustomLink ? (
36 <CustomLink
37 href={href}
38 className={classNames(styles.link, className, {
39 [styles.selected]: selected,
40 })}
41 onClick={onClick}
42 >
43 <CommunityIcon community={community} />
44 </CustomLink>
45 ) : (
46 <a
47 href={href}
48 className={classNames(styles.link, className, {
49 [styles.selected]: selected,
50 })}
51 onClick={onClick}
52 >
53 <CommunityIcon community={community} />
54 </a>
55 )}
56 </Tooltip>
57 );
58}

Callers

nothing calls this directly

Calls 1

getHomeUrlFunction · 0.85

Tested by

no test coverage detected