Make # members clickable to Group Members page

This commit is contained in:
Chewbacca 2023-05-23 12:32:44 -04:00
parent d564728117
commit 5c069b8b93

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom';
import { Text } from 'soapbox/components/ui'; import { Text } from 'soapbox/components/ui';
import { Group } from 'soapbox/types/entities'; import { Group } from 'soapbox/types/entities';
@ -11,6 +12,7 @@ interface IGroupMemberCount {
const GroupMemberCount = ({ group }: IGroupMemberCount) => { const GroupMemberCount = ({ group }: IGroupMemberCount) => {
return ( return (
<Link to={`/group/${group.slug}/members`} className='hover:underline'>
<Text theme='inherit' tag='span' size='sm' weight='medium' data-testid='group-member-count'> <Text theme='inherit' tag='span' size='sm' weight='medium' data-testid='group-member-count'>
{shortNumberFormat(group.members_count)} {shortNumberFormat(group.members_count)}
{' '} {' '}
@ -22,6 +24,7 @@ const GroupMemberCount = ({ group }: IGroupMemberCount) => {
}} }}
/> />
</Text> </Text>
</Link>
); );
}; };