@apolitical/component-library 1.13.4 → 1.13.6

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.
@@ -29,7 +29,7 @@ interface Props {
29
29
  };
30
30
  comments: {
31
31
  /** Open comments on a post */
32
- openComments: () => void;
32
+ openComments?: () => void;
33
33
  };
34
34
  };
35
35
  /** Optional `href`s for the card to link to */
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
- /** If the thread is open or not */
4
- isOpen?: boolean;
5
3
  /** The number of posts in the thread */
6
4
  count?: number;
5
+ /** Whether to show the show replies button or not */
6
+ showRepliesButton?: boolean;
7
7
  /** The posts to render */
8
8
  children: React.ReactNode | JSX.Element | JSX.Element[];
9
9
  }
10
- declare const Thread: ({ isOpen: threadIsOpen, count, children }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ declare const Thread: ({ count, showRepliesButton, children }: Props) => import("react/jsx-runtime").JSX.Element;
11
11
  export default Thread;
@@ -7,7 +7,11 @@ interface Props {
7
7
  repliesList: IReply[] | undefined;
8
8
  isMember: boolean;
9
9
  functions: {
10
- createReply: () => Promise<void>;
10
+ createReply: ({ activityId, replyId, content, }: {
11
+ activityId?: string;
12
+ replyId?: string;
13
+ content: string;
14
+ }) => Promise<void>;
11
15
  editReply: ({ parentId, replyId, content, }: {
12
16
  parentId: string;
13
17
  replyId: string;
@@ -15,8 +19,9 @@ interface Props {
15
19
  body: string;
16
20
  };
17
21
  }) => Promise<void>;
18
- like: ({ replyId }: {
22
+ like: ({ replyId, replyParentId, }: {
19
23
  replyId: string;
24
+ replyParentId?: string;
20
25
  }) => Promise<void>;
21
26
  unlike: ({ replyId }: {
22
27
  replyId: string;
@@ -4,10 +4,14 @@ import { IUserContext } from '../../..';
4
4
  interface buildAddReplyHandlersProps {
5
5
  queryClient: QueryClient;
6
6
  queryKey: QueryKey;
7
- mutationFn: () => Promise<void>;
7
+ mutationFn: (content: {
8
+ body: string;
9
+ }) => Promise<void>;
8
10
  }
9
11
  export declare const buildAddReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildAddReplyHandlersProps) => {
10
- mutationFn: () => Promise<void>;
12
+ mutationFn: (content: {
13
+ body: string;
14
+ }) => Promise<void>;
11
15
  onMutate: () => Promise<void>;
12
16
  onError: (_err: {
13
17
  [key: string]: string;
@@ -0,0 +1 @@
1
+ export { default as RepliesFeed } from './replies-to-replies-feed';
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ import { IReply } from '../../getstream';
3
+ interface Props {
4
+ basePath: string;
5
+ parentId: string;
6
+ replyParentId: string;
7
+ activityId: string;
8
+ replyCount: number;
9
+ replies: IReply[] | undefined;
10
+ isMember: boolean;
11
+ functions: {
12
+ create: ({ activityId, replyId, content, }: {
13
+ activityId?: string;
14
+ replyId?: string;
15
+ content: string;
16
+ }) => Promise<void>;
17
+ edit: ({ parentId, replyId, content, }: {
18
+ parentId: string;
19
+ replyId: string;
20
+ content: {
21
+ body: string;
22
+ };
23
+ }) => Promise<void>;
24
+ like: ({ replyId }: {
25
+ replyId: string;
26
+ }) => Promise<void>;
27
+ unlike: ({ replyId }: {
28
+ replyId: string;
29
+ }) => Promise<void>;
30
+ join: () => Promise<void>;
31
+ leave: () => Promise<void>;
32
+ };
33
+ }
34
+ declare const RepliesToRepliesFeed: React.FC<Props>;
35
+ export default RepliesToRepliesFeed;
@@ -0,0 +1,134 @@
1
+ import { QueryClient, QueryKey } from '@tanstack/query-core';
2
+ import { IActivity, ILike, IReply } from '../../getstream';
3
+ import { IUserContext } from '../../../context';
4
+ interface buildAddReplyToReplyHandlersProps {
5
+ queryClient: QueryClient;
6
+ queryKey: QueryKey;
7
+ mutationFn: (content: {
8
+ body: string;
9
+ }) => Promise<void>;
10
+ }
11
+ export declare const buildAddReplyToReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildAddReplyToReplyHandlersProps) => {
12
+ mutationFn: (content: {
13
+ body: string;
14
+ }) => Promise<void>;
15
+ onMutate: () => Promise<void>;
16
+ onSuccess: (data: IReply) => {
17
+ previousActivity: IActivity | undefined;
18
+ };
19
+ onError: (_err: {
20
+ [key: string]: string;
21
+ }, _changedActivity: {
22
+ activityId: string;
23
+ }, context: {
24
+ previousActivity: IActivity;
25
+ }) => void;
26
+ onSettled: () => void;
27
+ };
28
+ interface buildEditReplyToReplyHandlersProps {
29
+ queryClient: QueryClient;
30
+ queryKey: QueryKey;
31
+ mutationFn: ({ parentId, replyId, content, }: {
32
+ parentId: string;
33
+ replyId: string;
34
+ content: {
35
+ body: string;
36
+ };
37
+ }) => Promise<void>;
38
+ }
39
+ export declare const buildEditReplyToReplyHanders: ({ queryClient, queryKey, mutationFn, }: buildEditReplyToReplyHandlersProps) => {
40
+ mutationFn: ({ parentId, replyId, content, }: {
41
+ parentId: string;
42
+ replyId: string;
43
+ content: {
44
+ body: string;
45
+ };
46
+ }) => Promise<void>;
47
+ onError: (_err: {
48
+ [key: string]: string;
49
+ }, _changedActivity: {
50
+ activityId: string;
51
+ }, context: {
52
+ previousActivity: IActivity;
53
+ }) => void;
54
+ onMutate: ({ replyInfo, content: { body }, }: {
55
+ replyInfo: {
56
+ parentId: string;
57
+ replySlug: string;
58
+ replyParentId: string;
59
+ };
60
+ content: {
61
+ body: string;
62
+ };
63
+ }) => Promise<{
64
+ previousActivity: IActivity;
65
+ } | undefined>;
66
+ };
67
+ interface buildLikeReplyHandlersProps {
68
+ queryClient: QueryClient;
69
+ queryKey: QueryKey;
70
+ mutationFn: ({ replyId, replyParentId, }: {
71
+ replyId: string;
72
+ replyParentId?: string;
73
+ }) => Promise<void>;
74
+ }
75
+ export declare const buildLikeReplyHandlers: ({ queryClient, queryKey, mutationFn, }: buildLikeReplyHandlersProps) => {
76
+ mutationFn: ({ replyId, replyParentId, }: {
77
+ replyId: string;
78
+ replyParentId?: string | undefined;
79
+ }) => Promise<void>;
80
+ onMutate: ({ replyId, replyParentId, }: {
81
+ replyId: string;
82
+ replyParentId?: string | undefined;
83
+ }) => Promise<{
84
+ previousActivity: IActivity | undefined;
85
+ }>;
86
+ onError: (_err: {
87
+ [key: string]: string;
88
+ }, _newActivity: {
89
+ activityId: string;
90
+ }, context: {
91
+ previousActivity: IActivity;
92
+ }) => void;
93
+ onSuccess: (data: ILike, variables: {
94
+ replyId: string;
95
+ replyParentId?: string;
96
+ }) => {
97
+ previousActivity: IActivity | undefined;
98
+ };
99
+ };
100
+ interface buildUnlikeReplyHandlersProps {
101
+ queryClient: QueryClient;
102
+ queryKey: QueryKey;
103
+ user: IUserContext | null;
104
+ mutationFn: ({ replyId, replyParentId, }: {
105
+ replyId: string;
106
+ replyParentId?: string;
107
+ }) => Promise<void>;
108
+ }
109
+ export declare const buildUnlikeReplyHandlers: ({ queryClient, queryKey, mutationFn, user, }: buildUnlikeReplyHandlersProps) => {
110
+ mutationFn: ({ replyId, replyParentId, }: {
111
+ replyId: string;
112
+ replyParentId?: string | undefined;
113
+ }) => Promise<void>;
114
+ onMutate: ({ replyId, replyParentId, }: {
115
+ replyId: string;
116
+ replyParentId?: string | undefined;
117
+ }) => Promise<{
118
+ previousActivity: IActivity | undefined;
119
+ }>;
120
+ onError: (_err: {
121
+ [key: string]: string;
122
+ }, _newActivity: {
123
+ activityId: string;
124
+ }, context: {
125
+ previousActivity: IActivity;
126
+ }) => void;
127
+ onSuccess: (_data: ILike, variables: {
128
+ replyId: string;
129
+ replyParentId?: string;
130
+ }) => {
131
+ previousActivity: IActivity | undefined;
132
+ };
133
+ };
134
+ export {};