@amityco/react-native-social-uikit 4.0.0-RC19 → 4.0.0-RC20

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.
Files changed (46) hide show
  1. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
  2. package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  3. package/lib/commonjs/v4/assets/icons/lock.js +6 -4
  4. package/lib/commonjs/v4/assets/icons/lock.js.map +1 -1
  5. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js +16 -3
  6. package/lib/commonjs/v4/component/Social/CommentList/CommentList.js.map +1 -1
  7. package/lib/commonjs/v4/component/Social/CommentList/styles.js +12 -0
  8. package/lib/commonjs/v4/component/Social/CommentList/styles.js.map +1 -1
  9. package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
  10. package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
  11. package/lib/commonjs/v4/enum/roomStatus.js +2 -1
  12. package/lib/commonjs/v4/enum/roomStatus.js.map +1 -1
  13. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
  14. package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
  15. package/lib/module/v4/assets/icons/lock.js +6 -4
  16. package/lib/module/v4/assets/icons/lock.js.map +1 -1
  17. package/lib/module/v4/component/Social/CommentList/CommentList.js +16 -3
  18. package/lib/module/v4/component/Social/CommentList/CommentList.js.map +1 -1
  19. package/lib/module/v4/component/Social/CommentList/styles.js +12 -0
  20. package/lib/module/v4/component/Social/CommentList/styles.js.map +1 -1
  21. package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
  22. package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
  23. package/lib/module/v4/enum/roomStatus.js +2 -1
  24. package/lib/module/v4/enum/roomStatus.js.map +1 -1
  25. package/lib/typescript/src/components/PollSection/usePoll.d.ts +1 -1
  26. package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
  27. package/lib/typescript/src/v4/assets/icons/lock.d.ts +1 -1
  28. package/lib/typescript/src/v4/assets/icons/lock.d.ts.map +1 -1
  29. package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts +1 -0
  30. package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts.map +1 -1
  31. package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts +12 -0
  32. package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts.map +1 -1
  33. package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts +2 -1
  34. package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  35. package/lib/typescript/src/v4/enum/roomStatus.d.ts +1 -0
  36. package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +1 -1
  37. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +1 -39
  38. package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
  39. package/lib/typescript/src/v4/hook/usePoll.d.ts +1 -1
  40. package/package.json +3 -3
  41. package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +1 -0
  42. package/src/v4/assets/icons/lock.tsx +7 -6
  43. package/src/v4/component/Social/CommentList/CommentList.tsx +44 -27
  44. package/src/v4/component/Social/CommentList/styles.ts +12 -0
  45. package/src/v4/component/Social/CommentListItem/CommentListItem.tsx +3 -1
  46. package/src/v4/enum/roomStatus.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/react-native-social-uikit",
3
- "version": "4.0.0-RC19",
3
+ "version": "4.0.0-RC20",
4
4
  "description": "Social UIKit",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -57,7 +57,7 @@
57
57
  "registry": "https://registry.npmjs.org/"
58
58
  },
59
59
  "devDependencies": {
60
- "@amityco/ts-sdk-react-native": "^7.15.1",
60
+ "@amityco/ts-sdk-react-native": "^7.17.0",
61
61
  "@babel/plugin-transform-export-namespace-from": "^7.27.1",
62
62
  "@commitlint/config-conventional": "^17.0.2",
63
63
  "@evilmartians/lefthook": "^1.2.2",
@@ -116,7 +116,7 @@
116
116
  "@types/react": "18.2.37"
117
117
  },
