@amityco/react-native-social-uikit 4.0.0-48d9564c.0 → 4.0.0-5ae18d07.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.
- package/lib/commonjs/components/Toast/Toast.js +2 -1
- package/lib/commonjs/components/Toast/Toast.js.map +1 -1
- package/lib/commonjs/providers/file-provider.js +0 -1
- package/lib/commonjs/providers/file-provider.js.map +1 -1
- package/lib/commonjs/svg/svg-xml-list.js +6 -1
- package/lib/commonjs/svg/svg-xml-list.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +54 -21
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +24 -2
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
- package/lib/commonjs/v4/assets/icons/toast.js +6 -6
- package/lib/commonjs/v4/assets/icons/toast.js.map +1 -1
- package/lib/commonjs/v4/component/CommunityStories/index.js +9 -4
- package/lib/commonjs/v4/component/CommunityStories/index.js.map +1 -1
- package/lib/commonjs/v4/component/CommunityStories/styles.js +7 -2
- package/lib/commonjs/v4/component/CommunityStories/styles.js.map +1 -1
- package/lib/commonjs/v4/component/LoadingImage/index.js +2 -3
- package/lib/commonjs/v4/component/LoadingImage/index.js.map +1 -1
- package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js +11 -4
- package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js.map +1 -1
- package/lib/commonjs/v4/component/MyStories/styles.js +5 -0
- package/lib/commonjs/v4/component/MyStories/styles.js.map +1 -1
- package/lib/module/components/Toast/Toast.js +2 -1
- package/lib/module/components/Toast/Toast.js.map +1 -1
- package/lib/module/providers/file-provider.js +0 -1
- package/lib/module/providers/file-provider.js.map +1 -1
- package/lib/module/svg/svg-xml-list.js +4 -0
- package/lib/module/svg/svg-xml-list.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +54 -21
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +24 -2
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
- package/lib/module/v4/assets/icons/toast.js +6 -6
- package/lib/module/v4/assets/icons/toast.js.map +1 -1
- package/lib/module/v4/component/CommunityStories/index.js +10 -5
- package/lib/module/v4/component/CommunityStories/index.js.map +1 -1
- package/lib/module/v4/component/CommunityStories/styles.js +7 -2
- package/lib/module/v4/component/CommunityStories/styles.js.map +1 -1
- package/lib/module/v4/component/LoadingImage/index.js +2 -3
- package/lib/module/v4/component/LoadingImage/index.js.map +1 -1
- package/lib/module/v4/component/MyStories/StoryCircleItem.js +13 -6
- package/lib/module/v4/component/MyStories/StoryCircleItem.js.map +1 -1
- package/lib/module/v4/component/MyStories/styles.js +5 -0
- package/lib/module/v4/component/MyStories/styles.js.map +1 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -1
- package/lib/typescript/src/providers/file-provider.d.ts.map +1 -1
- package/lib/typescript/src/svg/svg-xml-list.d.ts +1 -0
- package/lib/typescript/src/svg/svg-xml-list.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.d.ts +22 -0
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/assets/icons/toast.d.ts +3 -3
- package/lib/typescript/src/v4/assets/icons/toast.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/CommunityStories/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts +5 -0
- package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LoadingImage/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/MyStories/StoryCircleItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/MyStories/styles.d.ts +5 -0
- package/lib/typescript/src/v4/component/MyStories/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Toast/Toast.tsx +1 -0
- package/src/providers/file-provider.tsx +0 -1
- package/src/svg/svg-xml-list.ts +6 -0
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +122 -57
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.ts +23 -1
- package/src/v4/assets/icons/toast.tsx +12 -9
- package/src/v4/component/CommunityStories/index.tsx +26 -17
- package/src/v4/component/CommunityStories/styles.ts +7 -2
- package/src/v4/component/LoadingImage/index.tsx +2 -4
- package/src/v4/component/MyStories/StoryCircleItem.tsx +19 -12
- package/src/v4/component/MyStories/styles.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmityViewStoryItem.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAoBvE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"AmityViewStoryItem.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAoBvE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAchE,UAAU,mBAAmB;IAC3B,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,4BAA4B,EAAE,OAAO,CAAC;IACtC,KAAK,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CACnC;AAED,UAAU,UAAW,SAAQ,KAAK,CAAC,KAAK;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;;AA8iBD,wBAAwC"}
|
|
@@ -7,6 +7,7 @@ export declare const useStyles: () => {
|
|
|
7
7
|
flex: number;
|
|
8
8
|
width: number;
|
|
9
9
|
backgroundColor: string;
|
|
10
|
+
position: "relative";
|
|
10
11
|
};
|
|
11
12
|
flex: {
|
|
12
13
|
flex: number;
|
|
@@ -212,5 +213,26 @@ export declare const useStyles: () => {
|
|
|
212
213
|
color: string;
|
|
213
214
|
fontSize: number;
|
|
214
215
|
};
|
|
216
|
+
errorContainer: {
|
|
217
|
+
width: "100%";
|
|
218
|
+
position: "absolute";
|
|
219
|
+
bottom: number;
|
|
220
|
+
left: number;
|
|
221
|
+
backgroundColor: string;
|
|
222
|
+
flexDirection: "row";
|
|
223
|
+
alignItems: "center";
|
|
224
|
+
justifyContent: "space-between";
|
|
225
|
+
paddingVertical: number;
|
|
226
|
+
paddingHorizontal: number;
|
|
227
|
+
};
|
|
228
|
+
errorContainerLeft: {
|
|
229
|
+
display: "flex";
|
|
230
|
+
flexDirection: "row";
|
|
231
|
+
alignItems: "center";
|
|
232
|
+
gap: number;
|
|
233
|
+
};
|
|
234
|
+
errorText: {
|
|
235
|
+
color: string;
|
|
236
|
+
};
|
|
215
237
|
};
|
|
216
238
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../../src/v4/PublicApi/Pages/AmityViewStoryPage/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../../src/v4/PublicApi/Pages/AmityViewStoryPage/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkPrB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const failed: () => string;
|
|
2
|
-
export declare const success: () => string;
|
|
3
|
-
export declare const informative: () => string;
|
|
1
|
+
export declare const failed: (color?: string) => string;
|
|
2
|
+
export declare const success: (color?: string) => string;
|
|
3
|
+
export declare const informative: (color?: string) => string;
|
|
4
4
|
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/assets/icons/toast.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/assets/icons/toast.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,GACjB,QAAO,MAAuB,WAK/B,CAAC;AAEF,eAAO,MAAM,OAAO,GAClB,QAAO,MAAuB,WAI/B,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,QAAO,MAAuB,WAI/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/CommunityStories/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/CommunityStories/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAsBtE,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;+EAEqD,iBAAiB;AAyLvE,wBAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/CommunityStories/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/CommunityStories/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/LoadingImage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/LoadingImage/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAWhE,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1E,YAAY,CAAC,EAAE,CACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,KACjB,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AACD,QAAA,MAAM,YAAY,GAAI,6HAYnB,iBAAiB,sBAiInB,CAAC;AACF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoryCircleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/MyStories/StoryCircleItem.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StoryCircleItem.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/MyStories/StoryCircleItem.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAC;AAgBvD,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;CAChC;AAED,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,gBAAgB,CAmFzC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/MyStories/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/v4/component/MyStories/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGrB,CAAC"}
|
package/package.json
CHANGED
package/src/svg/svg-xml-list.ts
CHANGED
|
@@ -429,3 +429,9 @@ export const infoIcon = (
|
|
|
429
429
|
): string => `<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
430
430
|
<path d="M8 2.25006C4.25 2.25006 1.25 5.28131 1.25 9.00006C1.25 12.7501 4.25 15.7501 8 15.7501C11.7188 15.7501 14.75 12.7501 14.75 9.00006C14.75 5.28131 11.6875 2.25006 8 2.25006ZM8 1.25006C12.25 1.25006 15.75 4.75006 15.75 9.00006C15.75 13.2813 12.25 16.7501 8 16.7501C3.71875 16.7501 0.25 13.2813 0.25 9.00006C0.25 4.75006 3.71875 1.25006 8 1.25006ZM6.875 12.0001H7.25V8.25006H6.875C6.65625 8.25006 6.5 8.09381 6.5 7.87506V7.62506C6.5 7.43756 6.65625 7.25006 6.875 7.25006H8.375C8.5625 7.25006 8.75 7.43756 8.75 7.62506V12.0001H9.125C9.3125 12.0001 9.5 12.1876 9.5 12.3751V12.6251C9.5 12.8438 9.3125 13.0001 9.125 13.0001H6.875C6.65625 13.0001 6.5 12.8438 6.5 12.6251V12.3751C6.5 12.1876 6.65625 12.0001 6.875 12.0001ZM8 4.50006C8.53125 4.50006 9 4.96881 9 5.50006C9 6.06256 8.53125 6.50006 8 6.50006C7.4375 6.50006 7 6.06256 7 5.50006C7 4.96881 7.4375 4.50006 8 4.50006Z" fill="${color}"/>
|
|
431
431
|
</svg>`;
|
|
432
|
+
export const errorIcon = (
|
|
433
|
+
color: string = '#fff'
|
|
434
|
+
): string => `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
435
|
+
<circle cx="8" cy="8" r="7.25" fill="#FA4D30" stroke="#fff" strokeWidth="1.5"></circle>
|
|
436
|
+
<path d="M9.25 10.75C9.25 11.453 8.687 12 8 12c-.703 0-1.25-.547-1.25-1.25 0-.688.547-1.25 1.25-1.25.688 0 1.25.563 1.25 1.25zM6.89 4.406A.378.378 0 017.267 4h1.453c.219 0 .39.188.375.406l-.203 4.25A.387.387 0 018.516 9H7.469a.387.387 0 01-.375-.344l-.203-4.25z" fill="${color}"/>
|
|
437
|
+
</svg>`;
|
|
@@ -43,6 +43,8 @@ import { Typography } from '../../../../component/Typography/Typography';
|
|
|
43
43
|
import { useTheme } from 'react-native-paper';
|
|
44
44
|
import { MyMD3Theme } from '../../../../../providers/amity-ui-kit-provider';
|
|
45
45
|
import { useUIKitDispatch } from '../../../../../redux/store';
|
|
46
|
+
import { informative } from '~/v4/assets/icons/toast';
|
|
47
|
+
import { close as closeIcon } from '../../../../assets/icons';
|
|
46
48
|
|
|
47
49
|
interface IAmityViewStoryItem {
|
|
48
50
|
communityData: Amity.Community;
|
|
@@ -96,7 +98,6 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
96
98
|
const [isLiked, setIsLiked] = useState<boolean>(myReactions?.length > 0);
|
|
97
99
|
const [openCommentSheet, setOpenCommentSheet] = useState(false);
|
|
98
100
|
const [load, setLoad] = useState(true);
|
|
99
|
-
const [error, setError] = useState(false);
|
|
100
101
|
const [loading, setLoading] = useState(false);
|
|
101
102
|
const dispatch = useUIKitDispatch();
|
|
102
103
|
const { showToastMessage } = uiSlice.actions;
|
|
@@ -248,10 +249,20 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
248
249
|
);
|
|
249
250
|
if (deleted) {
|
|
250
251
|
current === 0 && previous();
|
|
251
|
-
dispatch(
|
|
252
|
+
dispatch(
|
|
253
|
+
showToastMessage({
|
|
254
|
+
toastMessage: 'Story deleted',
|
|
255
|
+
isSuccessToast: true,
|
|
256
|
+
})
|
|
257
|
+
);
|
|
252
258
|
}
|
|
253
259
|
} catch (err) {
|
|
254
|
-
dispatch(
|
|
260
|
+
dispatch(
|
|
261
|
+
showToastMessage({
|
|
262
|
+
toastMessage: 'Failed to delete story. Please try again.',
|
|
263
|
+
isSuccessToast: false,
|
|
264
|
+
})
|
|
265
|
+
);
|
|
255
266
|
} finally {
|
|
256
267
|
setLoading(false);
|
|
257
268
|
sheetRef?.current?.close();
|
|
@@ -288,6 +299,30 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
288
299
|
sheetRef.current?.open();
|
|
289
300
|
}, [progress]);
|
|
290
301
|
|
|
302
|
+
const onPressMenuButtonFailed = useCallback(() => {
|
|
303
|
+
progress.stopAnimation(() => setPressed(true));
|
|
304
|
+
Alert.alert(
|
|
305
|
+
'Failed to upload story',
|
|
306
|
+
'Would you like to discard uploading?',
|
|
307
|
+
[
|
|
308
|
+
{ text: 'Cancel', onPress: () => sheetRef?.current?.close() },
|
|
309
|
+
{ text: 'Delete', style: 'destructive', onPress: deleteStory },
|
|
310
|
+
]
|
|
311
|
+
);
|
|
312
|
+
}, [deleteStory, progress]);
|
|
313
|
+
|
|
314
|
+
const isFailedImageUpload =
|
|
315
|
+
currentStory?.dataType === 'image' &&
|
|
316
|
+
(currentStory?.syncState === 'error' ||
|
|
317
|
+
currentStory?.syncState === 'syncing' ||
|
|
318
|
+
!currentStory?.imageData?.fileUrl);
|
|
319
|
+
|
|
320
|
+
const isFailedVideoUpload =
|
|
321
|
+
currentStory?.dataType === 'video' &&
|
|
322
|
+
(currentStory?.syncState === 'error' ||
|
|
323
|
+
currentStory?.syncState === 'syncing' ||
|
|
324
|
+
!currentStory?.videoData?.fileUrl);
|
|
325
|
+
|
|
291
326
|
return (
|
|
292
327
|
<View style={[styles.container]}>
|
|
293
328
|
<SafeAreaView>
|
|
@@ -296,7 +331,13 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
296
331
|
<Video
|
|
297
332
|
onLoadStart={() => setLoad(true)}
|
|
298
333
|
onProgress={({ currentTime }) => setCurrentSeek(currentTime)}
|
|
299
|
-
source={{
|
|
334
|
+
source={{
|
|
335
|
+
uri:
|
|
336
|
+
currentStory?.videoData?.fileUrl ||
|
|
337
|
+
(typeof currentStory?.data?.fileData === 'string'
|
|
338
|
+
? currentStory?.data?.fileData
|
|
339
|
+
: ''),
|
|
340
|
+
}}
|
|
300
341
|
style={styles.video}
|
|
301
342
|
resizeMode="contain"
|
|
302
343
|
controls={false}
|
|
@@ -308,12 +349,15 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
308
349
|
) : currentStory?.dataType === 'image' ? (
|
|
309
350
|
<Image
|
|
310
351
|
onLoadStart={() => setLoad(true)}
|
|
311
|
-
onError={({ nativeEvent: { error: err } }) =>
|
|
312
|
-
err && setError(true)
|
|
313
|
-
}
|
|
314
352
|
onLoadEnd={() => start()}
|
|
315
|
-
source={{
|
|
316
|
-
|
|
353
|
+
source={{
|
|
354
|
+
uri:
|
|
355
|
+
currentStory?.imageData?.fileUrl ||
|
|
356
|
+
(typeof currentStory?.data?.fileData === 'string'
|
|
357
|
+
? currentStory?.data?.fileData
|
|
358
|
+
: ''),
|
|
359
|
+
}}
|
|
360
|
+
style={[styles.image, isFailedImageUpload && { opacity: 0.6 }]}
|
|
317
361
|
resizeMode="contain"
|
|
318
362
|
/>
|
|
319
363
|
) : null}
|
|
@@ -322,11 +366,6 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
322
366
|
<ActivityIndicator size="large" color={'white'} />
|
|
323
367
|
</View>
|
|
324
368
|
)}
|
|
325
|
-
{error && (
|
|
326
|
-
<View style={styles.spinnerContainer}>
|
|
327
|
-
<Text style={styles.error}>Story load error</Text>
|
|
328
|
-
</View>
|
|
329
|
-
)}
|
|
330
369
|
</View>
|
|
331
370
|
</SafeAreaView>
|
|
332
371
|
<GestureRecognizer onSwipeUp={onPressComment} style={styles.flexCol}>
|
|
@@ -399,7 +438,12 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
399
438
|
</TouchableOpacity>
|
|
400
439
|
)}
|
|
401
440
|
<TouchableOpacity hitSlop={5} onPress={() => onClose()}>
|
|
402
|
-
<
|
|
441
|
+
<SvgXml
|
|
442
|
+
xml={closeIcon()}
|
|
443
|
+
width="28"
|
|
444
|
+
height="28"
|
|
445
|
+
color="white"
|
|
446
|
+
/>
|
|
403
447
|
</TouchableOpacity>
|
|
404
448
|
</View>
|
|
405
449
|
</View>
|
|
@@ -465,49 +509,70 @@ const AmityViewStoryItem: FC<IAmityViewStoryItem> = ({
|
|
|
465
509
|
</TouchableOpacity>
|
|
466
510
|
)}
|
|
467
511
|
</GestureRecognizer>
|
|
468
|
-
|
|
469
|
-
{
|
|
470
|
-
<
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
>
|
|
476
|
-
|
|
477
|
-
<
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
styles.iconContainer,
|
|
486
|
-
{ backgroundColor: storyCommentBgColor },
|
|
487
|
-
]}
|
|
488
|
-
onPress={onPressComment}
|
|
489
|
-
>
|
|
490
|
-
<SvgXml xml={storyCommentIcon()} width="25" height="25" />
|
|
491
|
-
<Text style={styles.seen}>{commentsCounts}</Text>
|
|
492
|
-
</TouchableOpacity>
|
|
493
|
-
<TouchableOpacity
|
|
494
|
-
style={[
|
|
495
|
-
styles.iconContainer,
|
|
496
|
-
{
|
|
497
|
-
backgroundColor: storyReactionBgColor,
|
|
498
|
-
},
|
|
499
|
-
]}
|
|
500
|
-
onPress={onPressReaction}
|
|
501
|
-
>
|
|
502
|
-
<SvgXml
|
|
503
|
-
xml={isLiked ? storyLikedIcon : storyLikeIcon}
|
|
504
|
-
width="25"
|
|
505
|
-
height="25"
|
|
506
|
-
/>
|
|
507
|
-
<Text style={styles.seen}>{totalReaction}</Text>
|
|
508
|
-
</TouchableOpacity>
|
|
512
|
+
{(isFailedImageUpload || isFailedVideoUpload) && hasStoryPermission ? (
|
|
513
|
+
<View style={styles.errorContainer}>
|
|
514
|
+
<View style={styles.errorContainerLeft}>
|
|
515
|
+
<SvgXml xml={informative('white')} width="20" height="20" />
|
|
516
|
+
<Typography.Body style={styles.errorText}>
|
|
517
|
+
Failed to upload story
|
|
518
|
+
</Typography.Body>
|
|
519
|
+
</View>
|
|
520
|
+
{
|
|
521
|
+
<TouchableOpacity
|
|
522
|
+
hitSlop={5}
|
|
523
|
+
style={styles.threeDotsMenu}
|
|
524
|
+
onPress={onPressMenuButtonFailed}
|
|
525
|
+
>
|
|
526
|
+
<SvgXml xml={storyThreedotsMenu()} width="20" height="20" />
|
|
527
|
+
</TouchableOpacity>
|
|
528
|
+
}
|
|
509
529
|
</View>
|
|
510
|
-
|
|
530
|
+
) : (
|
|
531
|
+
<View style={styles.footer}>
|
|
532
|
+
{hasStoryImpressionPermission ? (
|
|
533
|
+
<TouchableOpacity
|
|
534
|
+
style={[
|
|
535
|
+
styles.seenContainer,
|
|
536
|
+
{ backgroundColor: storyViewerBgColor },
|
|
537
|
+
]}
|
|
538
|
+
>
|
|
539
|
+
<SvgXml xml={seenIcon()} width="25" height="25" />
|
|
540
|
+
<Text style={styles.seen}>{reachCount}</Text>
|
|
541
|
+
</TouchableOpacity>
|
|
542
|
+
) : (
|
|
543
|
+
<View style={styles.seenContainer} />
|
|
544
|
+
)}
|
|
545
|
+
<View style={styles.seenContainer}>
|
|
546
|
+
<TouchableOpacity
|
|
547
|
+
style={[
|
|
548
|
+
styles.iconContainer,
|
|
549
|
+
{ backgroundColor: storyCommentBgColor },
|
|
550
|
+
]}
|
|
551
|
+
onPress={onPressComment}
|
|
552
|
+
>
|
|
553
|
+
<SvgXml xml={storyCommentIcon()} width="25" height="25" />
|
|
554
|
+
<Text style={styles.seen}>{commentsCounts}</Text>
|
|
555
|
+
</TouchableOpacity>
|
|
556
|
+
<TouchableOpacity
|
|
557
|
+
style={[
|
|
558
|
+
styles.iconContainer,
|
|
559
|
+
{
|
|
560
|
+
backgroundColor: storyReactionBgColor,
|
|
561
|
+
},
|
|
562
|
+
]}
|
|
563
|
+
onPress={onPressReaction}
|
|
564
|
+
>
|
|
565
|
+
<SvgXml
|
|
566
|
+
xml={isLiked ? storyLikedIcon : storyLikeIcon}
|
|
567
|
+
width="25"
|
|
568
|
+
height="25"
|
|
569
|
+
/>
|
|
570
|
+
<Text style={styles.seen}>{totalReaction}</Text>
|
|
571
|
+
</TouchableOpacity>
|
|
572
|
+
</View>
|
|
573
|
+
</View>
|
|
574
|
+
)}
|
|
575
|
+
|
|
511
576
|
{openCommentSheet && (
|
|
512
577
|
<Modal
|
|
513
578
|
style={styles.bottomSheet}
|
|
@@ -14,6 +14,7 @@ export const useStyles = () => {
|
|
|
14
14
|
flex: 1,
|
|
15
15
|
width: width,
|
|
16
16
|
backgroundColor: '#000',
|
|
17
|
+
position: 'relative',
|
|
17
18
|
},
|
|
18
19
|
flex: {
|
|
19
20
|
flex: 1,
|
|
@@ -73,7 +74,7 @@ export const useStyles = () => {
|
|
|
73
74
|
fontSize: 14,
|
|
74
75
|
},
|
|
75
76
|
avatarSubText: {
|
|
76
|
-
color:
|
|
77
|
+
color: 'white',
|
|
77
78
|
fontSize: 12,
|
|
78
79
|
},
|
|
79
80
|
closeIconContainer: {
|
|
@@ -219,6 +220,27 @@ export const useStyles = () => {
|
|
|
219
220
|
color: theme.colors.base,
|
|
220
221
|
fontSize: 14,
|
|
221
222
|
},
|
|
223
|
+
errorContainer: {
|
|
224
|
+
width: '100%',
|
|
225
|
+
position: 'absolute',
|
|
226
|
+
bottom: 120,
|
|
227
|
+
left: 0,
|
|
228
|
+
backgroundColor: theme.colors.alert,
|
|
229
|
+
flexDirection: 'row',
|
|
230
|
+
alignItems: 'center',
|
|
231
|
+
justifyContent: 'space-between',
|
|
232
|
+
paddingVertical: 12,
|
|
233
|
+
paddingHorizontal: 16,
|
|
234
|
+
},
|
|
235
|
+
errorContainerLeft: {
|
|
236
|
+
display: 'flex',
|
|
237
|
+
flexDirection: 'row',
|
|
238
|
+
alignItems: 'center',
|
|
239
|
+
gap: 4,
|
|
240
|
+
},
|
|
241
|
+
errorText: {
|
|
242
|
+
color: 'white',
|
|
243
|
+
},
|
|
222
244
|
});
|
|
223
245
|
|
|
224
246
|
return styles;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
export const failed =
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export const failed = (
|
|
2
|
+
color: string = 'currentColor'
|
|
3
|
+
) => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812ZM13.4766 15.625C13.4766 16.4688 12.8086 17.1016 12 17.1016C11.1562 17.1016 10.5234 16.4688 10.5234 15.625C10.5234 14.8164 11.1562 14.1484 12 14.1484C12.8086 14.1484 13.4766 14.8164 13.4766 15.625ZM10.5938 8.20703C10.5938 7.96094 10.7695 7.75 11.0156 7.75H12.9492C13.1953 7.75 13.3711 7.96094 13.3711 8.20703L13.125 12.9883C13.125 13.1992 12.9141 13.375 12.7031 13.375H11.2617C11.0508 13.375 10.8398 13.1992 10.8398 12.9883L10.5938 8.20703Z" fill=${color}/>
|
|
4
5
|
</svg>
|
|
5
6
|
|
|
6
7
|
`;
|
|
7
8
|
|
|
8
|
-
export const success =
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export const success = (
|
|
10
|
+
color: string = 'currentColor'
|
|
11
|
+
) => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875ZM16.9219 9.82422C17.0625 9.96484 17.0625 10.2461 16.9219 10.4219L10.8398 16.4336C10.6641 16.6094 10.418 16.6094 10.2422 16.4336L7.04297 13.1992C6.90234 13.0586 6.90234 12.7773 7.04297 12.6016L7.85156 11.8281C8.02734 11.6523 8.27344 11.6523 8.44922 11.8281L10.5586 13.9375L15.5156 9.01562C15.6914 8.83984 15.9727 8.83984 16.1133 9.01562L16.9219 9.82422Z" fill=${color}/>
|
|
11
13
|
</svg>
|
|
12
14
|
`;
|
|
13
15
|
|
|
14
|
-
export const informative =
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
export const informative = (
|
|
17
|
+
color: string = 'currentColor'
|
|
18
|
+
) => `<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
|
+
<path d="M12 3.53125C16.7812 3.53125 20.7188 7.46875 20.7188 12.25C20.7188 17.0664 16.7812 20.9688 12 20.9688C7.18359 20.9688 3.28125 17.0664 3.28125 12.25C3.28125 7.46875 7.18359 3.53125 12 3.53125ZM12 19.2812C15.8672 19.2812 19.0312 16.1523 19.0312 12.25C19.0312 8.38281 15.8672 5.21875 12 5.21875C8.09766 5.21875 4.96875 8.38281 4.96875 12.25C4.96875 16.1523 8.09766 19.2812 12 19.2812ZM12 7.39844C12.8086 7.39844 13.4766 8.06641 13.4766 8.875C13.4766 9.71875 12.8086 10.3516 12 10.3516C11.1562 10.3516 10.5234 9.71875 10.5234 8.875C10.5234 8.06641 11.1562 7.39844 12 7.39844ZM13.9688 16.3281C13.9688 16.5742 13.7578 16.75 13.5469 16.75H10.4531C10.207 16.75 10.0312 16.5742 10.0312 16.3281V15.4844C10.0312 15.2734 10.207 15.0625 10.4531 15.0625H10.875V12.8125H10.4531C10.207 12.8125 10.0312 12.6367 10.0312 12.3906V11.5469C10.0312 11.3359 10.207 11.125 10.4531 11.125H12.7031C12.9141 11.125 13.125 11.3359 13.125 11.5469V15.0625H13.5469C13.7578 15.0625 13.9688 15.2734 13.9688 15.4844V16.3281Z" fill=${color}/>
|
|
17
20
|
</svg>
|
|
18
21
|
`;
|
|
@@ -5,6 +5,7 @@ import { useStory } from '../../hook/useStory';
|
|
|
5
5
|
import { useFocusEffect, useNavigation } from '@react-navigation/native';
|
|
6
6
|
import { SvgXml } from 'react-native-svg';
|
|
7
7
|
import {
|
|
8
|
+
errorIcon,
|
|
8
9
|
storyCircleCreatePlusIcon,
|
|
9
10
|
storyRing,
|
|
10
11
|
} from '../../../svg/svg-xml-list';
|
|
@@ -34,17 +35,18 @@ const CommunityStories = ({ communityId, community }: ICommunityStories) => {
|
|
|
34
35
|
const { getImage } = useFile();
|
|
35
36
|
const [avatarUrl, setAvatarUrl] = useState(undefined);
|
|
36
37
|
const [viewStory, setViewStory] = useState(false);
|
|
37
|
-
const storyRingColor: string[] =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
const storyRingColor: string[] =
|
|
39
|
+
hasStoryPermission && storyTarget?.failedStoriesCount > 0
|
|
40
|
+
? ['#DE1029', '#DE1029']
|
|
41
|
+
: storyTarget?.hasUnseen
|
|
42
|
+
? (getUiKitConfig({
|
|
43
|
+
page: PageID.StoryPage,
|
|
44
|
+
component: ComponentID.StoryTab,
|
|
45
|
+
element: ElementID.StoryRing,
|
|
46
|
+
})?.progress_color as string[]) ?? ['#e2e2e2', '#e2e2e2']
|
|
47
|
+
: stories.length > 0
|
|
48
|
+
? ['#e2e2e2', '#ffffff']
|
|
49
|
+
: ['#ffffff', '#ffffff'];
|
|
48
50
|
|
|
49
51
|
useEffect(() => {
|
|
50
52
|
(async () => {
|
|
@@ -86,6 +88,7 @@ const CommunityStories = ({ communityId, community }: ICommunityStories) => {
|
|
|
86
88
|
setViewStory(false);
|
|
87
89
|
onPressCreateStory();
|
|
88
90
|
}, [onPressCreateStory]);
|
|
91
|
+
|
|
89
92
|
const onPressCommunityName = useCallback(() => {
|
|
90
93
|
setViewStory(false);
|
|
91
94
|
navigation.navigate('CommunityProfilePage', {
|
|
@@ -121,12 +124,18 @@ const CommunityStories = ({ communityId, community }: ICommunityStories) => {
|
|
|
121
124
|
height={48}
|
|
122
125
|
xml={storyRing(storyRingColor[0], storyRingColor[1])}
|
|
123
126
|
/>
|
|
124
|
-
{hasStoryPermission
|
|
125
|
-
|
|
126
|
-
style={styles.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
{hasStoryPermission ? (
|
|
128
|
+
storyTarget?.failedStoriesCount > 0 ? (
|
|
129
|
+
<SvgXml style={styles.errorIcon} xml={errorIcon()} />
|
|
130
|
+
) : (
|
|
131
|
+
<TouchableOpacity onPress={() => onPressCreateStory()}>
|
|
132
|
+
<SvgXml
|
|
133
|
+
style={styles.storyCreateIcon}
|
|
134
|
+
xml={storyCircleCreatePlusIcon()}
|
|
135
|
+
/>
|
|
136
|
+
</TouchableOpacity>
|
|
137
|
+
)
|
|
138
|
+
) : null}
|
|
130
139
|
</TouchableOpacity>
|
|
131
140
|
<Typography.Caption style={styles.base}>Story</Typography.Caption>
|
|
132
141
|
</>
|
|
@@ -91,10 +91,15 @@ export const useStyles = () => {
|
|
|
91
91
|
alignItems: 'center',
|
|
92
92
|
width: 68,
|
|
93
93
|
},
|
|
94
|
+
errorIcon: {
|
|
95
|
+
position: 'absolute',
|
|
96
|
+
right: 8,
|
|
97
|
+
bottom: 0,
|
|
98
|
+
},
|
|
94
99
|
storyCreateIcon: {
|
|
95
100
|
position: 'absolute',
|
|
96
|
-
left:
|
|
97
|
-
top:
|
|
101
|
+
left: 8,
|
|
102
|
+
top: -16,
|
|
98
103
|
},
|
|
99
104
|
base: {
|
|
100
105
|
color: theme.colors.base,
|
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
} from '../../../providers/file-provider';
|
|
9
9
|
import { closeIcon, toastIcon } from '../../../svg/svg-xml-list';
|
|
10
10
|
import { useStyles } from './styles';
|
|
11
|
-
import { useTheme } from 'react-native-paper';
|
|
12
|
-
import type { MyMD3Theme } from '../../../providers/amity-ui-kit-provider';
|
|
13
11
|
|
|
14
12
|
interface OverlayImageProps {
|
|
15
13
|
source: string;
|
|
@@ -43,7 +41,6 @@ const LoadingImage = ({
|
|
|
43
41
|
postId,
|
|
44
42
|
setIsUploading,
|
|
45
43
|
}: OverlayImageProps) => {
|
|
46
|
-
const theme = useTheme() as MyMD3Theme;
|
|
47
44
|
const [loading, setLoading] = useState(true);
|
|
48
45
|
const [progress, setProgress] = useState(0);
|
|
49
46
|
const [isProcess, setIsProcess] = useState<boolean>(false);
|
|
@@ -91,6 +88,7 @@ const LoadingImage = ({
|
|
|
91
88
|
} catch (error) {
|
|
92
89
|
handleLoadEnd();
|
|
93
90
|
setIsProcess(false);
|
|
91
|
+
setIsUploading(false);
|
|
94
92
|
setIsUploadError(true);
|
|
95
93
|
onUploadError?.(true, source);
|
|
96
94
|
}
|
|
@@ -167,7 +165,7 @@ const LoadingImage = ({
|
|
|
167
165
|
disabled={(loading || isProcess) && !isUploadError}
|
|
168
166
|
onPress={handleDelete}
|
|
169
167
|
>
|
|
170
|
-
<SvgXml xml={closeIcon(
|
|
168
|
+
<SvgXml xml={closeIcon('white')} width="12" height="12" />
|
|
171
169
|
</TouchableOpacity>
|
|
172
170
|
</View>
|
|
173
171
|
);
|