Groups: add dot to group with pending membership requests

develop^2
Alex Gleason 2023-03-29 12:21:43 -05:00
rodzic 89ab02224f
commit 609a25fd8d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
4 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -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} />

Wyświetl plik

@ -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>

Wyświetl plik

@ -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>) => {

Wyświetl plik

@ -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>;