Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds link to github profile #7142

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions apps/site/components/Common/AvatarGroup/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as RadixAvatar from '@radix-ui/react-avatar';
import type { FC } from 'react';

import Link from '@/components/Link';

import styles from './index.module.css';

export type AvatarProps = {
Expand All @@ -11,16 +13,18 @@ export type AvatarProps = {

const Avatar: FC<AvatarProps> = ({ src, alt, fallback }) => (
<RadixAvatar.Root className={styles.avatarRoot}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RadixAvatar.Root becomes a span. I don't think it matters from a DOM validation part which is outer-most - so I left Root, root. It also worked moving all the styles to the Link when I briefly had that as the root.

<RadixAvatar.Image
loading="lazy"
src={src}
alt={alt}
title={alt}
className={styles.avatar}
/>
<RadixAvatar.Fallback delayMs={500} className={styles.avatar}>
{fallback}
</RadixAvatar.Fallback>
<Link href={`https://github.com/${alt}`}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On some pages, such as /blog page, user names are sent as alt, this may cause incorrect links to be created 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call. i think we should continue to pursue #7143 instead

<RadixAvatar.Image
loading="lazy"
src={src}
alt={alt}
title={alt}
className={styles.avatar}
/>
<RadixAvatar.Fallback delayMs={500} className={styles.avatar}>
{fallback}
</RadixAvatar.Fallback>
</Link>
</RadixAvatar.Root>
);

Expand Down
Loading