frontend client for gemstone. decentralised workplace app

chore: formatting

serenity aaf704d8 5459532c

Changed files
+25 -18
src
components
Invites
+25 -18
src/components/Invites/index.tsx
···
import type { AtUri, DidPlc, DidWeb } from "@/lib/types/atproto";
import { systemsGmstnDevelopmentChannelInviteRecordSchema } from "@/lib/types/lexicon/systems.gmstn.development.channel.invite";
import { partition } from "@/lib/utils/arrays";
-
import {
-
getCommitFromFullAtUri,
-
getRecordFromFullAtUri,
-
stringToAtUri,
-
} from "@/lib/utils/atproto";
+
import { getCommitFromFullAtUri, stringToAtUri } from "@/lib/utils/atproto";
import { addMembership } from "@/lib/utils/gmstn";
import { useMemberships } from "@/providers/authed/MembershipsProvider";
import {
···
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { Check, Mail, MailOpen, X } from "lucide-react-native";
import { FlatList, Pressable, View } from "react-native";
-
import z from "zod";
+
import { z } from "zod";
export const Invites = () => {
const { semantic } = useCurrentPalette();
const { atoms, typography } = useFacet();
const { memberships } = useMemberships();
const session = useOAuthSessionGuaranteed();
-
const { useQuery } =
-
useConstellationInvitesQuery(session);
+
const { useQuery } = useConstellationInvitesQuery(session);
const { data: invites, isLoading } = useQuery();
···
),
);
-
console.log({existingInvites, pendingInvites})
+
console.log({ existingInvites, pendingInvites });
return (
<View
···
const { queryKey: constellationInvitesQueryKey } =
useConstellationInvitesQuery(session);
const queryClient = useQueryClient();
-
-
const queryKeysToInvalidate = constellationInvitesQueryKey.concat(["membership", session.did])
+
+
const queryKeysToInvalidate = constellationInvitesQueryKey.concat([
+
"membership",
+
session.did,
+
]);
const { mutate: mutateInvites, error: inviteMutationError } = useMutation({
mutationFn: async (state: "accepted" | "rejected") => {
···
},
});
-
if(!creationResult.ok) throw new Error(`Error when submitting data. Check the inputs. ${creationResult.error}`)
+
if (!creationResult.ok)
+
throw new Error(
+
`Error when submitting data. Check the inputs. ${creationResult.error}`,
+
);
},
onSuccess: async () => {
await queryClient.invalidateQueries({
···
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<Text>{inviteAtUri.rKey}</Text>
-
<Pressable style={{ marginLeft: 2 }} onPress={() => {
-
mutateInvites("accepted")
-
}}>
+
<Pressable
+
style={{ marginLeft: 2 }}
+
onPress={() => {
+
mutateInvites("accepted");
+
}}
+
>
{({ hovered }) => (
<Check
height={16}
···
/>
)}
</Pressable>
-
<Pressable style={{ marginLeft: 2 }} onPress={() => {
-
mutateInvites("rejected")
-
}}>
+
<Pressable
+
style={{ marginLeft: 2 }}
+
onPress={() => {
+
mutateInvites("rejected");
+
}}
+
>
{({ hovered }) => (
<X
height={16}