@ludo.ninja/components 2.2.8 → 2.2.9
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { searchSchema as schema } from '@ludo.ninja/api';
|
|
2
1
|
import { DefaultsCollectionsSearchPageProps, DefaultsNftSearchPageProps } from '../../api/server-preferences/queries/fetchSearchResultSelections/queryData';
|
|
2
|
+
import { searchSchema as schema } from "@ludo.ninja/api";
|
|
3
3
|
export declare const useSearchFiltersConnector: <TFilterInput extends schema.ICreationFilterInput | schema.ICollectionFilterInput = schema.ICreationFilterInput>({ defaults, isDisabledTypeFilters, isMobile, }: {
|
|
4
4
|
defaults: DefaultsNftSearchPageProps | DefaultsCollectionsSearchPageProps;
|
|
5
5
|
isDisabledTypeFilters?: boolean;
|
|
@@ -5,17 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.useSearchFiltersConnector = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const router_1 = require("next/router");
|
|
10
|
-
const fetchSearchResultSelections_1 = require("../../api/server-preferences/queries/fetchSearchResultSelections");
|
|
11
8
|
const filters_1 = __importDefault(require("./filters"));
|
|
9
|
+
const fetchSearchResultSelections_1 = require("../../api/server-preferences/queries/fetchSearchResultSelections");
|
|
10
|
+
const router_1 = require("next/router");
|
|
11
|
+
const react_1 = require("react");
|
|
12
12
|
const useSearchFiltersConnector = function ({ defaults, isDisabledTypeFilters, isMobile, }) {
|
|
13
13
|
const defaultCopyWithoutTerm = {
|
|
14
14
|
time: defaults.time,
|
|
15
15
|
blockchain: defaults.blockchain,
|
|
16
16
|
category: defaults.category,
|
|
17
17
|
status: defaults.status,
|
|
18
|
-
...(
|
|
18
|
+
...("type" in defaults
|
|
19
19
|
? {
|
|
20
20
|
type: defaults.type,
|
|
21
21
|
}
|
|
@@ -53,9 +53,7 @@ const useSearchFiltersConnector = function ({ defaults, isDisabledTypeFilters, i
|
|
|
53
53
|
const handleResetFilter = () => {
|
|
54
54
|
if (searchResultSelections) {
|
|
55
55
|
const filterInitialStateNft = {
|
|
56
|
-
...(isDisabledTypeFilters
|
|
57
|
-
? {}
|
|
58
|
-
: { type: searchResultSelections.typeSelections[0]?.id }),
|
|
56
|
+
...(isDisabledTypeFilters ? {} : { type: searchResultSelections.typeSelections[0]?.id }),
|
|
59
57
|
time: searchResultSelections.timeSelections[0]?.id,
|
|
60
58
|
blockchain: searchResultSelections.blockchainSelections[0]?.id,
|
|
61
59
|
category: searchResultSelections.categorySelections[0]?.id,
|
|
@@ -72,49 +70,46 @@ const useSearchFiltersConnector = function ({ defaults, isDisabledTypeFilters, i
|
|
|
72
70
|
};
|
|
73
71
|
return {
|
|
74
72
|
filterInput,
|
|
75
|
-
renderFilters: !!(filterInput.time ||
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
]
|
|
89
|
-
: []),
|
|
73
|
+
renderFilters: !!(filterInput.time || filterInput.status || filterInput.category || filterInput.blockchain) ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: searchResultSelections && ((0, jsx_runtime_1.jsx)(filters_1.default, { filterInput: filterInput, selectData: [
|
|
74
|
+
// ...(!isDisabledTypeFilters
|
|
75
|
+
// ? [
|
|
76
|
+
// {
|
|
77
|
+
// id: 1,
|
|
78
|
+
// data: {
|
|
79
|
+
// selectName: 'type',
|
|
80
|
+
// selectOptions: searchResultSelections.typeSelections,
|
|
81
|
+
// },
|
|
82
|
+
// },
|
|
83
|
+
// ]
|
|
84
|
+
// : []),
|
|
90
85
|
{
|
|
91
86
|
id: 2,
|
|
92
87
|
data: {
|
|
93
|
-
selectName:
|
|
88
|
+
selectName: "blockchain",
|
|
94
89
|
selectOptions: searchResultSelections.blockchainSelections,
|
|
95
90
|
},
|
|
96
91
|
},
|
|
97
92
|
{
|
|
98
93
|
id: 3,
|
|
99
94
|
data: {
|
|
100
|
-
selectName:
|
|
95
|
+
selectName: "category",
|
|
101
96
|
selectOptions: searchResultSelections.categorySelections,
|
|
102
97
|
},
|
|
103
98
|
},
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
},
|
|
99
|
+
// {
|
|
100
|
+
// id: 4,
|
|
101
|
+
// data: {
|
|
102
|
+
// selectName: 'time',
|
|
103
|
+
// selectOptions: searchResultSelections.timeSelections,
|
|
104
|
+
// },
|
|
105
|
+
// },
|
|
106
|
+
// {
|
|
107
|
+
// id: 5,
|
|
108
|
+
// data: {
|
|
109
|
+
// selectName: 'status',
|
|
110
|
+
// selectOptions: searchResultSelections.statusSelections,
|
|
111
|
+
// },
|
|
112
|
+
// },
|
|
118
113
|
], filterInputHandler: handleFilterInput, handleResetFilter: handleResetFilter, handleMobileFilterInput: handleMobileFilterInput, isMobile: isMobile })) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})),
|
|
119
114
|
};
|
|
120
115
|
};
|