118
118
  "peerDependencies": {
119
- "@amityco/ts-sdk-react-native": "^7.15.1",
119
+ "@amityco/ts-sdk-react-native": "^7.17.0",
120
120
  "@livekit/react-native": "^2.9.6",
121
121
  "@livekit/react-native-webrtc": "^137.0.2",
122
122
  "@react-native-async-storage/async-storage": "^1.19.3",
@@ -595,6 +595,7 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
595
595
  <CommentList
596
596
  postId={currentStory?.storyId}
597
597
  postType="story"
598
+ disabledComment={!communityData?.allowCommentInStory}
598
599
  disabledInteraction={!communityData?.isJoined}
599
600
  onNavigate={onClose}
600
601
  />
@@ -1,9 +1,10 @@
1
- export const icon = (
2
- color: string = '#292B32'
3
- ) => `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
4
- <path d="M10 14.1562C9.625 14.1562 9.34375 13.875 9.34375 13.5V12C9.34375 11.6484 9.625 11.3438 10 11.3438C10.3516 11.3438 10.6562 11.6484 10.6562 12V13.5C10.6562 13.875 10.3516 14.1562 10 14.1562ZM15.25 10.125V15.375C15.25 16.0078 14.7344 16.5 14.125 16.5H5.875C5.24219 16.5 4.75 16.0078 4.75 15.375V10.125C4.75 9.51562 5.24219 9 5.875 9H6.625V7.875C6.625 6.02344 8.125 4.5 10 4.5C11.875 4.52344 13.375 6.04688 13.375 7.92188V9H14.125C14.7344 9 15.25 9.51562 15.25 10.125ZM7.75 9H12.25V7.875C12.25 6.65625 11.2188 5.625 10 5.625C8.75781 5.625 7.75 6.65625 7.75 7.875V9ZM14.125 10.125H5.875V15.375H14.125V10.125Z" fill="${color}"/>
5
- </svg>
6
-
1
+ export const icon =
2
+ () => `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20">
3
+ <path
4
+ fill="currentColor"
5
+ d="M15.5 8c.813 0 1.5.688 1.5 1.5v7a1.5 1.5 0 01-1.5 1.5h-11A1.48 1.48 0 013 16.5v-7A1.5 1.5 0 014.5 8h1V6.5C5.5 4.031 7.5 2 10 2c2.5.031 4.5 2.063 4.5 4.563V8h1zM7 6.5V8h6V6.5c0-1.625-1.375-3-3-3-1.656 0-3 1.375-3 3zm8.5 10v-7h-11v7h11z"
6
+ ></path>
7
+ </svg>
7
8
  `;
8
9
 
9
10
  export default icon;
@@ -29,6 +29,8 @@ import useMention from '../../../hook/useMention';
29
29
  import { replaceTriggerValues } from 'react-native-controlled-mentions';
30
30
  import MyAvatar from '../../MyAvatar/MyAvatar';
31
31
  import { useToast } from '../../../../v4/stores/slices/toast';
32
+ import { Typography } from '../../Typography/Typography';
33
+ import { lock } from '../../../../v4/assets/icons';
32
34
 
33
35
  interface ICommentListProp {
34
36
  postId: string;
@@ -36,6 +38,7 @@ interface ICommentListProp {
36
38
  disabledInteraction?: boolean;
37
39
  onNavigate?: () => void;
38
40
  withAvatar?: boolean;
41
+ disabledComment?: boolean;
39
42
  }
40
43
 
41
44
  interface IComment {
@@ -63,6 +66,7 @@ const CommentList: FC<ICommentListProp> = ({
63
66
  disabledInteraction,
64
67
  onNavigate,
65
68
  withAvatar,
69
+ disabledComment,
66
70
  }) => {
67
71
  const styles = useStyles();
68
72
  const theme = useTheme() as MyMD3Theme;
@@ -247,35 +251,47 @@ const CommentList: FC<ICommentListProp> = ({
247
251
  </TouchableOpacity>
248
252
  </View>
249
253
  )}
250
- {!disabledInteraction && (
251
- <View style={styles.inputWrap}>
252
- {withAvatar && <MyAvatar />}
253
- <View style={styles.inputContainer}>
254
- {renderInput({
255
- multiline: true,
256
- style: styles.textInput,
257
- placeholder: 'Say something nice...',
258
- placeholderTextColor: theme.colors.baseShade3,
259
- })}
254
+ {!disabledInteraction &&
255
+ (disabledComment ? (
256
+ <View style={styles.disabledCommentWrap}>
257
+ <SvgXml
258
+ width={20}
259
+ height={20}
260
+ xml={lock()}
261
+ color={theme.colors.baseShade2}
262
+ />
263
+ <Typography.Body style={styles.disabledCommentText}>
264
+ Comments are disabled for this story
265
+ </Typography.Body>
260
266
  </View>
261
-
262
- <TouchableOpacity
263
- disabled={inputMessage.length > 0 ? false : true}
264
- onPress={handleSend}
265
- style={styles.postBtn}
266
- >
267
- <Text
268
- style={
269
- inputMessage.length > 0
270
- ? styles.postBtnText
271
- : styles.postDisabledBtn
272
- }
267
+ ) : (
268
+ <View style={styles.inputWrap}>
269
+ {withAvatar && <MyAvatar />}
270
+ <View style={styles.inputContainer}>
271
+ {renderInput({
272
+ multiline: true,
273
+ style: styles.textInput,
274
+ placeholder: 'Say something nice...',
275
+ placeholderTextColor: theme.colors.baseShade3,
276
+ })}
277
+ </View>
278
+ <TouchableOpacity
279
+ disabled={inputMessage.length > 0 ? false : true}
280
+ onPress={handleSend}
281
+ style={styles.postBtn}
273
282
  >
274
- Post
275
- </Text>
276
- </TouchableOpacity>
277
- </View>
278
- )}
283
+ <Text
284
+ style={
285
+ inputMessage.length > 0
286
+ ? styles.postBtnText
287
+ : styles.postDisabledBtn
288
+ }
289
+ >
290
+ Post
291
+ </Text>
292
+ </TouchableOpacity>
293
+ </View>
294
+ ))}
279
295
  </KeyboardAvoidingView>
280
296
  );
281
297
  };
@@ -295,6 +311,7 @@ const CommentList: FC<ICommentListProp> = ({
295
311
  commentDetail={item}
296
312
  onClickReply={handleClickReply}
297
313
  postType={postType}
314
+ disabledComment={disabledComment}
298
315
  disabledInteraction={disabledInteraction}
299
316
  onNavigate={onNavigate}
300
317
  />
@@ -123,6 +123,18 @@ export const useStyles = () => {
123
123
  commentListFooter: {
124
124
  width: width,
125
125
  },
126
+ disabledCommentWrap: {
127
+ flexDirection: 'row',
128
+ alignItems: 'center',
129
+ justifyContent: 'center',
130
+ padding: 16,
131
+ gap: 8,
132
+ borderTopWidth: 1,
133
+ borderTopColor: theme.colors.baseShade4,
134
+ },
135
+ disabledCommentText: {
136
+ color: theme.colors.baseShade2,
137
+ },
126
138
  });
127
139
 
128
140
  return styles;
@@ -69,6 +69,7 @@ export interface ICommentList {
69
69
  onClickReply: (user: UserInterface, commentId: string) => void;
70
70
  postType: Amity.CommentReferenceType;
71
71
  disabledInteraction?: boolean;
72
+ disabledComment?: boolean;
72
73
  onNavigate?: () => void;
73
74
  }
74
75
 
@@ -79,6 +80,7 @@ const CommentListItem = ({
79
80
  postType,
80
81
  disabledInteraction,
81
82
  onNavigate,
83
+ disabledComment,
82
84
  }: ICommentList) => {
83
85
  const theme = useTheme() as MyMD3Theme;
84
86
  const styles = useStyles();
@@ -345,7 +347,7 @@ const CommentListItem = ({
345
347
  </Typography.CaptionBold>
346
348
  </TouchableOpacity>
347
349
  <TouchableOpacity
348
- onPress={onHandleReply}
350
+ onPress={disabledComment ? undefined : onHandleReply}
349
351
  style={styles.likeBtn}
350
352
  >
351
353
  <Typography.CaptionBold style={styles.btnText}>
@@ -5,4 +5,5 @@ export const RoomStatus = {
5
5
  ended: 'ended',
6
6
  waitingReconnect: 'waitingReconnect',
7
7
  terminated: 'terminated',
8
+ error: 'error',
8
9
  } as const satisfies Record<Amity.RoomStatus, Amity.RoomStatus>;