@amityco/react-native-social-uikit 4.1.1-8facc331.0 → 4.1.1-a509b94.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/social/hooks/useCommunities.js +3 -5
- package/lib/commonjs/social/hooks/useCommunities.js.map +1 -1
- package/lib/module/social/hooks/useCommunities.js +3 -5
- package/lib/module/social/hooks/useCommunities.js.map +1 -1
- package/lib/typescript/social/hooks/useCommunities.d.ts +1 -2
- package/lib/typescript/social/hooks/useCommunities.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/social/hooks/useCommunities.ts +2 -4
|
@@ -9,8 +9,7 @@ var _tsSdkReactNative = require("@amityco/ts-sdk-react-native");
|
|
|
9
9
|
const useCommunities = ({
|
|
10
10
|
categoryId,
|
|
11
11
|
membership = 'member',
|
|
12
|
-
limit = 20
|
|
13
|
-
sortBy = 'displayName'
|
|
12
|
+
limit = 20
|
|
14
13
|
} = {}) => {
|
|
15
14
|
const [communities, setCommunities] = (0, _react.useState)();
|
|
16
15
|
const [loading, setLoading] = (0, _react.useState)(true);
|
|
@@ -19,8 +18,7 @@ const useCommunities = ({
|
|
|
19
18
|
const unsubscribe = _tsSdkReactNative.CommunityRepository.getCommunities({
|
|
20
19
|
membership,
|
|
21
20
|
limit,
|
|
22
|
-
categoryId
|
|
23
|
-
sortBy
|
|
21
|
+
categoryId
|
|
24
22
|
}, ({
|
|
25
23
|
error,
|
|
26
24
|
loading,
|
|
@@ -39,7 +37,7 @@ const useCommunities = ({
|
|
|
39
37
|
setLoading(loading);
|
|
40
38
|
});
|
|
41
39
|
return unsubscribe;
|
|
42
|
-
}, [categoryId, membership, limit
|
|
40
|
+
}, [categoryId, membership, limit]);
|
|
43
41
|
return {
|
|
44
42
|
communities,
|
|
45
43
|
onNextCommunityPage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_tsSdkReactNative","useCommunities","categoryId","membership","limit","
|
|
1
|
+
{"version":3,"names":["_react","require","_tsSdkReactNative","useCommunities","categoryId","membership","limit","communities","setCommunities","useState","loading","setLoading","onNextCommunityPage","setOnNextCommunityPage","useEffect","unsubscribe","CommunityRepository","getCommunities","error","data","hasNextPage","onNextPage","exports"],"sourceRoot":"../../../../src","sources":["social/hooks/useCommunities.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,MAAME,cAAc,GAAGA,CAAC;EAC7BC,UAAU;EACVC,UAAU,GAAG,QAAQ;EACrBC,KAAK,GAAG;AAKV,CAAC,GAAG,CAAC,CAAC,KAAK;EACT,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAC,eAAQ,EAAoB,CAAC;EACnE,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAF,eAAQ,EAAC,IAAI,CAAC;EAC5C,MAAM,CAACG,mBAAmB,EAAEC,sBAAsB,CAAC,GACjD,IAAAJ,eAAQ,EAAoB,IAAI,CAAC;EACnC,IAAAK,gBAAS,EAAC,MAAM;IACd,MAAMC,WAAW,GAAGC,qCAAmB,CAACC,cAAc,CACpD;MAAEZ,UAAU;MAAEC,KAAK;MAAEF;IAAW,CAAC,EACjC,CAAC;MAAEc,KAAK;MAAER,OAAO;MAAES,IAAI;MAAEC,WAAW;MAAEC;IAAW,CAAC,KAAK;MACrD,IAAIH,KAAK,EAAE;MACX,IAAI,CAACR,OAAO,EAAE;QACZF,cAAc,CAACW,IAAI,CAAC;QACpBN,sBAAsB,CAAC,MAAM;UAC3B,IAAIO,WAAW,EAAE,OAAOC,UAAU;UAClC,OAAO,IAAI;QACb,CAAC,CAAC;MACJ;MAEAV,UAAU,CAACD,OAAO,CAAC;IACrB,CACF,CAAC;IACD,OAAOK,WAAW;EACpB,CAAC,EAAE,CAACX,UAAU,EAAEC,UAAU,EAAEC,KAAK,CAAC,CAAC;EACnC,OAAO;IAAEC,WAAW;IAAEK,mBAAmB;IAAEF;EAAQ,CAAC;AACtD,CAAC;AAACY,OAAA,CAAAnB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -3,8 +3,7 @@ import { CommunityRepository } from '@amityco/ts-sdk-react-native';
|
|
|
3
3
|
export const useCommunities = ({
|
|
4
4
|
categoryId,
|
|
5
5
|
membership = 'member',
|
|
6
|
-
limit = 20
|
|
7
|
-
sortBy = 'displayName'
|
|
6
|
+
limit = 20
|
|
8
7
|
} = {}) => {
|
|
9
8
|
const [communities, setCommunities] = useState();
|
|
10
9
|
const [loading, setLoading] = useState(true);
|
|
@@ -13,8 +12,7 @@ export const useCommunities = ({
|
|
|
13
12
|
const unsubscribe = CommunityRepository.getCommunities({
|
|
14
13
|
membership,
|
|
15
14
|
limit,
|
|
16
|
-
categoryId
|
|
17
|
-
sortBy
|
|
15
|
+
categoryId
|
|
18
16
|
}, ({
|
|
19
17
|
error,
|
|
20
18
|
loading,
|
|
@@ -33,7 +31,7 @@ export const useCommunities = ({
|
|
|
33
31
|
setLoading(loading);
|
|
34
32
|
});
|
|
35
33
|
return unsubscribe;
|
|
36
|
-
}, [categoryId, membership, limit
|
|
34
|
+
}, [categoryId, membership, limit]);
|
|
37
35
|
return {
|
|
38
36
|
communities,
|
|
39
37
|
onNextCommunityPage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","CommunityRepository","useCommunities","categoryId","membership","limit","
|
|
1
|
+
{"version":3,"names":["useEffect","useState","CommunityRepository","useCommunities","categoryId","membership","limit","communities","setCommunities","loading","setLoading","onNextCommunityPage","setOnNextCommunityPage","unsubscribe","getCommunities","error","data","hasNextPage","onNextPage"],"sourceRoot":"../../../../src","sources":["social/hooks/useCommunities.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,mBAAmB,QAAQ,8BAA8B;AAElE,OAAO,MAAMC,cAAc,GAAGA,CAAC;EAC7BC,UAAU;EACVC,UAAU,GAAG,QAAQ;EACrBC,KAAK,GAAG;AAKV,CAAC,GAAG,CAAC,CAAC,KAAK;EACT,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGP,QAAQ,CAAoB,CAAC;EACnE,MAAM,CAACQ,OAAO,EAAEC,UAAU,CAAC,GAAGT,QAAQ,CAAC,IAAI,CAAC;EAC5C,MAAM,CAACU,mBAAmB,EAAEC,sBAAsB,CAAC,GACjDX,QAAQ,CAAoB,IAAI,CAAC;EACnCD,SAAS,CAAC,MAAM;IACd,MAAMa,WAAW,GAAGX,mBAAmB,CAACY,cAAc,CACpD;MAAET,UAAU;MAAEC,KAAK;MAAEF;IAAW,CAAC,EACjC,CAAC;MAAEW,KAAK;MAAEN,OAAO;MAAEO,IAAI;MAAEC,WAAW;MAAEC;IAAW,CAAC,KAAK;MACrD,IAAIH,KAAK,EAAE;MACX,IAAI,CAACN,OAAO,EAAE;QACZD,cAAc,CAACQ,IAAI,CAAC;QACpBJ,sBAAsB,CAAC,MAAM;UAC3B,IAAIK,WAAW,EAAE,OAAOC,UAAU;UAClC,OAAO,IAAI;QACb,CAAC,CAAC;MACJ;MAEAR,UAAU,CAACD,OAAO,CAAC;IACrB,CACF,CAAC;IACD,OAAOI,WAAW;EACpB,CAAC,EAAE,CAACT,UAAU,EAAEC,UAAU,EAAEC,KAAK,CAAC,CAAC;EACnC,OAAO;IAAEC,WAAW;IAAEI,mBAAmB;IAAEF;EAAQ,CAAC;AACtD,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export declare const useCommunities: ({ categoryId, membership, limit,
|
|
1
|
+
export declare const useCommunities: ({ categoryId, membership, limit, }?: {
|
|
2
2
|
membership?: "all" | "member" | "notMember";
|
|
3
3
|
categoryId?: string;
|
|
4
4
|
limit?: number;
|
|
5
|
-
sortBy?: Amity.CommunitySortBy;
|
|
6
5
|
}) => {
|
|
7
6
|
communities: Amity.Community[];
|
|
8
7
|
onNextCommunityPage: () => void | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCommunities.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/useCommunities.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,GAAI,
|
|
1
|
+
{"version":3,"file":"useCommunities.d.ts","sourceRoot":"","sources":["../../../../src/social/hooks/useCommunities.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,GAAI,qCAI5B;IACD,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CACX;;+BAIa,IAAI,GAAG,IAAI;;CAoB7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -5,12 +5,10 @@ export const useCommunities = ({
|
|
|
5
5
|
categoryId,
|
|
6
6
|
membership = 'member',
|
|
7
7
|
limit = 20,
|
|
8
|
-
sortBy = 'displayName',
|
|
9
8
|
}: {
|
|
10
9
|
membership?: 'all' | 'member' | 'notMember';
|
|
11
10
|
categoryId?: string;
|
|
12
11
|
limit?: number;
|
|
13
|
-
sortBy?: Amity.CommunitySortBy;
|
|
14
12
|
} = {}) => {
|
|
15
13
|
const [communities, setCommunities] = useState<Amity.Community[]>();
|
|
16
14
|
const [loading, setLoading] = useState(true);
|
|
@@ -18,7 +16,7 @@ export const useCommunities = ({
|
|
|
18
16
|
useState<() => void | null>(null);
|
|
19
17
|
useEffect(() => {
|
|
20
18
|
const unsubscribe = CommunityRepository.getCommunities(
|
|
21
|
-
{ membership, limit, categoryId
|
|
19
|
+
{ membership, limit, categoryId },
|
|
22
20
|
({ error, loading, data, hasNextPage, onNextPage }) => {
|
|
23
21
|
if (error) return;
|
|
24
22
|
if (!loading) {
|
|
@@ -33,6 +31,6 @@ export const useCommunities = ({
|
|
|
33
31
|
}
|
|
34
32
|
);
|
|
35
33
|
return unsubscribe;
|
|
36
|
-
}, [categoryId, membership, limit
|
|
34
|
+
}, [categoryId, membership, limit]);
|
|
37
35
|
return { communities, onNextCommunityPage, loading };
|
|
38
36
|
};
|