({
className,
community,
onClick,
getHomeUrl,
selected,
CustomLink,
}: Props)
| 20 | } |
| 21 | |
| 22 | export 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 | } |
nothing calls this directly
no test coverage detected