@amityco/react-native-social-uikit 4.0.1-fd53cf63.0 → 4.0.2-232eeace.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.
Files changed (144) hide show
  1. package/lib/commonjs/core/hooks/useUpload.js +6 -7
  2. package/lib/commonjs/core/hooks/useUpload.js.map +1 -1
  3. package/lib/commonjs/core/legacy/file.js +4 -19
  4. package/lib/commonjs/core/legacy/file.js.map +1 -1
  5. package/lib/commonjs/core/providers/AmityUIKitProvider.js +10 -3
  6. package/lib/commonjs/core/providers/AmityUIKitProvider.js.map +1 -1
  7. package/lib/commonjs/core/providers/AuthProvider.js +6 -2
  8. package/lib/commonjs/core/providers/AuthProvider.js.map +1 -1
  9. package/lib/commonjs/core/utils/fileUpload.js +59 -0
  10. package/lib/commonjs/core/utils/fileUpload.js.map +1 -0
  11. package/lib/commonjs/social/components/PollContent/PollOption.js +12 -12
  12. package/lib/commonjs/social/components/PollContent/PollOption.js.map +1 -1
  13. package/lib/commonjs/social/components/PostMenu/index.js +9 -2
  14. package/lib/commonjs/social/components/PostMenu/index.js.map +1 -1
  15. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js +20 -13
  16. package/lib/commonjs/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  17. package/lib/commonjs/social/components/Social/CommentListItem/styles.js +3 -2
  18. package/lib/commonjs/social/components/Social/CommentListItem/styles.js.map +1 -1
  19. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js +8 -4
  20. package/lib/commonjs/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  21. package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
  22. package/lib/commonjs/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  23. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +8 -4
  24. package/lib/commonjs/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  25. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js +11 -5
  26. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  27. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  28. package/lib/commonjs/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  29. package/lib/commonjs/social/features/livestream/Player/Player.js +9 -6
  30. package/lib/commonjs/social/features/livestream/Player/Player.js.map +1 -1
  31. package/lib/commonjs/social/features/post/components/Content/Content.js +1 -5
  32. package/lib/commonjs/social/features/post/components/Content/Content.js.map +1 -1
  33. package/lib/commonjs/social/features/story/Draft/Draft.js +2 -5
  34. package/lib/commonjs/social/features/story/Draft/Draft.js.map +1 -1
  35. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js +1 -1
  36. package/lib/commonjs/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  37. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js +22 -18
  38. package/lib/commonjs/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  39. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js +2 -0
  40. package/lib/commonjs/social/features/user/Profile/components/Header/styles.js.map +1 -1
  41. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js +15 -4
  42. package/lib/commonjs/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  43. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js +9 -2
  44. package/lib/commonjs/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  45. package/lib/commonjs/social/screens/SocialHomePage/index.js +13 -3
  46. package/lib/commonjs/social/screens/SocialHomePage/index.js.map +1 -1
  47. package/lib/module/core/hooks/useUpload.js +7 -8
  48. package/lib/module/core/hooks/useUpload.js.map +1 -1
  49. package/lib/module/core/legacy/file.js +4 -19
  50. package/lib/module/core/legacy/file.js.map +1 -1
  51. package/lib/module/core/providers/AmityUIKitProvider.js +10 -3
  52. package/lib/module/core/providers/AmityUIKitProvider.js.map +1 -1
  53. package/lib/module/core/providers/AuthProvider.js +6 -2
  54. package/lib/module/core/providers/AuthProvider.js.map +1 -1
  55. package/lib/module/core/utils/fileUpload.js +54 -0
  56. package/lib/module/core/utils/fileUpload.js.map +1 -0
  57. package/lib/module/social/components/PollContent/PollOption.js +12 -12
  58. package/lib/module/social/components/PollContent/PollOption.js.map +1 -1
  59. package/lib/module/social/components/PostMenu/index.js +10 -3
  60. package/lib/module/social/components/PostMenu/index.js.map +1 -1
  61. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js +20 -13
  62. package/lib/module/social/components/Social/CommentListItem/CommentListItem.js.map +1 -1
  63. package/lib/module/social/components/Social/CommentListItem/styles.js +3 -2
  64. package/lib/module/social/components/Social/CommentListItem/styles.js.map +1 -1
  65. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js +8 -4
  66. package/lib/module/social/components/legacy/Social/ReplyCommentList/index.js.map +1 -1
  67. package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js +3 -1
  68. package/lib/module/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.js.map +1 -1
  69. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js +8 -4
  70. package/lib/module/social/features/comment/components/PostComment/CommentListItem/CommentListItem.js.map +1 -1
  71. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js +11 -5
  72. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/index.js.map +1 -1
  73. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js +8 -0
  74. package/lib/module/social/features/comment/components/PostComment/ReplyCommentList/styles.js.map +1 -1
  75. package/lib/module/social/features/livestream/Player/Player.js +9 -6
  76. package/lib/module/social/features/livestream/Player/Player.js.map +1 -1
  77. package/lib/module/social/features/post/components/Content/Content.js +1 -5
  78. package/lib/module/social/features/post/components/Content/Content.js.map +1 -1
  79. package/lib/module/social/features/story/Draft/Draft.js +2 -5
  80. package/lib/module/social/features/story/Draft/Draft.js.map +1 -1
  81. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js +1 -1
  82. package/lib/module/social/features/story/View/components/AmityViewStoryItem.js.map +1 -1
  83. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js +22 -18
  84. package/lib/module/social/features/user/Profile/components/Header/hooks/useHeader.js.map +1 -1
  85. package/lib/module/social/features/user/Profile/components/Header/styles.js +2 -0
  86. package/lib/module/social/features/user/Profile/components/Header/styles.js.map +1 -1
  87. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js +16 -4
  88. package/lib/module/social/features/user/Profile/elements/Menu/hooks/useMenu.js.map +1 -1
  89. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js +10 -3
  90. package/lib/module/social/screens/CommunityProfile/components/Header/Header.js.map +1 -1
  91. package/lib/module/social/screens/SocialHomePage/index.js +14 -4
  92. package/lib/module/social/screens/SocialHomePage/index.js.map +1 -1
  93. package/lib/typescript/core/hooks/useUpload.d.ts.map +1 -1
  94. package/lib/typescript/core/legacy/file.d.ts.map +1 -1
  95. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts +5 -1
  96. package/lib/typescript/core/providers/AmityUIKitProvider.d.ts.map +1 -1
  97. package/lib/typescript/core/providers/AuthProvider.d.ts.map +1 -1
  98. package/lib/typescript/core/utils/fileUpload.d.ts +39 -0
  99. package/lib/typescript/core/utils/fileUpload.d.ts.map +1 -0
  100. package/lib/typescript/social/components/PollContent/PollOption.d.ts.map +1 -1
  101. package/lib/typescript/social/components/PostMenu/index.d.ts.map +1 -1
  102. package/lib/typescript/social/components/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
  103. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts +2 -1
  104. package/lib/typescript/social/components/Social/CommentListItem/styles.d.ts.map +1 -1
  105. package/lib/typescript/social/components/legacy/Social/ReplyCommentList/index.d.ts.map +1 -1
  106. package/lib/typescript/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.d.ts.map +1 -1
  107. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/index.d.ts.map +1 -1
  108. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts +8 -0
  109. package/lib/typescript/social/features/comment/components/PostComment/ReplyCommentList/styles.d.ts.map +1 -1
  110. package/lib/typescript/social/features/livestream/Player/Player.d.ts.map +1 -1
  111. package/lib/typescript/social/features/post/components/Content/Content.d.ts.map +1 -1
  112. package/lib/typescript/social/features/story/Draft/Draft.d.ts.map +1 -1
  113. package/lib/typescript/social/features/story/View/components/AmityViewStoryItem.d.ts.map +1 -1
  114. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts +2 -0
  115. package/lib/typescript/social/features/user/Profile/components/Header/hooks/useHeader.d.ts.map +1 -1
  116. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts +2 -0
  117. package/lib/typescript/social/features/user/Profile/components/Header/styles.d.ts.map +1 -1
  118. package/lib/typescript/social/features/user/Profile/elements/Menu/hooks/useMenu.d.ts.map +1 -1
  119. package/lib/typescript/social/screens/CommunityProfile/components/Header/Header.d.ts.map +1 -1
  120. package/lib/typescript/social/screens/SocialHomePage/index.d.ts.map +1 -1
  121. package/package.json +1 -1
  122. package/src/core/hooks/useUpload.ts +6 -8
  123. package/src/core/legacy/file.tsx +16 -22
  124. package/src/core/providers/AmityUIKitProvider.tsx +26 -2
  125. package/src/core/providers/AuthProvider.tsx +3 -4
  126. package/src/core/utils/fileUpload.ts +60 -0
  127. package/src/social/components/PollContent/PollOption.tsx +13 -19
  128. package/src/social/components/PostMenu/index.tsx +6 -3
  129. package/src/social/components/Social/CommentListItem/CommentListItem.tsx +63 -57
  130. package/src/social/components/Social/CommentListItem/styles.ts +2 -1
  131. package/src/social/components/legacy/Social/ReplyCommentList/index.tsx +14 -11
  132. package/src/social/elements/CommunityCreatePostButton/CommunityCreatePostButton.tsx +7 -1
  133. package/src/social/features/comment/components/PostComment/CommentListItem/CommentListItem.tsx +14 -14
  134. package/src/social/features/comment/components/PostComment/ReplyCommentList/index.tsx +15 -11
  135. package/src/social/features/comment/components/PostComment/ReplyCommentList/styles.ts +8 -0
  136. package/src/social/features/livestream/Player/Player.tsx +10 -7
  137. package/src/social/features/post/components/Content/Content.tsx +4 -7
  138. package/src/social/features/story/Draft/Draft.tsx +9 -5
  139. package/src/social/features/story/View/components/AmityViewStoryItem.tsx +1 -0
  140. package/src/social/features/user/Profile/components/Header/hooks/useHeader.ts +22 -18
  141. package/src/social/features/user/Profile/components/Header/styles.ts +2 -0
  142. package/src/social/features/user/Profile/elements/Menu/hooks/useMenu.ts +16 -4
  143. package/src/social/screens/CommunityProfile/components/Header/Header.tsx +8 -2
  144. package/src/social/screens/SocialHomePage/index.tsx +26 -11
