Skip to content

Commit

Permalink
fix: avatar group overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
canerakdas committed Nov 23, 2023
1 parent 4015029 commit 0e1ba61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions components/Common/AvatarGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ import styles from './index.module.css';
type AvatarGroupProps = {
avatars: ComponentProps<typeof Avatar>[];
limit?: number;
isExpandable?: boolean;
};

const AvatarGroup: FC<AvatarGroupProps> = ({ avatars, limit = 10 }) => {
const AvatarGroup: FC<AvatarGroupProps> = ({
avatars,
limit = 10,
isExpandable = true,
}) => {
const [showMore, setShowMore] = useState(false);

const renderAvatars = useMemo(
Expand All @@ -33,7 +38,7 @@ const AvatarGroup: FC<AvatarGroupProps> = ({ avatars, limit = 10 }) => {

{avatars.length > limit && (
<span
onClick={() => setShowMore(!showMore)}
onClick={() => isExpandable && setShowMore(!showMore)}
className={classNames(avatarstyles.avatarRoot, 'cursor-pointer')}
>
<span className={avatarstyles.avatar}>
Expand Down
2 changes: 1 addition & 1 deletion components/Downloads/ChangelogModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ChangelogModal: FC<PropsWithChildren<ChangelogModalProps>> = ({
{subheading}
</Dialog.Description>
<div className={styles.authors}>
<AvatarGroup avatars={avatars} />
<AvatarGroup avatars={avatars} isExpandable={false} />
<Link href="/get-involved">
{t('components.downloads.changelogModal.startContributing')}
<ArrowUpRightIcon />
Expand Down

0 comments on commit 0e1ba61

Please sign in to comment.