mid 관련 수정

This commit is contained in:
focp212@naver.com
2025-10-22 17:19:16 +09:00
parent 556b3f2a6a
commit e857b8ac05
29 changed files with 262 additions and 218 deletions

View File

@@ -4,7 +4,7 @@ import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { useNoticeListMutation } from '@/entities/support/api/use-notice-list-mutation';
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
import { NoticeItem, NoticeListParams, NoticeListResponse } from '@/entities/support/model/types';
import { InformCl, NoticeItem, NoticeListParams, NoticeListResponse, SearchCl } from '@/entities/support/model/types';
import { SupportNoticeItem } from '@/entities/support/ui/notice-item';
import { HeaderType } from '@/entities/common/model/types';
import {
@@ -22,8 +22,8 @@ export const NoticeListPage = () => {
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
const [nextCursor, setNextCursor] = useState<string | null>(null);
const [searchKeyword, setSearchKeyword] = useState<string>('');
const [selectedCategory, setSelectedCategory] = useState<string>('ALL');
const [informCl, setInformCl] = useState<InformCl | string>('');
const [searchValue, setSearchValue] = useState<string>('');
const [resultList, setResultList] = useState<Array<NoticeItem>>([]);
useSetHeaderTitle(t('support.notice.title'));
@@ -56,8 +56,9 @@ export const NoticeListPage = () => {
const callList = (type?: string) => {
let listParams: NoticeListParams = {
category: selectedCategory,
searchKeyword: searchKeyword,
informCl: informCl,
searchCl: (!!searchValue)? SearchCl.HEAD: null,
searchValue: searchValue,
...{
page: pageParam
}
@@ -108,9 +109,9 @@ export const NoticeListPage = () => {
rs.push(
<SupportNoticeItem
key={ `key-support-notice-item-${i}` }
id={ resultList[i]?.id }
seq={ resultList[i]?.seq }
title={ resultList[i]?.title }
category={ resultList[i]?.category }
informCl={ resultList[i]?.informCl }
regDate={ resultList[i]?.regDate }
isNew={ resultList[i]?.isNew }
></SupportNoticeItem>
@@ -122,8 +123,7 @@ export const NoticeListPage = () => {
useEffect(() => {
setNextCursor(null);
callList();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedCategory]);
}, [informCl]);
return (
<>
@@ -141,8 +141,8 @@ export const NoticeListPage = () => {
<input
type="text"
placeholder={ t('support.notice.searchPlaceholder') }
value={ searchKeyword }
onChange={ (e: ChangeEvent<HTMLInputElement>) => setSearchKeyword(e.target.value) }
value={ searchValue }
onChange={ (e: ChangeEvent<HTMLInputElement>) => setSearchValue(e.target.value) }
onKeyDown={ (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Enter' && !e.nativeEvent.isComposing) {
onClickToAction();
@@ -153,14 +153,19 @@ export const NoticeListPage = () => {
<div className="notice-filter">
<select
className="flex-1"
value={ selectedCategory }
onChange={ (e: ChangeEvent<HTMLSelectElement>) => setSelectedCategory(e.target.value) }
value={ informCl }
onChange={ (e: ChangeEvent<HTMLSelectElement>) => setInformCl(e.target.value) }
>
<option value="ALL">{ t('support.notice.categories.ALL') }</option>
<option value="NOTICE">{ t('support.notice.categories.NOTICE') }</option>
<option value="">{ t('support.notice.categories.all') }</option>
<option value="INTEREST_FREE_INSTALLMENT">{ t('support.notice.categories.INTEREST_FREE_INSTALLMENT') }</option>
<option value="NEWS">{ t('support.notice.categories.NEWS') }</option>
<option value="SERVICE_DISRUPTION_NOTICE">{ t('support.notice.categories.SERVICE_DISRUPTION_NOTICE') }</option>
<option value="MAINTENANCE_NOTICE">{ t('support.notice.categories.MAINTENANCE_NOTICE') }</option>
<option value="EVENT">{ t('support.notice.categories.EVENT') }</option>
<option value="SERVICE">{ t('support.notice.categories.SERVICE') }</option>
<option value="IMPORTANT">{ t('support.notice.categories.IMPORTANT') }</option>
<option value="SERVICE_CHANGE_OR_ADDITION">{ t('support.notice.categories.SERVICE_CHANGE_OR_ADDITION') }</option>
<option value="IMPORTANT_NOTICE">{ t('support.notice.categories.IMPORTANT_NOTICE') }</option>
<option value="ADDITIONAL_SERVICE">{ t('support.notice.categories.ADDITIONAL_SERVICE') }</option>
</select>
</div>
</div>