@@ -44,7 +44,7 @@ import ReplyCommentList from '../../legacy/Social/ReplyCommentList';
44
44
  import AmityReactionListComponent from '../../../features/reaction/components/List';
45
45
  import { CommentRepository } from '@amityco/ts-sdk-react-native';
46
46
  import { useTimeDifference } from '../../../hooks/useTimeDifference';
47
- import { useGlobalBehavior } from '../../../hooks/useGlobalBehavior';
47
+ import { useInteractionBehavior } from '../../../hooks/useInteractionBehavior';
48
48
  import { LinkPreview } from '../../PreviewLink';
49
49
  import { Typography } from '../../../../core/components/Typography/Typography';
50
50
  import { pen, report, trash, unreport } from '../../../../core/assets/icons';
@@ -291,13 +291,19 @@ const CommentListItem = ({
291
291
  onClickReply && onClickReply(user, commentId);
292
292
  };
293
293
 
294
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
294
+ const { handleInteraction } = useInteractionBehavior();
295
295
 
296
296
  const onPressLike = () =>
297
- handleGlobalBehavior({ defaultBehavior: addReactionToComment });
297
+ handleInteraction({
298
+ defaultBehavior: addReactionToComment,
299
+ isJoined: !disabledInteraction,
300
+ });
298
301
 
299
302
  const onPressReply = () =>
300
- handleGlobalBehavior({ defaultBehavior: onHandleReply });
303
+ handleInteraction({
304
+ defaultBehavior: onHandleReply,
305
+ isJoined: !disabledInteraction,
306
+ });
301
307
 
302
308
  const onPressCommentReaction = () => {
303
309
  setIsReactionListVisible(true);
@@ -343,59 +349,55 @@ const CommentListItem = ({
343
349
  />
344
350
  )}
345
351
  </View>
346
- {!disabledInteraction && (
347
- <View style={styles.actionSection}>
348
- <View style={styles.rowContainer}>
349
- <View style={styles.timeRow}>
352
+ <View style={styles.actionSection}>
353
+ <View style={styles.rowContainer}>
354
+ <View style={styles.timeRow}>
355
+ <Typography.Caption style={styles.headerTextTime}>
356
+ {timeDifference}
357
+ </Typography.Caption>
358
+ {(editedAt !== createdAt || isEditComment) && (
350
359
  <Typography.Caption style={styles.headerTextTime}>
351
- {timeDifference}
360
+ {' '}
361
+ (edited)
352
362
  </Typography.Caption>
353
- {(editedAt !== createdAt || isEditComment) && (
354
- <Typography.Caption style={styles.headerTextTime}>
355
- {' '}
356
- (edited)
357
- </Typography.Caption>
358
- )}
359
- </View>
360
- <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
361
- <Typography.CaptionBold
362
- style={isLike ? styles.likedText : styles.btnText}
363
- >
364
- Like
365
- </Typography.CaptionBold>
366
- </TouchableOpacity>
367
- <TouchableOpacity
368
- onPress={disabledComment ? undefined : onPressReply}
369
- style={styles.likeBtn}
370
- >
371
- <Typography.CaptionBold style={styles.btnText}>
372
- Reply
373
- </Typography.CaptionBold>
374
- </TouchableOpacity>
375
- {!isVisitorOrBot && (
376
- <TouchableOpacity onPress={openModal}>
377
- <SvgXml
378
- xml={threeDots(theme.colors.baseShade2)}
379
- width="20"
380
- height="20"
381
- />
382
- </TouchableOpacity>
383
363
  )}
384
364
  </View>
385
-
386
- {likeReaction > 0 && (
387
- <TouchableOpacity
388
- onPress={onPressCommentReaction}
389
- style={styles.likeBtn}
365
+ <TouchableOpacity onPress={onPressLike} style={styles.likeBtn}>
366
+ <Typography.CaptionBold
367
+ style={isLike ? styles.likedText : styles.btnText}
390
368
  >
391
- <Typography.Caption style={styles.btnText}>
392
- {likeReaction}
393
- </Typography.Caption>
394
- <SvgXml xml={likeCircle} width="20" height="20" />
395
- </TouchableOpacity>
396
- )}
369
+ Like
370
+ </Typography.CaptionBold>
371
+ </TouchableOpacity>
372
+ <TouchableOpacity
373
+ onPress={disabledComment ? undefined : onPressReply}
374
+ style={styles.likeBtn}
375
+ >
376
+ <Typography.CaptionBold style={styles.btnText}>
377
+ Reply
378
+ </Typography.CaptionBold>
379
+ </TouchableOpacity>
380
+ <TouchableOpacity onPress={openModal}>
381
+ <SvgXml
382
+ xml={threeDots(theme.colors.baseShade2)}
383
+ width="20"
384
+ height="20"
385
+ />
386
+ </TouchableOpacity>
397
387
  </View>
398
- )}
388
+
389
+ {likeReaction > 0 && (
390
+ <TouchableOpacity
391
+ onPress={onPressCommentReaction}
392
+ style={styles.likeBtn}
393
+ >
394
+ <Typography.Caption style={styles.btnText}>
395
+ {likeReaction}
396
+ </Typography.Caption>
397
+ <SvgXml xml={likeCircle} width="20" height="20" />
398
+ </TouchableOpacity>
399
+ )}
400
+ </View>
399
401
 
400
402
  {previewReplyCommentList.length > 0 && !isOpenReply && (
401
403
  <ReplyCommentList
@@ -431,10 +433,10 @@ const CommentListItem = ({
431
433
  style={styles.viewMoreReplyBtn}
432
434
  >
433
435
  <SvgXml xml={expandIcon} />
434
- <Typography.CaptionBold style={styles.viewMoreText}>
436
+ <Text style={styles.viewMoreText}>
435
437
  View {childrenNumber}{' '}
436
438
  {childrenNumber === 1 ? 'reply' : 'replies'}
437
- </Typography.CaptionBold>
439
+ </Text>
438
440
  </TouchableOpacity>
439
441
  )}
440
442
 
@@ -444,9 +446,7 @@ const CommentListItem = ({
444
446
  style={styles.viewMoreReplyBtn}
445
447
  >
446
448
  <SvgXml xml={expandIcon} />
447
- <Typography.CaptionBold style={styles.viewMoreText}>
448
- View more replies
449
- </Typography.CaptionBold>
449
+ <Text style={styles.viewMoreText}>View more replies</Text>
450
450
  </TouchableOpacity>
451
451
  )}
452
452
  </View>
@@ -500,7 +500,13 @@ const CommentListItem = ({
500
500
  </View>
501
501
  ) : (
502
502
  <TouchableOpacity
503
- onPress={reportCommentObject}
503
+ onPress={() => {
504
+ closeModal();
505
+ handleInteraction({
506
+ defaultBehavior: reportCommentObject,
507
+ allowNonMember: true,
508
+ });
509
+ }}
504
510
  style={styles.modalRow}
505
511
  >
506
512
  <SvgXml
@@ -71,12 +71,13 @@ export const useStyles = () => {
71
71
  paddingHorizontal: 8,
72
72
  marginTop: 12,
73
73
  flexDirection: 'row',
74
- justifyContent: 'center',
75
74
  alignItems: 'center',
76
75
  alignSelf: 'flex-start',
77
76
  },
78
77
  viewMoreText: {
78
+ fontWeight: '600',
79
79
  color: theme.colors.secondaryShade1,
80
+ paddingHorizontal: 4,
80
81
  },
81
82
  commentText: {
82
83
  fontSize: 15,
@@ -157,7 +157,7 @@ export default function ReplyCommentList({
157
157
  }
158
158
  };
159
159
 
160
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
160
+ const { handleGlobalBehavior } = useGlobalBehavior();
161
161
 
162
162
  const onPressLike = () =>
163
163
  handleGlobalBehavior({ defaultBehavior: addReactionToComment });
@@ -283,15 +283,13 @@ export default function ReplyCommentList({
283
283
  </Typography.CaptionBold>
284
284
  </TouchableOpacity>
285
285
 
286
- {!isVisitorOrBot && (
287
- <TouchableOpacity onPress={openModal} style={styles.threeDots}>
288
- <SvgXml
289
- xml={threeDots(theme.colors.base)}
290
- width="20"
291
- height="16"
292
- />
293
- </TouchableOpacity>
294
- )}
286
+ <TouchableOpacity onPress={openModal} style={styles.threeDots}>
287
+ <SvgXml
288
+ xml={threeDots(theme.colors.base)}
289
+ width="20"
290
+ height="16"
291
+ />
292
+ </TouchableOpacity>
295
293
  </View>
296
294
  {likeReaction > 0 && (
297
295
  <TouchableOpacity
@@ -366,7 +364,12 @@ export default function ReplyCommentList({
366
364
  </View>
367
365
  ) : (
368
366
  <TouchableOpacity
369
- onPress={reportCommentObject}
367
+ onPress={() => {
368
+ closeModal();
369
+ handleGlobalBehavior({
370
+ defaultBehavior: reportCommentObject,
371
+ });
372
+ }}
370
373
  style={styles.modalRow}
371
374
  >
372
375
  <SvgXml
@@ -16,9 +16,15 @@ function CommunityCreatePostButton({
16
16
  ...props
17
17
  }: CommunityCreatePostButtonProps) {
18
18
  const elementId = ElementID.community_create_post_button;
19
- const { themeStyles } = useAmityElement({ pageId, componentId, elementId });
19
+ const { themeStyles, isExcluded } = useAmityElement({
20
+ pageId,
21
+ componentId,
22
+ elementId,
23
+ });
20
24
  const styles = useStyles(themeStyles);
21
25
 
26
+ if (isExcluded) return null;
27
+
22
28
  return (
23
29
  <TouchableOpacity
24
30
  hitSlop={0.8}
@@ -315,7 +315,7 @@ const CommentListItem = ({
315
315
  onClickReply && onClickReply(user, commentId);
316
316
  };
317
317
 
318
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
318
+ const { handleGlobalBehavior } = useGlobalBehavior();
319
319
 
320
320
  const onPressLike = () =>
321
321
  handleGlobalBehavior({ defaultBehavior: addReactionToComment });
@@ -415,18 +415,13 @@ const CommentListItem = ({
415
415
  <TouchableOpacity onPress={onPressReply} style={styles.likeBtn}>
416
416
  <Text style={styles.btnText}>Reply</Text>
417
417
  </TouchableOpacity>
418
- {!isVisitorOrBot && (
419
- <TouchableOpacity
420
- onPress={openModal}
421
- style={styles.threeDots}
422
- >
423
- <SvgXml
424
- xml={threeDots(theme.colors.base)}
425
- width="20"
426
- height="16"
427
- />
428
- </TouchableOpacity>
429
- )}
418
+ <TouchableOpacity onPress={openModal} style={styles.threeDots}>
419
+ <SvgXml
420
+ xml={threeDots(theme.colors.base)}
421
+ width="20"
422
+ height="16"
423
+ />
424
+ </TouchableOpacity>
430
425
  </View>
431
426
 
432
427
  {likeReaction > 0 && (
@@ -539,7 +534,12 @@ const CommentListItem = ({
539
534
  </View>
540
535
  ) : (
541
536
  <TouchableOpacity
542
- onPress={reportCommentObject}
537
+ onPress={() => {
538
+ closeModal();
539
+ handleGlobalBehavior({
540
+ defaultBehavior: reportCommentObject,
541
+ });
542
+ }}
543
543
  style={styles.modalRow}
544
544
  >
545
545
  <SvgXml
@@ -146,7 +146,7 @@ const ReplyCommentList = ({
146
146
  }
147
147
  };
148
148
 
149
- const { handleGlobalBehavior, isVisitorOrBot } = useGlobalBehavior();
149
+ const { handleGlobalBehavior } = useGlobalBehavior();
150
150
 
151
151
  const onPressLike = () =>
152
152
  handleGlobalBehavior({ defaultBehavior: addReactionToComment });
@@ -304,15 +304,13 @@ const ReplyCommentList = ({
304
304
  {!isLike ? 'Like' : 'Liked'}
305
305
  </Text>
306
306
  </TouchableOpacity>
307
- {!isVisitorOrBot && (
308
- <TouchableOpacity onPress={openModal} style={styles.threeDots}>
309
- <SvgXml
310
- xml={threeDots(theme.colors.base)}
311
- width="20"
312
- height="16"
313
- />
314
- </TouchableOpacity>
315
- )}
307
+ <TouchableOpacity onPress={openModal} style={styles.threeDots}>
308
+ <SvgXml
309
+ xml={threeDots(theme.colors.base)}
310
+ width="20"
311
+ height="16"
312
+ />
313
+ </TouchableOpacity>
316
314
  </View>
317
315
 
318
316
  {likeReaction > 0 && (
@@ -348,6 +346,7 @@ const ReplyCommentList = ({
348
346
  styles.twoOptions,
349
347
  ]}
350
348
  >
349
+ <View style={styles.handleBar} />
351
350
  {user?.userId === (client as Amity.Client).userId ? (
352
351
  <View>
353
352
  <TouchableOpacity
@@ -375,7 +374,12 @@ const ReplyCommentList = ({
375
374
  </View>
376
375
  ) : (
377
376
  <TouchableOpacity
378
- onPress={reportCommentObject}
377
+ onPress={() => {
378
+ closeModal();
379
+ handleGlobalBehavior({
380
+ defaultBehavior: reportCommentObject,
381
+ });
382
+ }}
379
383
  style={styles.modalRow}
380
384
  >
381
385
  <SvgXml
@@ -6,6 +6,14 @@ export const useStyles = () => {
6
6
  const theme = useTheme() as MyMD3Theme;
7
7
 
8
8
  const styles = StyleSheet.create({
9
+ handleBar: {
10
+ alignSelf: 'center',
11
+ width: 36,
12
+ backgroundColor: theme.colors.baseShade4,
13
+ height: 5,
14
+ marginVertical: 10,
15
+ borderRadius: 10,
16
+ },
9
17
  commentWrap: {
10
18
  backgroundColor: theme.colors.background,
11
19
  paddingHorizontal: 12,
@@ -83,7 +83,7 @@ function AmityLiveStreamPlayerPage() {
83
83
  };
84
84
  useRoomSubscription({ room });
85
85
 
86
- const { client } = useAuth();
86
+ const { client, isVisitorOrBot } = useAuth();
87
87
  const videoRef = useRef<any>(null);
88
88
  const isStreamEnding = useRef(false);
89
89
 
@@ -127,7 +127,7 @@ function AmityLiveStreamPlayerPage() {
127
127
  }, []);
128
128
 
129
129
  useEffect(() => {
130
- if (!room?.status) return;
130
+ if (!room?.status || isVisitorOrBot) return;
131
131
 
132
132
  const shouldEnd =
133
133
  room.status === RoomStatus.ended ||
@@ -149,13 +149,14 @@ function AmityLiveStreamPlayerPage() {
149
149
  setVideoKey((prev) => prev + 1);
150
150
  }, 50);
151
151
  }
152
- }, [room?.status, wasLive]);
152
+ }, [room?.status, wasLive, isVisitorOrBot]);
153
153
 
154
154
  useEffect(() => {
155
+ if (isVisitorOrBot) return;
155
156
  if (room?.status === RoomStatus.terminated) {
156
157
  navigation.replace('LivestreamTerminated', { type: 'viewer' });
157
158
  }
158
- }, [room?.status, navigation]);
159
+ }, [room?.status, navigation, isVisitorOrBot]);
159
160
 
160
161
  const showControlsTemporarily = useCallback(() => {
161
162
  setShowControls(true);
@@ -171,9 +172,10 @@ function AmityLiveStreamPlayerPage() {
171
172
  }, [showControlsTemporarily]);
172
173
 
173
174
  const shouldShowEndThumbnail =
174
- room?.status === RoomStatus.ended ||
175
- (room?.status === RoomStatus.recorded && wasLive) ||
176
- (room as any)?.user?.isGlobalBan;
175
+ !isVisitorOrBot &&
176
+ (room?.status === RoomStatus.ended ||
177
+ (room?.status === RoomStatus.recorded && wasLive) ||
178
+ (room as any)?.user?.isGlobalBan);
177
179
 
178
180
  if (!room || error) {
179
181
  return (
@@ -246,6 +248,7 @@ function AmityLiveStreamPlayerPage() {
246
248
  setIsPaused(false);
247
249
  }
248
250
  }}
251
+ onEnd={() => setIsPaused(true)}
249
252
  />
250
253
  )}
251
254
 
@@ -35,7 +35,6 @@ import { PostMenu } from '../../../../components/PostMenu';
35
35
  import PinBadge from '../../../../elements/PinBadge';
36
36
  import AnnouncementBadge from '../../../../elements/AnnouncementBadge';
37
37
  import { Typography } from '../../../../../core/components/Typography/Typography';
38
- import useAuth from '../../../../../core/hooks/useAuth';
39
38
 
40
39
  type AmityPostContentComponentProps = {
41
40
  post: Amity.Post;
@@ -75,7 +74,6 @@ const AmityPostContentComponent: FC<AmityPostContentComponentProps> = ({
75
74
  componentId: componentId,
76
75
  });
77
76
  const styles = useStyles(themeStyles);
78
- const { isVisitorOrBot } = useAuth();
79
77
  const [textPost, setTextPost] = useState<string>('');
80
78
  const [communityData, setCommunityData] = useState<Amity.Community>(null);
81
79
  const navigation =
@@ -294,11 +292,10 @@ const AmityPostContentComponent: FC<AmityPostContentComponentProps> = ({
294
292
  category === AmityPostCategory.PIN_AND_ANNOUNCEMENT) && (
295
293
  <PinBadge componentId={ComponentID.post_content} />
296
294
  )}
297
- {!isVisitorOrBot &&
298
- AmityPostContentComponentStyle ===
299
- AmityPostContentComponentStyleEnum.feed && (
300
- <PostMenu post={post} pageId={pageId} componentId={componentId} />
301
- )}
295
+ {AmityPostContentComponentStyle ===
296
+ AmityPostContentComponentStyleEnum.feed && (
297
+ <PostMenu post={post} pageId={pageId} componentId={componentId} />
298
+ )}
302
299
  </Pressable>
303
300
  <View>
304
301
  <View style={styles.bodySection}>
@@ -29,6 +29,7 @@ import { useFile } from '../../../hooks/useFile';
29
29
  import { getMediaTypeFromUrl } from '../../../../core/utils/url';
30
30
  import { LoadingOverlay } from '../../../components/legacy/LoadingOverlay';
31
31
  import mime from 'mime';
32
+ import { appendFileToFormData } from '../../../../core/utils/fileUpload';
32
33
  import { useToast } from '../../../../core/stores/slices/toastSlice';
33
34
  import { SafeAreaView } from 'react-native-safe-area-context';
34
35
 
@@ -119,11 +120,14 @@ const AmityDraftStoryPage: FC<IAmityDraftStoryPage> = ({
119
120
  const isImage = type === StoryType.image;
120
121
  const mimeType =
121
122
  mime.getType(mediaType.uri) ?? (isImage ? 'image/jpeg' : 'video/mp4');
122
- formData.append('files', {
123
- uri: mediaType.uri,
124
- name: mediaType.name,
125
- type: mimeType,
126
- } as unknown as Blob);
123
+
124
+ await appendFileToFormData(
125
+ formData,
126
+ 'files',
127
+ mediaType.uri,
128
+ mediaType.name,
129
+ mimeType
130
+ );
127
131
 
128
132
  try {
129
133
  setLoading(true);
@@ -649,6 +649,7 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
649
649
  withAvatar={true}
650
650
  />
651
651
  </KeyboardAvoidingView>
652
+ <GlobalToast />
652
653
  </Modal>
653
654
  )}
654
655
  <BottomSheet
@@ -112,24 +112,28 @@ export function useHeader(user?: Amity.User) {
112
112
 
113
113
  const navigateToRelationship = (tab: UserRelationshipTab) => {
114
114
  if (!user?.userId) return;
115
- if (!isMyProfile && isPrivateNetwork && !isFollowing) {
116
- showToast({
117
- type: 'informative',
118
- message: TOAST.USER.RELATIONSHIP.FOLLOW_TO_INTERACT,
119
- });
120
- return;
121
- }
122
- if (AmityUserProfileHeaderComponentBehavior?.goToUserRelationshipPage) {
123
- AmityUserProfileHeaderComponentBehavior.goToUserRelationshipPage({
124
- userId: user.userId,
125
- selectedTab: tab,
126
- });
127
- } else {
128
- navigation.push('UserRelationship', {
129
- userId: user.userId,
130
- selectedTab: tab,
131
- });
132
- }
115
+ handleGlobalBehavior({
116
+ defaultBehavior: () => {
117
+ if (!isMyProfile && isPrivateNetwork && !isFollowing) {
118
+ showToast({
119
+ type: 'informative',
120
+ message: TOAST.USER.RELATIONSHIP.FOLLOW_TO_INTERACT,
121
+ });
122
+ return;
123
+ }
124
+ if (AmityUserProfileHeaderComponentBehavior?.goToUserRelationshipPage) {
125
+ AmityUserProfileHeaderComponentBehavior.goToUserRelationshipPage({
126
+ userId: user.userId,
127
+ selectedTab: tab,
128
+ });
129
+ } else {
130
+ navigation.push('UserRelationship', {
131
+ userId: user.userId,
132
+ selectedTab: tab,
133
+ });
134
+ }
135
+ },
136
+ });
133
137
  };
134
138
 
135
139
  return {
@@ -51,6 +51,8 @@ export const useStyles = (
51
51
  },
52
52
  hiddenText: {
53
53
  position: 'absolute',
54
+ left: 0,
55
+ right: 0,
54
56
  opacity: 0,
55
57
  },
56
58
  seeMore: {
@@ -17,6 +17,7 @@ import { useUserFlaggedByMeQuery } from '../../../../../../hooks/queries/useFlag
17
17
  import { useBlockUser } from '../../../../../../hooks/queries/useBlockUser';
18
18
  import { useFollowInfo } from '../../../../../../hooks/objects';
19
19
  import { useBehaviour } from '../../../../../../providers/BehaviourProvider';
20
+ import { useGlobalBehavior } from '../../../../../../hooks';
20
21
 
21
22
  type UseMenuParams = {
22
23
  userId?: string;
@@ -28,6 +29,7 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
28
29
 
29
30
  const { client } = useAuth();
30
31
  const { getShareLink } = useShareableLink();
32
+ const { handleGlobalBehavior } = useGlobalBehavior();
31
33
  const { AmityUserProfilePageBehavior } = useBehaviour();
32
34
  const { accessibilityId: menuButtonId } = useAmityElement({
33
35
  pageId,
@@ -97,8 +99,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
97
99
  testID: 'report-user-button',
98
100
  accessibilityLabel: 'Report user',
99
101
  onPress: () => {
100
- if (userId) reportUser(userId);
101
102
  closeBottomSheet();
103
+ handleGlobalBehavior({
104
+ defaultBehavior: () => userId && reportUser(userId),
105
+ });
102
106
  },
103
107
  },
104
108
  {
@@ -108,8 +112,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
108
112
  testID: 'unreport-user-button',
109
113
  accessibilityLabel: 'Unreport user',
110
114
  onPress: () => {
111
- if (userId) unreportUser(userId);
112
115
  closeBottomSheet();
116
+ handleGlobalBehavior({
117
+ defaultBehavior: () => userId && unreportUser(userId),
118
+ });
113
119
  },
114
120
  },
115
121
  {
@@ -120,7 +126,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
120
126
  accessibilityLabel: 'Block user',
121
127
  onPress: () => {
122
128
  closeBottomSheet();
123
- if (userId) blockUser(userId, displayName ?? userId);
129
+ handleGlobalBehavior({
130
+ defaultBehavior: () =>
131
+ userId && blockUser(userId, displayName ?? userId),
132
+ });
124
133
  },
125
134
  },
126
135
  {
@@ -131,7 +140,10 @@ export function useMenu({ userId, displayName }: UseMenuParams) {
131
140
  accessibilityLabel: 'Unblock user',
132
141
  onPress: () => {
133
142
  closeBottomSheet();
134
- if (userId) unBlockUser(userId, displayName ?? userId);
143
+ handleGlobalBehavior({
144
+ defaultBehavior: () =>
145
+ userId && unBlockUser(userId, displayName ?? userId),
146
+ });
135
147
  },
136
148
  },
137
149
  ].filter((action) => action.visible);
@@ -6,6 +6,7 @@ import {
6
6
  useCommunity,
7
7
  isModerator,
8
8
  useUser,
9
+ useGlobalBehavior,
9
10
  } from '../../../../hooks';
10
11
  import { useStyles } from './styles';
11
12
  import { CommunityCover } from '../../elements/CommunityCover/CommunityCover';
@@ -50,6 +51,7 @@ const AmityCommunityHeaderComponent: FC<AmityCommunityHeaderComponentProps> = ({
50
51
  const client = Client.getActiveClient();
51
52
  const navigation =
52
53
  useNavigation<NativeStackNavigationProp<RootStackParamList>>();
54
+ const { handleGlobalBehavior } = useGlobalBehavior();
53
55
  const componentId = ComponentID.community_header;
54
56
  const { community } = useCommunity(communityId);
55
57
  const { posts: pendingPosts } = usePosts({
@@ -153,8 +155,12 @@ const AmityCommunityHeaderComponent: FC<AmityCommunityHeaderComponentProps> = ({
153
155
  community={community}
154
156
  style={styles.infoWrap}
155
157
  onPress={() => {
156
- navigation.navigate('CommunityMembership', {
157
- community: community,
158
+ handleGlobalBehavior({
159
+ defaultBehavior: () => {
160
+ navigation.navigate('CommunityMembership', {
161
+ community: community,
162
+ });
163
+ },
158
164
  });
159
165
  }}
160
166
  />