@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.
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/commonjs/v4/assets/icons/lock.js +6 -4
- package/lib/commonjs/v4/assets/icons/lock.js.map +1 -1
- package/lib/commonjs/v4/component/Social/CommentList/CommentList.js +16 -3
- package/lib/commonjs/v4/component/Social/CommentList/CommentList.js.map +1 -1
- package/lib/commonjs/v4/component/Social/CommentList/styles.js +12 -0
- package/lib/commonjs/v4/component/Social/CommentList/styles.js.map +1 -1
- package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
- package/lib/commonjs/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/commonjs/v4/enum/roomStatus.js +2 -1
- package/lib/commonjs/v4/enum/roomStatus.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +1 -0
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/module/v4/assets/icons/lock.js +6 -4
- package/lib/module/v4/assets/icons/lock.js.map +1 -1
- package/lib/module/v4/component/Social/CommentList/CommentList.js +16 -3
- package/lib/module/v4/component/Social/CommentList/CommentList.js.map +1 -1
- package/lib/module/v4/component/Social/CommentList/styles.js +12 -0
- package/lib/module/v4/component/Social/CommentList/styles.js.map +1 -1
- package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js +3 -2
- package/lib/module/v4/component/Social/CommentListItem/CommentListItem.js.map +1 -1
- package/lib/module/v4/enum/roomStatus.js +2 -1
- package/lib/module/v4/enum/roomStatus.js.map +1 -1
- package/lib/typescript/src/components/PollSection/usePoll.d.ts +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/assets/icons/lock.d.ts +1 -1
- package/lib/typescript/src/v4/assets/icons/lock.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts +1 -0
- package/lib/typescript/src/v4/component/Social/CommentList/CommentList.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts +12 -0
- package/lib/typescript/src/v4/component/Social/CommentList/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts +2 -1
- package/lib/typescript/src/v4/component/Social/CommentListItem/CommentListItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/enum/roomStatus.d.ts +1 -0
- package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +1 -39
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePoll.d.ts +1 -1
- package/package.json +3 -3
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +1 -0
- package/src/v4/assets/icons/lock.tsx +7 -6
- package/src/v4/component/Social/CommentList/CommentList.tsx +44 -27
- package/src/v4/component/Social/CommentList/styles.ts +12 -0
- package/src/v4/component/Social/CommentListItem/CommentListItem.tsx +3 -1
- 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-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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
|
-
<
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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}>
|