frontend client for gemstone. decentralised workplace app
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: formatting

serenity aaf704d8 5459532c

+25 -18
+25 -18
src/components/Invites/index.tsx
··· 4 4 import type { AtUri, DidPlc, DidWeb } from "@/lib/types/atproto"; 5 5 import { systemsGmstnDevelopmentChannelInviteRecordSchema } from "@/lib/types/lexicon/systems.gmstn.development.channel.invite"; 6 6 import { partition } from "@/lib/utils/arrays"; 7 - import { 8 - getCommitFromFullAtUri, 9 - getRecordFromFullAtUri, 10 - stringToAtUri, 11 - } from "@/lib/utils/atproto"; 7 + import { getCommitFromFullAtUri, stringToAtUri } from "@/lib/utils/atproto"; 12 8 import { addMembership } from "@/lib/utils/gmstn"; 13 9 import { useMemberships } from "@/providers/authed/MembershipsProvider"; 14 10 import { ··· 20 16 import { useMutation, useQueryClient } from "@tanstack/react-query"; 21 17 import { Check, Mail, MailOpen, X } from "lucide-react-native"; 22 18 import { FlatList, Pressable, View } from "react-native"; 23 - import z from "zod"; 19 + import { z } from "zod"; 24 20 25 21 export const Invites = () => { 26 22 const { semantic } = useCurrentPalette(); 27 23 const { atoms, typography } = useFacet(); 28 24 const { memberships } = useMemberships(); 29 25 const session = useOAuthSessionGuaranteed(); 30 - const { useQuery } = 31 - useConstellationInvitesQuery(session); 26 + const { useQuery } = useConstellationInvitesQuery(session); 32 27 33 28 const { data: invites, isLoading } = useQuery(); 34 29 ··· 50 45 ), 51 46 ); 52 47 53 - console.log({existingInvites, pendingInvites}) 48 + console.log({ existingInvites, pendingInvites }); 54 49 55 50 return ( 56 51 <View ··· 171 166 const { queryKey: constellationInvitesQueryKey } = 172 167 useConstellationInvitesQuery(session); 173 168 const queryClient = useQueryClient(); 174 - 175 - const queryKeysToInvalidate = constellationInvitesQueryKey.concat(["membership", session.did]) 169 + 170 + const queryKeysToInvalidate = constellationInvitesQueryKey.concat([ 171 + "membership", 172 + session.did, 173 + ]); 176 174 177 175 const { mutate: mutateInvites, error: inviteMutationError } = useMutation({ 178 176 mutationFn: async (state: "accepted" | "rejected") => { ··· 213 211 }, 214 212 }); 215 213 216 - if(!creationResult.ok) throw new Error(`Error when submitting data. Check the inputs. ${creationResult.error}`) 214 + if (!creationResult.ok) 215 + throw new Error( 216 + `Error when submitting data. Check the inputs. ${creationResult.error}`, 217 + ); 217 218 }, 218 219 onSuccess: async () => { 219 220 await queryClient.invalidateQueries({ ··· 228 229 return ( 229 230 <View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}> 230 231 <Text>{inviteAtUri.rKey}</Text> 231 - <Pressable style={{ marginLeft: 2 }} onPress={() => { 232 - mutateInvites("accepted") 233 - }}> 232 + <Pressable 233 + style={{ marginLeft: 2 }} 234 + onPress={() => { 235 + mutateInvites("accepted"); 236 + }} 237 + > 234 238 {({ hovered }) => ( 235 239 <Check 236 240 height={16} ··· 246 250 /> 247 251 )} 248 252 </Pressable> 249 - <Pressable style={{ marginLeft: 2 }} onPress={() => { 250 - mutateInvites("rejected") 251 - }}> 253 + <Pressable 254 + style={{ marginLeft: 2 }} 255 + onPress={() => { 256 + mutateInvites("rejected"); 257 + }} 258 + > 252 259 {({ hovered }) => ( 253 260 <X 254 261 height={16}