Groups: add dot to group with pending membership requests
This commit is contained in:
parent
89ab02224f
commit
609a25fd8d
4 changed files with 10 additions and 4 deletions
|
@ -43,8 +43,14 @@ const GroupCard: React.FC<IGroupCard> = ({ group }) => {
|
||||||
|
|
||||||
{/* Group Info */}
|
{/* Group Info */}
|
||||||
<Stack alignItems='center' justifyContent='end' grow className='basis-1/2 py-4' space={0.5}>
|
<Stack alignItems='center' justifyContent='end' grow className='basis-1/2 py-4' space={0.5}>
|
||||||
|
<HStack alignItems='center' space={1.5}>
|
||||||
<Text size='lg' weight='bold' dangerouslySetInnerHTML={{ __html: group.display_name_html }} />
|
<Text size='lg' weight='bold' dangerouslySetInnerHTML={{ __html: group.display_name_html }} />
|
||||||
|
|
||||||
|
{group.relationship?.pending_requests && (
|
||||||
|
<div className='h-2 w-2 rounded-full bg-secondary-500' />
|
||||||
|
)}
|
||||||
|
</HStack>
|
||||||
|
|
||||||
<HStack className='text-gray-700 dark:text-gray-600' space={2} wrap>
|
<HStack className='text-gray-700 dark:text-gray-600' space={2} wrap>
|
||||||
<GroupRelationship group={group} />
|
<GroupRelationship group={group} />
|
||||||
<GroupPrivacy group={group} />
|
<GroupPrivacy group={group} />
|
||||||
|
|
|
@ -15,8 +15,6 @@ import PlaceholderGroupCard from '../placeholder/components/placeholder-group-ca
|
||||||
import PendingGroupsRow from './components/pending-groups-row';
|
import PendingGroupsRow from './components/pending-groups-row';
|
||||||
import TabBar, { TabItems } from './components/tab-bar';
|
import TabBar, { TabItems } from './components/tab-bar';
|
||||||
|
|
||||||
import type { Group as GroupEntity } from 'soapbox/types/entities';
|
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
placeholder: { id: 'groups.search.placeholder', defaultMessage: 'Search My Groups' },
|
placeholder: { id: 'groups.search.placeholder', defaultMessage: 'Search My Groups' },
|
||||||
});
|
});
|
||||||
|
@ -109,7 +107,7 @@ const Groups: React.FC = () => {
|
||||||
>
|
>
|
||||||
{groups.map((group) => (
|
{groups.map((group) => (
|
||||||
<Link key={group.id} to={`/groups/${group.id}`}>
|
<Link key={group.id} to={`/groups/${group.id}`}>
|
||||||
<GroupCard group={group as GroupEntity} />
|
<GroupCard group={group} />
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
|
|
|
@ -17,6 +17,7 @@ export const GroupRelationshipRecord = ImmutableRecord({
|
||||||
notifying: null,
|
notifying: null,
|
||||||
requested: false,
|
requested: false,
|
||||||
role: 'user' as GroupRoles,
|
role: 'user' as GroupRoles,
|
||||||
|
pending_requests: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const normalizeGroupRelationship = (relationship: Record<string, any>) => {
|
export const normalizeGroupRelationship = (relationship: Record<string, any>) => {
|
||||||
|
|
|
@ -9,6 +9,7 @@ const groupRelationshipSchema = z.object({
|
||||||
role: z.nativeEnum(GroupRoles).catch(GroupRoles.USER),
|
role: z.nativeEnum(GroupRoles).catch(GroupRoles.USER),
|
||||||
blocked_by: z.boolean().catch(false),
|
blocked_by: z.boolean().catch(false),
|
||||||
notifying: z.boolean().nullable().catch(null),
|
notifying: z.boolean().nullable().catch(null),
|
||||||
|
pending_requests: z.boolean().catch(false),
|
||||||
});
|
});
|
||||||
|
|
||||||
type GroupRelationship = z.infer<typeof groupRelationshipSchema>;
|
type GroupRelationship = z.infer<typeof groupRelationshipSchema>;
|
||||||
|
|
Loading…
Reference in a new issue