@selfcommunity/react-core 0.4.9-alpha.42 → 0.4.9-alpha.44
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/cjs/components/provider/SCContextProvider/index.d.ts +2 -3
- package/lib/cjs/components/provider/SCContextProvider/index.js +2 -3
- package/lib/cjs/hooks/useSCFetchCategories.d.ts +1 -2
- package/lib/cjs/hooks/useSCFetchCategories.js +3 -11
- package/lib/cjs/hooks/useSCFetchCommentObject.d.ts +2 -3
- package/lib/cjs/hooks/useSCFetchCommentObject.js +2 -3
- package/lib/cjs/hooks/useSCFetchCommentObjects.d.ts +1 -7
- package/lib/cjs/hooks/useSCFetchCommentObjects.js +1 -8
- package/lib/cjs/hooks/useSCFetchContributors.d.ts +1 -5
- package/lib/cjs/hooks/useSCFetchContributors.js +1 -5
- package/lib/cjs/hooks/useSCFetchCustomAdv.d.ts +3 -3
- package/lib/cjs/hooks/useSCFetchCustomAdv.js +3 -3
- package/lib/cjs/hooks/useSCFetchFeed.d.ts +1 -5
- package/lib/cjs/hooks/useSCFetchFeed.js +1 -5
- package/lib/cjs/hooks/useSCFetchUser.d.ts +2 -3
- package/lib/cjs/hooks/useSCFetchUser.js +2 -3
- package/lib/cjs/hooks/useSCFetchUserBlockedBy.d.ts +1 -0
- package/lib/cjs/hooks/useSCFetchUserBlockedBy.js +1 -0
- package/lib/cjs/hooks/useSCFetchUserProviders.d.ts +2 -3
- package/lib/cjs/hooks/useSCFetchUserProviders.js +2 -3
- package/lib/esm/components/provider/SCContextProvider/index.d.ts +2 -3
- package/lib/esm/components/provider/SCContextProvider/index.js +2 -3
- package/lib/esm/hooks/useSCFetchCategories.d.ts +1 -2
- package/lib/esm/hooks/useSCFetchCategories.js +4 -12
- package/lib/esm/hooks/useSCFetchCommentObject.d.ts +2 -3
- package/lib/esm/hooks/useSCFetchCommentObject.js +2 -3
- package/lib/esm/hooks/useSCFetchCommentObjects.d.ts +1 -7
- package/lib/esm/hooks/useSCFetchCommentObjects.js +1 -8
- package/lib/esm/hooks/useSCFetchContributors.d.ts +1 -5
- package/lib/esm/hooks/useSCFetchContributors.js +1 -5
- package/lib/esm/hooks/useSCFetchCustomAdv.d.ts +3 -3
- package/lib/esm/hooks/useSCFetchCustomAdv.js +3 -3
- package/lib/esm/hooks/useSCFetchFeed.d.ts +1 -5
- package/lib/esm/hooks/useSCFetchFeed.js +1 -5
- package/lib/esm/hooks/useSCFetchUser.d.ts +2 -3
- package/lib/esm/hooks/useSCFetchUser.js +2 -3
- package/lib/esm/hooks/useSCFetchUserBlockedBy.d.ts +1 -0
- package/lib/esm/hooks/useSCFetchUserBlockedBy.js +1 -0
- package/lib/esm/hooks/useSCFetchUserProviders.d.ts +2 -3
- package/lib/esm/hooks/useSCFetchUserProviders.js +2 -3
- package/lib/umd/react-core.js +1 -1
- package/package.json +3 -3
|
@@ -18,9 +18,8 @@ import { SCContextProviderType, SCContextType } from '../../../types';
|
|
|
18
18
|
export declare const SCContext: React.Context<SCContextType>;
|
|
19
19
|
/**
|
|
20
20
|
* This component imports all providers
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param object.children
|
|
21
|
+
* @param conf
|
|
22
|
+
* @param children
|
|
24
23
|
* @return
|
|
25
24
|
* ```jsx
|
|
26
25
|
* <SCContext.Provider value={{settings}}>
|
|
@@ -25,9 +25,8 @@ const useIsComponentMountedRef_1 = tslib_1.__importDefault(require("../../../uti
|
|
|
25
25
|
exports.SCContext = (0, react_1.createContext)({});
|
|
26
26
|
/**
|
|
27
27
|
* This component imports all providers
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @param object.children
|
|
28
|
+
* @param conf
|
|
29
|
+
* @param children
|
|
31
30
|
* @return
|
|
32
31
|
* ```jsx
|
|
33
32
|
* <SCContext.Provider value={{settings}}>
|
|
@@ -3,8 +3,6 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
3
3
|
/**
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch categories.
|
|
6
|
-
@param object
|
|
7
|
-
@param object.cacheStrategy
|
|
8
6
|
|
|
9
7
|
:::tip Context can be consumed in this way:
|
|
10
8
|
|
|
@@ -12,6 +10,7 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
12
10
|
const {categories, isLoading} = useSCFetchCategories();
|
|
13
11
|
```
|
|
14
12
|
:::
|
|
13
|
+
* @param props
|
|
15
14
|
*/
|
|
16
15
|
declare const useSCFetchCategories: (props?: {
|
|
17
16
|
cacheStrategy?: CacheStrategies;
|
|
@@ -25,8 +25,6 @@ const hydrate = (ids) => {
|
|
|
25
25
|
/**
|
|
26
26
|
:::info
|
|
27
27
|
This custom hook is used to fetch categories.
|
|
28
|
-
@param object
|
|
29
|
-
@param object.cacheStrategy
|
|
30
28
|
|
|
31
29
|
:::tip Context can be consumed in this way:
|
|
32
30
|
|
|
@@ -34,6 +32,7 @@ const hydrate = (ids) => {
|
|
|
34
32
|
const {categories, isLoading} = useSCFetchCategories();
|
|
35
33
|
```
|
|
36
34
|
:::
|
|
35
|
+
* @param props
|
|
37
36
|
*/
|
|
38
37
|
const useSCFetchCategories = (props) => {
|
|
39
38
|
// PROPS
|
|
@@ -47,15 +46,8 @@ const useSCFetchCategories = (props) => {
|
|
|
47
46
|
* Fetch categories
|
|
48
47
|
*/
|
|
49
48
|
const fetchCategories = (next = api_services_1.Endpoints.CategoryList.url()) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
method: api_services_1.Endpoints.CategoryList.method,
|
|
53
|
-
});
|
|
54
|
-
const data = response.data;
|
|
55
|
-
if (data.next) {
|
|
56
|
-
return data.results.concat(yield fetchCategories(data.next));
|
|
57
|
-
}
|
|
58
|
-
return data.results;
|
|
49
|
+
const data = yield api_services_1.CategoryService.getAllCategories({ active: true }, { url: next });
|
|
50
|
+
return data.next ? data.results.concat(yield fetchCategories(data.next)) : data.results;
|
|
59
51
|
});
|
|
60
52
|
/**
|
|
61
53
|
* Get categories
|
|
@@ -5,9 +5,8 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hooks is used to fetch a comment.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param object.commentObject
|
|
8
|
+
* @param id
|
|
9
|
+
* @param commentObject
|
|
11
10
|
* @param cacheStrategy
|
|
12
11
|
*/
|
|
13
12
|
export default function useSCFetchCommentObject({ id, commentObject, cacheStrategy, }: {
|
|
@@ -10,9 +10,8 @@ const use_deep_compare_effect_1 = require("use-deep-compare-effect");
|
|
|
10
10
|
:::info
|
|
11
11
|
This custom hooks is used to fetch a comment.
|
|
12
12
|
:::
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param object.commentObject
|
|
13
|
+
* @param id
|
|
14
|
+
* @param commentObject
|
|
16
15
|
* @param cacheStrategy
|
|
17
16
|
*/
|
|
18
17
|
function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
@@ -34,13 +34,7 @@ export declare const commentsObjectActionTypes: {
|
|
|
34
34
|
:::info
|
|
35
35
|
This custom hooks is used to fetch paginated comments.
|
|
36
36
|
:::
|
|
37
|
-
* @param
|
|
38
|
-
* @param feedObject
|
|
39
|
-
* @param feedObjectType
|
|
40
|
-
* @param offset
|
|
41
|
-
* @param pageSize
|
|
42
|
-
* @param orderBy
|
|
43
|
-
* @param parent
|
|
37
|
+
* @param props
|
|
44
38
|
*/
|
|
45
39
|
export default function useSCFetchCommentObjects(props: {
|
|
46
40
|
id?: number;
|
|
@@ -98,20 +98,13 @@ function stateInitializer(data) {
|
|
|
98
98
|
:::info
|
|
99
99
|
This custom hooks is used to fetch paginated comments.
|
|
100
100
|
:::
|
|
101
|
-
* @param
|
|
102
|
-
* @param feedObject
|
|
103
|
-
* @param feedObjectType
|
|
104
|
-
* @param offset
|
|
105
|
-
* @param pageSize
|
|
106
|
-
* @param orderBy
|
|
107
|
-
* @param parent
|
|
101
|
+
* @param props
|
|
108
102
|
*/
|
|
109
103
|
function useSCFetchCommentObjects(props) {
|
|
110
104
|
// PROPS
|
|
111
105
|
const { id, feedObject, feedObjectType, offset = 0, pageSize = 5, orderBy = types_1.SCCommentsOrderBy.ADDED_AT_DESC, parent, onChangePage, cacheStrategy = utils_1.CacheStrategies.NETWORK_ONLY, } = props;
|
|
112
106
|
// FeedObject
|
|
113
107
|
const { obj, setObj } = (0, useSCFetchFeedObject_1.default)({ id, feedObject, feedObjectType, cacheStrategy });
|
|
114
|
-
const objId = obj ? obj.id : null;
|
|
115
108
|
/**
|
|
116
109
|
* Get next url
|
|
117
110
|
*/
|
|
@@ -33,11 +33,7 @@ export declare const contributorsObjectActionTypes: {
|
|
|
33
33
|
:::info
|
|
34
34
|
This custom hooks is used to fetch paginated contributors.
|
|
35
35
|
:::
|
|
36
|
-
* @param
|
|
37
|
-
* @param feedObject
|
|
38
|
-
* @param feedObjectType
|
|
39
|
-
* @param offset
|
|
40
|
-
* @param pageSize
|
|
36
|
+
* @param props
|
|
41
37
|
*/
|
|
42
38
|
export default function useSCFetchContributors(props: {
|
|
43
39
|
id?: number;
|
|
@@ -76,11 +76,7 @@ function stateInitializer(data) {
|
|
|
76
76
|
:::info
|
|
77
77
|
This custom hooks is used to fetch paginated contributors.
|
|
78
78
|
:::
|
|
79
|
-
* @param
|
|
80
|
-
* @param feedObject
|
|
81
|
-
* @param feedObjectType
|
|
82
|
-
* @param offset
|
|
83
|
-
* @param pageSize
|
|
79
|
+
* @param props
|
|
84
80
|
*/
|
|
85
81
|
function useSCFetchContributors(props) {
|
|
86
82
|
// PROPS
|
|
@@ -5,9 +5,9 @@ import { SCCustomAdvPosition, SCCustomAdvType } from '@selfcommunity/types';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hook is used to fetch a custom adv object.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
8
|
+
* @param id
|
|
9
|
+
* @param position
|
|
10
|
+
* @param categoriesId
|
|
11
11
|
* @param cacheStrategy
|
|
12
12
|
*/
|
|
13
13
|
export default function useSCFetchCustomAdv({ id, position, categoriesId, cacheStrategy, }: {
|
|
@@ -11,9 +11,9 @@ const Cache_1 = require("../constants/Cache");
|
|
|
11
11
|
:::info
|
|
12
12
|
This custom hook is used to fetch a custom adv object.
|
|
13
13
|
:::
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
14
|
+
* @param id
|
|
15
|
+
* @param position
|
|
16
|
+
* @param categoriesId
|
|
17
17
|
* @param cacheStrategy
|
|
18
18
|
*/
|
|
19
19
|
function useSCFetchCustomAdv({ id = null, position = null, categoriesId = null, cacheStrategy = utils_1.CacheStrategies.CACHE_FIRST, }) {
|
|
@@ -38,11 +38,7 @@ export declare const feedDataActionTypes: {
|
|
|
38
38
|
:::info
|
|
39
39
|
This custom hooks is used to fetch paginated Data.
|
|
40
40
|
:::
|
|
41
|
-
* @param
|
|
42
|
-
* @param offset
|
|
43
|
-
* @param pageSize
|
|
44
|
-
* @param onChangePage
|
|
45
|
-
* @param cacheStrategy
|
|
41
|
+
* @param props
|
|
46
42
|
*/
|
|
47
43
|
export default function useSCFetchFeed(props: {
|
|
48
44
|
id: string;
|
|
@@ -90,11 +90,7 @@ function stateInitializer(data) {
|
|
|
90
90
|
:::info
|
|
91
91
|
This custom hooks is used to fetch paginated Data.
|
|
92
92
|
:::
|
|
93
|
-
* @param
|
|
94
|
-
* @param offset
|
|
95
|
-
* @param pageSize
|
|
96
|
-
* @param onChangePage
|
|
97
|
-
* @param cacheStrategy
|
|
93
|
+
* @param props
|
|
98
94
|
*/
|
|
99
95
|
function useSCFetchFeed(props) {
|
|
100
96
|
// PROPS
|
|
@@ -4,9 +4,8 @@ import { SCUserType } from '@selfcommunity/types';
|
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch a user object.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param object.user
|
|
7
|
+
* @param id
|
|
8
|
+
* @param user
|
|
10
9
|
*/
|
|
11
10
|
export default function useSCFetchUser({ id, user }: {
|
|
12
11
|
id?: number | string;
|
|
@@ -9,9 +9,8 @@ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
|
9
9
|
:::info
|
|
10
10
|
This custom hook is used to fetch a user object.
|
|
11
11
|
:::
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param object.user
|
|
12
|
+
* @param id
|
|
13
|
+
* @param user
|
|
15
14
|
*/
|
|
16
15
|
function useSCFetchUser({ id = null, user = null }) {
|
|
17
16
|
// CONTEXT
|
|
@@ -11,6 +11,7 @@ const SCUserProvider_1 = require("../components/provider/SCUserProvider");
|
|
|
11
11
|
:::
|
|
12
12
|
* @param user
|
|
13
13
|
* @param blockedByUser
|
|
14
|
+
* @param sync
|
|
14
15
|
*/
|
|
15
16
|
function useSCFetchUserBlockedBy({ user = null, blockedByUser = null, sync = true, }) {
|
|
16
17
|
const [blockedBy, setBlockedBy] = (0, react_1.useState)(null);
|
|
@@ -4,9 +4,8 @@ import { SCUserProviderAssociationType } from '@selfcommunity/types';
|
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch the listo of user providers.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param object.user
|
|
7
|
+
* @param id
|
|
8
|
+
* @param providers
|
|
10
9
|
*/
|
|
11
10
|
export default function useSCFetchUserProviders({ id, providers }: {
|
|
12
11
|
id: number | string;
|
|
@@ -8,9 +8,8 @@ const utils_1 = require("@selfcommunity/utils");
|
|
|
8
8
|
:::info
|
|
9
9
|
This custom hook is used to fetch the listo of user providers.
|
|
10
10
|
:::
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param object.user
|
|
11
|
+
* @param id
|
|
12
|
+
* @param providers
|
|
14
13
|
*/
|
|
15
14
|
function useSCFetchUserProviders({ id, providers = null }) {
|
|
16
15
|
const [scUserProviders, setSCUserProviders] = (0, react_1.useState)(providers || []);
|
|
@@ -18,9 +18,8 @@ import { SCContextProviderType, SCContextType } from '../../../types';
|
|
|
18
18
|
export declare const SCContext: React.Context<SCContextType>;
|
|
19
19
|
/**
|
|
20
20
|
* This component imports all providers
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param object.children
|
|
21
|
+
* @param conf
|
|
22
|
+
* @param children
|
|
24
23
|
* @return
|
|
25
24
|
* ```jsx
|
|
26
25
|
* <SCContext.Provider value={{settings}}>
|
|
@@ -21,9 +21,8 @@ import useIsComponentMountedRef from '../../../utils/hooks/useIsComponentMounted
|
|
|
21
21
|
export const SCContext = createContext({});
|
|
22
22
|
/**
|
|
23
23
|
* This component imports all providers
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param object.children
|
|
24
|
+
* @param conf
|
|
25
|
+
* @param children
|
|
27
26
|
* @return
|
|
28
27
|
* ```jsx
|
|
29
28
|
* <SCContext.Provider value={{settings}}>
|
|
@@ -3,8 +3,6 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
3
3
|
/**
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch categories.
|
|
6
|
-
@param object
|
|
7
|
-
@param object.cacheStrategy
|
|
8
6
|
|
|
9
7
|
:::tip Context can be consumed in this way:
|
|
10
8
|
|
|
@@ -12,6 +10,7 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
12
10
|
const {categories, isLoading} = useSCFetchCategories();
|
|
13
11
|
```
|
|
14
12
|
:::
|
|
13
|
+
* @param props
|
|
15
14
|
*/
|
|
16
15
|
declare const useSCFetchCategories: (props?: {
|
|
17
16
|
cacheStrategy?: CacheStrategies;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { SCOPE_SC_CORE } from '../constants/Errors';
|
|
4
|
-
import {
|
|
4
|
+
import { CategoryService, Endpoints } from '@selfcommunity/api-services';
|
|
5
5
|
import { CacheStrategies, Logger, LRUCache } from '@selfcommunity/utils';
|
|
6
6
|
import { getCategoriesObjectCacheKey, getCategoryObjectCacheKey } from '../constants/Cache';
|
|
7
7
|
const init = { categories: [], isLoading: true };
|
|
@@ -23,8 +23,6 @@ const hydrate = (ids) => {
|
|
|
23
23
|
/**
|
|
24
24
|
:::info
|
|
25
25
|
This custom hook is used to fetch categories.
|
|
26
|
-
@param object
|
|
27
|
-
@param object.cacheStrategy
|
|
28
26
|
|
|
29
27
|
:::tip Context can be consumed in this way:
|
|
30
28
|
|
|
@@ -32,6 +30,7 @@ const hydrate = (ids) => {
|
|
|
32
30
|
const {categories, isLoading} = useSCFetchCategories();
|
|
33
31
|
```
|
|
34
32
|
:::
|
|
33
|
+
* @param props
|
|
35
34
|
*/
|
|
36
35
|
const useSCFetchCategories = (props) => {
|
|
37
36
|
// PROPS
|
|
@@ -45,15 +44,8 @@ const useSCFetchCategories = (props) => {
|
|
|
45
44
|
* Fetch categories
|
|
46
45
|
*/
|
|
47
46
|
const fetchCategories = (next = Endpoints.CategoryList.url()) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
method: Endpoints.CategoryList.method,
|
|
51
|
-
});
|
|
52
|
-
const data = response.data;
|
|
53
|
-
if (data.next) {
|
|
54
|
-
return data.results.concat(yield fetchCategories(data.next));
|
|
55
|
-
}
|
|
56
|
-
return data.results;
|
|
47
|
+
const data = yield CategoryService.getAllCategories({ active: true }, { url: next });
|
|
48
|
+
return data.next ? data.results.concat(yield fetchCategories(data.next)) : data.results;
|
|
57
49
|
});
|
|
58
50
|
/**
|
|
59
51
|
* Get categories
|
|
@@ -5,9 +5,8 @@ import { CacheStrategies } from '@selfcommunity/utils';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hooks is used to fetch a comment.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param object.commentObject
|
|
8
|
+
* @param id
|
|
9
|
+
* @param commentObject
|
|
11
10
|
* @param cacheStrategy
|
|
12
11
|
*/
|
|
13
12
|
export default function useSCFetchCommentObject({ id, commentObject, cacheStrategy, }: {
|
|
@@ -8,9 +8,8 @@ import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect';
|
|
|
8
8
|
:::info
|
|
9
9
|
This custom hooks is used to fetch a comment.
|
|
10
10
|
:::
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param object.commentObject
|
|
11
|
+
* @param id
|
|
12
|
+
* @param commentObject
|
|
14
13
|
* @param cacheStrategy
|
|
15
14
|
*/
|
|
16
15
|
export default function useSCFetchCommentObject({ id = null, commentObject = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
|
|
@@ -34,13 +34,7 @@ export declare const commentsObjectActionTypes: {
|
|
|
34
34
|
:::info
|
|
35
35
|
This custom hooks is used to fetch paginated comments.
|
|
36
36
|
:::
|
|
37
|
-
* @param
|
|
38
|
-
* @param feedObject
|
|
39
|
-
* @param feedObjectType
|
|
40
|
-
* @param offset
|
|
41
|
-
* @param pageSize
|
|
42
|
-
* @param orderBy
|
|
43
|
-
* @param parent
|
|
37
|
+
* @param props
|
|
44
38
|
*/
|
|
45
39
|
export default function useSCFetchCommentObjects(props: {
|
|
46
40
|
id?: number;
|
|
@@ -94,20 +94,13 @@ function stateInitializer(data) {
|
|
|
94
94
|
:::info
|
|
95
95
|
This custom hooks is used to fetch paginated comments.
|
|
96
96
|
:::
|
|
97
|
-
* @param
|
|
98
|
-
* @param feedObject
|
|
99
|
-
* @param feedObjectType
|
|
100
|
-
* @param offset
|
|
101
|
-
* @param pageSize
|
|
102
|
-
* @param orderBy
|
|
103
|
-
* @param parent
|
|
97
|
+
* @param props
|
|
104
98
|
*/
|
|
105
99
|
export default function useSCFetchCommentObjects(props) {
|
|
106
100
|
// PROPS
|
|
107
101
|
const { id, feedObject, feedObjectType, offset = 0, pageSize = 5, orderBy = SCCommentsOrderBy.ADDED_AT_DESC, parent, onChangePage, cacheStrategy = CacheStrategies.NETWORK_ONLY, } = props;
|
|
108
102
|
// FeedObject
|
|
109
103
|
const { obj, setObj } = useSCFetchFeedObject({ id, feedObject, feedObjectType, cacheStrategy });
|
|
110
|
-
const objId = obj ? obj.id : null;
|
|
111
104
|
/**
|
|
112
105
|
* Get next url
|
|
113
106
|
*/
|
|
@@ -33,11 +33,7 @@ export declare const contributorsObjectActionTypes: {
|
|
|
33
33
|
:::info
|
|
34
34
|
This custom hooks is used to fetch paginated contributors.
|
|
35
35
|
:::
|
|
36
|
-
* @param
|
|
37
|
-
* @param feedObject
|
|
38
|
-
* @param feedObjectType
|
|
39
|
-
* @param offset
|
|
40
|
-
* @param pageSize
|
|
36
|
+
* @param props
|
|
41
37
|
*/
|
|
42
38
|
export default function useSCFetchContributors(props: {
|
|
43
39
|
id?: number;
|
|
@@ -72,11 +72,7 @@ function stateInitializer(data) {
|
|
|
72
72
|
:::info
|
|
73
73
|
This custom hooks is used to fetch paginated contributors.
|
|
74
74
|
:::
|
|
75
|
-
* @param
|
|
76
|
-
* @param feedObject
|
|
77
|
-
* @param feedObjectType
|
|
78
|
-
* @param offset
|
|
79
|
-
* @param pageSize
|
|
75
|
+
* @param props
|
|
80
76
|
*/
|
|
81
77
|
export default function useSCFetchContributors(props) {
|
|
82
78
|
// PROPS
|
|
@@ -5,9 +5,9 @@ import { SCCustomAdvPosition, SCCustomAdvType } from '@selfcommunity/types';
|
|
|
5
5
|
:::info
|
|
6
6
|
This custom hook is used to fetch a custom adv object.
|
|
7
7
|
:::
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
8
|
+
* @param id
|
|
9
|
+
* @param position
|
|
10
|
+
* @param categoriesId
|
|
11
11
|
* @param cacheStrategy
|
|
12
12
|
*/
|
|
13
13
|
export default function useSCFetchCustomAdv({ id, position, categoriesId, cacheStrategy, }: {
|
|
@@ -8,9 +8,9 @@ import { getAdvObjectCacheKey } from '../constants/Cache';
|
|
|
8
8
|
:::info
|
|
9
9
|
This custom hook is used to fetch a custom adv object.
|
|
10
10
|
:::
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
11
|
+
* @param id
|
|
12
|
+
* @param position
|
|
13
|
+
* @param categoriesId
|
|
14
14
|
* @param cacheStrategy
|
|
15
15
|
*/
|
|
16
16
|
export default function useSCFetchCustomAdv({ id = null, position = null, categoriesId = null, cacheStrategy = CacheStrategies.CACHE_FIRST, }) {
|
|
@@ -38,11 +38,7 @@ export declare const feedDataActionTypes: {
|
|
|
38
38
|
:::info
|
|
39
39
|
This custom hooks is used to fetch paginated Data.
|
|
40
40
|
:::
|
|
41
|
-
* @param
|
|
42
|
-
* @param offset
|
|
43
|
-
* @param pageSize
|
|
44
|
-
* @param onChangePage
|
|
45
|
-
* @param cacheStrategy
|
|
41
|
+
* @param props
|
|
46
42
|
*/
|
|
47
43
|
export default function useSCFetchFeed(props: {
|
|
48
44
|
id: string;
|
|
@@ -86,11 +86,7 @@ function stateInitializer(data) {
|
|
|
86
86
|
:::info
|
|
87
87
|
This custom hooks is used to fetch paginated Data.
|
|
88
88
|
:::
|
|
89
|
-
* @param
|
|
90
|
-
* @param offset
|
|
91
|
-
* @param pageSize
|
|
92
|
-
* @param onChangePage
|
|
93
|
-
* @param cacheStrategy
|
|
89
|
+
* @param props
|
|
94
90
|
*/
|
|
95
91
|
export default function useSCFetchFeed(props) {
|
|
96
92
|
// PROPS
|
|
@@ -4,9 +4,8 @@ import { SCUserType } from '@selfcommunity/types';
|
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch a user object.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param object.user
|
|
7
|
+
* @param id
|
|
8
|
+
* @param user
|
|
10
9
|
*/
|
|
11
10
|
export default function useSCFetchUser({ id, user }: {
|
|
12
11
|
id?: number | string;
|
|
@@ -7,9 +7,8 @@ import { useSCUser } from '../components/provider/SCUserProvider';
|
|
|
7
7
|
:::info
|
|
8
8
|
This custom hook is used to fetch a user object.
|
|
9
9
|
:::
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param object.user
|
|
10
|
+
* @param id
|
|
11
|
+
* @param user
|
|
13
12
|
*/
|
|
14
13
|
export default function useSCFetchUser({ id = null, user = null }) {
|
|
15
14
|
// CONTEXT
|
|
@@ -9,6 +9,7 @@ import { useSCUser } from '../components/provider/SCUserProvider';
|
|
|
9
9
|
:::
|
|
10
10
|
* @param user
|
|
11
11
|
* @param blockedByUser
|
|
12
|
+
* @param sync
|
|
12
13
|
*/
|
|
13
14
|
export default function useSCFetchUserBlockedBy({ user = null, blockedByUser = null, sync = true, }) {
|
|
14
15
|
const [blockedBy, setBlockedBy] = useState(null);
|
|
@@ -4,9 +4,8 @@ import { SCUserProviderAssociationType } from '@selfcommunity/types';
|
|
|
4
4
|
:::info
|
|
5
5
|
This custom hook is used to fetch the listo of user providers.
|
|
6
6
|
:::
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param object.user
|
|
7
|
+
* @param id
|
|
8
|
+
* @param providers
|
|
10
9
|
*/
|
|
11
10
|
export default function useSCFetchUserProviders({ id, providers }: {
|
|
12
11
|
id: number | string;
|
|
@@ -6,9 +6,8 @@ import { Logger } from '@selfcommunity/utils';
|
|
|
6
6
|
:::info
|
|
7
7
|
This custom hook is used to fetch the listo of user providers.
|
|
8
8
|
:::
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param object.user
|
|
9
|
+
* @param id
|
|
10
|
+
* @param providers
|
|
12
11
|
*/
|
|
13
12
|
export default function useSCFetchUserProviders({ id, providers = null }) {
|
|
14
13
|
const [scUserProviders, setSCUserProviders] = useState(providers || []);
|