Skip to content

Commit 7590cd4

Browse files
authored
Merge pull request #349 from entrylabs/issue/4685
[#4685] 작품 불러오기 팝업 검색 필터 값 최신화
2 parents 26a825c + ff9f4bd commit 7590cd4

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

src/components/popup/Contents/Navigation/SearchBox.jsx

+13-12
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ export default connect(null, mapDispatchToProps)(Index);
8383
//TODO: Theme.type == 'entryline' 이면 @web/config.category 사용.
8484
const defaultOptions = {
8585
category: [
86-
[CommonUtils.getLang('EntryStatic.art_category_all'), 'art_category_all'],
87-
[CommonUtils.getLang('EntryStatic.art_category_game'), 'art_category_game'],
88-
[CommonUtils.getLang('EntryStatic.art_category_animation'), 'art_category_animation'],
89-
[CommonUtils.getLang('EntryStatic.art_category_media'), 'art_category_media'],
90-
[CommonUtils.getLang('EntryStatic.art_category_physical'), 'art_category_physical'],
91-
[CommonUtils.getLang('EntryStatic.art_category_etc'), 'art_category_etc'],
86+
[CommonUtils.getLang('EntryStatic.art_category_all'), 'all'],
87+
[CommonUtils.getLang('EntryStatic.art_category_game'), 'game'],
88+
[CommonUtils.getLang('EntryStatic.art_category_living'), 'living'],
89+
[CommonUtils.getLang('EntryStatic.art_category_storytelling'), 'storytelling'],
90+
[CommonUtils.getLang('EntryStatic.art_category_arts'), 'arts'],
91+
[CommonUtils.getLang('EntryStatic.art_category_knowledge'), 'knowledge'],
92+
[CommonUtils.getLang('EntryStatic.art_category_etc'), 'etc'],
9293
],
9394
sort: [
9495
[CommonUtils.getLang('EntryStatic.art_sort_updated'), 'updated'],
@@ -98,10 +99,10 @@ const defaultOptions = {
9899
],
99100
period: [
100101
[CommonUtils.getLang('EntryStatic.art_period_all'), null],
101-
[CommonUtils.getLang('EntryStatic.art_period_day'), '1'],
102-
[CommonUtils.getLang('EntryStatic.art_period_week'), '7'],
103-
[CommonUtils.getLang('EntryStatic.art_period_month'), '30'],
104-
[CommonUtils.getLang('EntryStatic.art_period_three_month'), '90'],
102+
[CommonUtils.getLang('EntryStatic.art_period_today'), 'today'],
103+
[CommonUtils.getLang('EntryStatic.art_period_week'), 'week'],
104+
[CommonUtils.getLang('EntryStatic.art_period_month'), 'month'],
105+
[CommonUtils.getLang('EntryStatic.art_period_quarter'), 'quarter'],
105106
],
106107
};
107108

@@ -110,7 +111,7 @@ const createDropDownOption = (projectNavOptions = {}) => {
110111
const result = defaultOptions;
111112
if (categoryOptions) {
112113
result.category = categoryOptions.map((item) => [
113-
CommonUtils.getLang(`EntryStatic.${item}`),
114+
CommonUtils.getLang(`EntryStatic.art_category_${item}`),
114115
item,
115116
]);
116117
}
@@ -122,7 +123,7 @@ const createDropDownOption = (projectNavOptions = {}) => {
122123
}
123124
if (periodOptions) {
124125
result.period = periodOptions.map((item) => [
125-
CommonUtils.getLang(`EntryStatic.${item}`),
126+
CommonUtils.getLang(`EntryStatic.art_period_${item}`),
126127
item,
127128
]);
128129
}

src/components/popup/Contents/Projects/index.jsx

+18-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,24 @@ const Index = ({
2828
fetch(type);
2929
}, [type]);
3030

31-
const onRequestAppend = useCallback(() => {
32-
if (!raw.searchAfter || !raw.searchAfter[0] || raw.total === data.length) {
33-
return;
34-
}
35-
fetchMore({ type, data, searchAfter: raw.searchAfter, searchParam: raw.searchParam });
36-
}, [raw, data, fetchMore]);
31+
const onRequestAppend = useCallback(
32+
(event) => {
33+
if (!raw.searchAfter || !raw.searchAfter[0] || raw.total === data.length) {
34+
return;
35+
}
36+
event.wait();
37+
fetchMore({
38+
type,
39+
data,
40+
searchAfter: raw.searchAfter,
41+
searchParam: raw.searchParam,
42+
callback: () => {
43+
event.ready();
44+
},
45+
});
46+
},
47+
[raw, data, fetchMore]
48+
);
3749

3850
if (totalCount === 0) {
3951
return <EmptyContents type={type} />;

0 commit comments

Comments
 (0)