Skip to content

Commit

Permalink
init hooks private group
Browse files Browse the repository at this point in the history
  • Loading branch information
MSghais committed Aug 21, 2024
1 parent 6e914a8 commit 2997664
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/afk_nostr_sdk/src/hooks/group/private/useAddMember.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {useMutation} from '@tanstack/react-query';
import {useNostrContext} from '../../../context/NostrContext';
import { useAuth } from '../../../store';

export type UseAddMemberOptions = {
authors?: string[];
search?: string;
};

// TODO
export const useAddMember = (options?: UseAddMemberOptions) => {
const {ndk} = useNostrContext();
const {publicKey} = useAuth()

return useMutation({
mutationKey: ['addMemberGroup', ndk],
mutationFn: async (data: {pubkey: string}) => {


},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {useMutation} from '@tanstack/react-query';
import {useNostrContext} from '../../../context/NostrContext';
import { useAuth } from '../../../store';

export type UseAddPermissionsOptions = {
authors?: string[];
search?: string;
};

// TODO
export const useAddPermissions = (options?: UseAddPermissionsOptions) => {
const {ndk} = useNostrContext();
const {publicKey} = useAuth()

return useMutation({
mutationKey: ['addPermissions', ndk],
mutationFn: async (data: {pubkey: string}) => {


},
});
};
22 changes: 22 additions & 0 deletions packages/afk_nostr_sdk/src/hooks/group/private/useCreateGroup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useMutation } from '@tanstack/react-query';
import { useNostrContext } from '../../../context/NostrContext';
import { useAuth } from '../../../store';

export type UseCreateGroupOptions = {
authors?: string[];
search?: string;
};

// TODO
export const useCreateGroup = (options?: UseCreateGroupOptions) => {
const { ndk } = useNostrContext();
const { publicKey } = useAuth()

return useMutation({
mutationKey: ['createGroup', ndk],
mutationFn: async (data: { pubkey: string }) => {


},
});
};
22 changes: 22 additions & 0 deletions packages/afk_nostr_sdk/src/hooks/group/private/useDeleteEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {useMutation} from '@tanstack/react-query';
import {useNostrContext} from '../../../context/NostrContext';
import { useAuth } from '../../../store';

export type UseDeleteEventGroupOptions = {
authors?: string[];
search?: string;
};

// TODO
export const useDeleteEvent = (options?: UseDeleteEventGroupOptions) => {
const {ndk} = useNostrContext();
const {publicKey} = useAuth()

return useMutation({
mutationKey: ['deleteEventGroup', ndk],
mutationFn: async (data: {pubkey: string}) => {


},
});
};
22 changes: 22 additions & 0 deletions packages/afk_nostr_sdk/src/hooks/group/private/useRemoveMember.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useMutation} from '@tanstack/react-query';
import {useNostrContext} from '../../../context/NostrContext';
import { useAuth } from '../../../store';

export type UseRemoveMemberOptions = {
authors?: string[];
search?: string;
};

// TODO
export const useRemoveMember = (options?: UseRemoveMemberOptions) => {
const {ndk} = useNostrContext();
const {publicKey} = useAuth()

return useMutation({
mutationKey: ['removeMemberGroup', ndk],
mutationFn: async (data: {pubkey: string}) => {


},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {useMutation} from '@tanstack/react-query';
import {useNostrContext} from '../../../context/NostrContext';
import { useAuth } from '../../../store';

export type UseRemovePermissionsOptions = {
authors?: string[];
search?: string;
};

// TODO
export const useRemovePermissions = (options?: UseRemovePermissionsOptions) => {
const {ndk} = useNostrContext();
const {publicKey} = useAuth()

return useMutation({
mutationKey: ['removePermissions', ndk],
mutationFn: async (data: {pubkey: string}) => {


},
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useMutation } from '@tanstack/react-query';
import { useNostrContext } from '../../../context/NostrContext';
import { useAuth } from '../../../store';

export type UseSendGroupMessages = {
authors?: string[];
search?: string;
};

// TODO
export const useSendGroupMessages = (options?: UseSendGroupMessages) => {
const { ndk } = useNostrContext();
const { publicKey } = useAuth()

return useMutation({
mutationKey: ['sendMessageGroup', ndk],
mutationFn: async (data: { pubkey: string }) => {


},
});
};

0 comments on commit 2997664

Please sign in to comment.