@apolitical/component-library 1.14.6 → 1.14.7-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,9 @@ interface Props {
14
14
  body: string;
15
15
  };
16
16
  }) => Promise<void>;
17
+ remove: ({ activityId }: {
18
+ activityId: string;
19
+ }) => Promise<void>;
17
20
  like: ({ activityId }: {
18
21
  activityId: string;
19
22
  }) => Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { QueryClient, QueryKey } from '@tanstack/query-core';
2
2
  import { IUserContext } from '../../..';
3
+ import { IActivity } from '../../getstream';
3
4
  export interface buildAddActivityHandlersProps {
4
5
  queryClient: QueryClient;
5
6
  queryKey: QueryKey;
@@ -19,6 +20,37 @@ export interface buildEditActivityHandlersProps {
19
20
  }) => Promise<void>;
20
21
  }
21
22
  export declare const buildEditActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildEditActivityHandlersProps) => object;
23
+ interface buildRemoveActivityHandlersProps {
24
+ queryClient: QueryClient;
25
+ queryKey: QueryKey;
26
+ mutationFn: ({ activityId }: {
27
+ activityId: string;
28
+ }) => Promise<void>;
29
+ }
30
+ export declare const buildRemoveActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildRemoveActivityHandlersProps) => {
31
+ mutationFn: ({ activityId }: {
32
+ activityId: string;
33
+ }) => Promise<void>;
34
+ onMutate: ({ activityId }: {
35
+ activityId: string;
36
+ }) => Promise<{
37
+ previousActivities: IActivity[] | undefined;
38
+ }>;
39
+ onError: (_err: {
40
+ [key: string]: string;
41
+ }, _newActivity: {
42
+ activityId: string;
43
+ }, context: {
44
+ previousActivities: IActivity[];
45
+ }) => void;
46
+ onSettled: (_newActivity: {
47
+ activityId: string;
48
+ }, _error: {
49
+ [key: string]: string;
50
+ }, variables: {
51
+ activityId: string;
52
+ }) => void;
53
+ };
22
54
  interface buildLikeActivityHandlersProps {
23
55
  queryClient: QueryClient;
24
56
  queryKey: QueryKey;
@@ -7,18 +7,21 @@ interface Props {
7
7
  repliesList: IReply[] | undefined;
8
8
  isMember: boolean;
9
9
  functions: {
10
- createReply: ({ activityId, replyId, content, }: {
10
+ create: ({ activityId, replyId, content, }: {
11
11
  activityId?: string;
12
12
  replyId?: string;
13
13
  content: string;
14
14
  }) => Promise<void>;
15
- editReply: ({ parentId, replyId, content, }: {
15
+ edit: ({ parentId, replyId, content, }: {
16
16
  parentId: string;
17
17
  replyId: string;
18
18
  content: {
19
19
  body: string;
20
20
  };
21
21
  }) => Promise<void>;
22
+ remove: ({ replyId }: {
23
+ replyId: string;
24
+ }) => Promise<void>;
22
25
  like: ({ replyId, replyParentId, }: {
23
26
  replyId: string;
24
27
  replyParentId?: string;
@@ -63,6 +63,30 @@ export declare const buildEditReplyHanders: ({ queryClient, queryKey, mutationFn
63
63
  previousActivity: IActivity;
64
64
  }) => void;
65
65
  };
66
+ interface buildRemoveReplyHandlersProps {
67
+ queryClient: QueryClient;
68
+ queryKey: QueryKey;
69
+ mutationFn: ({ replyId }: {
70
+ replyId: string;
71
+ }) => Promise<void>;
72
+ }
73
+ export declare const buildRemoveReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildRemoveReplyHandlersProps) => {
74
+ mutationFn: ({ replyId }: {
75
+ replyId: string;
76
+ }) => Promise<void>;
77
+ onMutate: ({ replyId }: {
78
+ replyId: string;
79
+ }) => Promise<{
80
+ previousActivity: IActivity;
81
+ } | undefined>;
82
+ onError: (_err: {
83
+ [key: string]: string;
84
+ }, _newActivity: {
85
+ activityId: string;
86
+ }, context: {
87
+ previousActivity: IActivity;
88
+ }) => void;
89
+ };
66
90
  interface buildLikeReplyHandlersProps {
67
91
  queryClient: QueryClient;
68
92
  queryKey: QueryKey;
@@ -21,6 +21,9 @@ interface Props {
21
21
  body: string;
22
22
  };
23
23
  }) => Promise<void>;
24
+ remove: ({ replyId }: {
25
+ replyId: string;
26
+ }) => Promise<void>;
24
27
  like: ({ replyId }: {
25
28
  replyId: string;
26
29
  }) => Promise<void>;
@@ -64,6 +64,33 @@ export declare const buildEditReplyToReplyHanders: ({ queryClient, queryKey, mut
64
64
  previousActivity: IActivity;
65
65
  } | undefined>;
66
66
  };
67
+ interface buildRemoveReplyToReplyHandlersProps {
68
+ queryClient: QueryClient;
69
+ queryKey: QueryKey;
70
+ mutationFn: ({ replyId, replyParentId, }: {
71
+ replyId: string;
72
+ replyParentId?: string;
73
+ }) => Promise<void>;
74
+ }
75
+ export declare const buildRemoveReplyToReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildRemoveReplyToReplyHandlersProps) => {
76
+ mutationFn: ({ replyId, replyParentId, }: {
77
+ replyId: string;
78
+ replyParentId?: string | undefined;
79
+ }) => Promise<void>;
80
+ onError: (_err: {
81
+ [key: string]: string;
82
+ }, _changedActivity: {
83
+ activityId: string;
84
+ }, context: {
85
+ previousActivity: IActivity;
86
+ }) => void;
87
+ onMutate: ({ replyId, replyParentId, }: {
88
+ replyId: string;
89
+ replyParentId: string;
90
+ }) => Promise<{
91
+ previousActivity: IActivity;
92
+ } | undefined>;
93
+ };
67
94
  interface buildLikeReplyHandlersProps {
68
95
  queryClient: QueryClient;
69
96
  queryKey: QueryKey;
@@ -15,6 +15,9 @@ interface Props {
15
15
  body: string;
16
16
  };
17
17
  }) => Promise<void>;
18
+ removeActivity: ({ activityId }: {
19
+ activityId: string;
20
+ }) => Promise<void>;
18
21
  likeActivity: ({ activityId }: {
19
22
  activityId: string;
20
23
  }) => Promise<void>;
@@ -38,6 +41,9 @@ interface Props {
38
41
  body: string;
39
42
  };
40
43
  }) => Promise<void>;
44
+ removeReply: ({ replyId }: {
45
+ replyId: string;
46
+ }) => Promise<void>;
41
47
  };
42
48
  }
43
49
  declare const ActivitySection: React.FC<Props>;
@@ -13,6 +13,20 @@ interface buildEditActivityHandlersProps {
13
13
  }) => Promise<void>;
14
14
  }
15
15
  export declare const buildEditActivityHandlers: ({ queryClient, queryKey, mutationFn, }: buildEditActivityHandlersProps) => object;
16
+ interface buildRemoveActivityHandlersProps {
17
+ queryClient: QueryClient;
18
+ queryKey: QueryKey;
19
+ redirectUrl: string;
20
+ mutationFn: ({ activityId }: {
21
+ activityId: string;
22
+ }) => Promise<void>;
23
+ }
24
+ export declare const buildRemoveActivityHandlers: ({ queryClient, queryKey, redirectUrl, mutationFn, }: buildRemoveActivityHandlersProps) => {
25
+ mutationFn: ({ activityId }: {
26
+ activityId: string;
27
+ }) => Promise<void>;
28
+ onSuccess: () => void;
29
+ };
16
30
  interface buildLikeActivityHandlersProps {
17
31
  queryClient: QueryClient;
18
32
  queryKey: QueryKey;