sforkowany z mirror/soapbox
Groups: add dot to group with pending membership requests
rodzic
89ab02224f
commit
609a25fd8d
|
@ -43,8 +43,14 @@ const GroupCard: React.FC<IGroupCard> = ({ group }) => {
|
|||
|
||||
{/* Group Info */}
|
||||
<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 }} />
|
||||
|
||||
{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>
|
||||
<GroupRelationship 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 TabBar, { TabItems } from './components/tab-bar';
|
||||
|
||||
import type { Group as GroupEntity } from 'soapbox/types/entities';
|
||||
|
||||
const messages = defineMessages({
|
||||
placeholder: { id: 'groups.search.placeholder', defaultMessage: 'Search My Groups' },
|
||||
});
|
||||
|
@ -109,7 +107,7 @@ const Groups: React.FC = () => {
|
|||
>
|
||||
{groups.map((group) => (
|
||||
<Link key={group.id} to={`/groups/${group.id}`}>
|
||||
<GroupCard group={group as GroupEntity} />
|
||||
<GroupCard group={group} />
|
||||
</Link>
|
||||
))}
|
||||
</ScrollableList>
|
||||
|
|
|
@ -17,6 +17,7 @@ export const GroupRelationshipRecord = ImmutableRecord({
|
|||
notifying: null,
|
||||
requested: false,
|
||||
role: 'user' as GroupRoles,
|
||||
pending_requests: false,
|
||||
});
|
||||
|
||||
export const normalizeGroupRelationship = (relationship: Record<string, any>) => {
|
||||
|
|
|
@ -9,6 +9,7 @@ const groupRelationshipSchema = z.object({
|
|||
role: z.nativeEnum(GroupRoles).catch(GroupRoles.USER),
|
||||
blocked_by: z.boolean().catch(false),
|
||||
notifying: z.boolean().nullable().catch(null),
|
||||
pending_requests: z.boolean().catch(false),
|
||||
});
|
||||
|
||||
type GroupRelationship = z.infer<typeof groupRelationshipSchema>;
|
||||
|
|
Ładowanie…
Reference in New Issue