({
className,
community,
}: {
className?: string;
community: SerializedAccount;
})
| 7 | import { getHomeUrl } from '@linen/utilities/home'; |
| 8 | |
| 9 | function CommunityCard({ |
| 10 | className, |
| 11 | community, |
| 12 | }: { |
| 13 | className?: string; |
| 14 | community: SerializedAccount; |
| 15 | }) { |
| 16 | if (community.logoUrl) { |
| 17 | return ( |
| 18 | <a |
| 19 | className={classNames(styles.logo, className)} |
| 20 | style={{ |
| 21 | backgroundColor: community.brandColor, |
| 22 | }} |
| 23 | href={getHomeUrl(community)} |
| 24 | target="_blank" |
| 25 | rel="noreferrer" |
| 26 | > |
| 27 | <img |
| 28 | src={community.logoUrl as string} |
| 29 | alt="Logo" |
| 30 | height="50" |
| 31 | width="200" |
| 32 | /> |
| 33 | </a> |
| 34 | ); |
| 35 | } |
| 36 | return ( |
| 37 | <a |
| 38 | href={getHomeUrl(community)} |
| 39 | className={classNames(styles.card, className)} |
| 40 | target="_blank" |
| 41 | > |
| 42 | <CommunityIcon community={community} /> |
| 43 | <div className={styles.content}> |
| 44 | <h2>{community.name}</h2> |
| 45 | {community.description && <p>{truncate(community.description, 160)}</p>} |
| 46 | </div> |
| 47 | </a> |
| 48 | ); |
| 49 | } |
| 50 | export default CommunityCard; |
nothing calls this directly
no test coverage detected