120 lines
4.9 KiB
JavaScript
120 lines
4.9 KiB
JavaScript
/**
|
|
* config.js
|
|
* 앱 전역 설정: 페이지네이션, 상품 상태 메타데이터, 검색 및 태그 스타일 정의
|
|
*/
|
|
|
|
// ==========================================================================
|
|
// 1. 기본 앱 설정 (General Settings)
|
|
// ==========================================================================
|
|
|
|
/** 한 페이지당 표시할 상품 수 */
|
|
export const ITEMS_PER_PAGE = 20;
|
|
|
|
/** 정렬 관련 설정 */
|
|
export const SORT_CONFIG = {
|
|
/** 판매 완료된 항목을 리스트의 가장 뒤로 보낼지 여부 */
|
|
PUSH_SOLD_OUT_TO_END: false,
|
|
/** 미판매 항목을 리스트의 가장 뒤로 보낼지 여부 */
|
|
PUSH_NON_SALE_TO_END: false,
|
|
};
|
|
|
|
/** 검색 범위 설정 */
|
|
export const SEARCH_CONFIG = {
|
|
USE_TITLE: true, // 상품명 포함
|
|
USE_CUSTOM_TAG: true, // 커스텀 태그 포함
|
|
USE_TAGS: true, // 태그 배열 포함
|
|
USE_DESCRIPTION: true, // 요약 설명 포함
|
|
USE_FULL_DESCRIPTION: false // 상세 설명 배열 포함 여부
|
|
};
|
|
|
|
// ==========================================================================
|
|
// 2. 상품 상태 및 필터 설정 (Status & Filters)
|
|
// ==========================================================================
|
|
|
|
/** * 상품 상태별 정책 정의
|
|
* selectable: 체크박스 선택 가능 여부
|
|
* isDefaultActive: 초기 로드 시 필터 활성화 여부
|
|
* isSystemVisible: 필터 목록 및 리스트 노출 여부
|
|
* soldOut: 판매 완료 처리 여부 (이미지 그레이스케일 등)
|
|
*/
|
|
export const STATUS_META = {
|
|
미판매: {
|
|
selectable: false,
|
|
isDefaultActive: false,
|
|
isSystemVisible: true,
|
|
soldOut: false,
|
|
},
|
|
판매예정: {
|
|
selectable: false,
|
|
isDefaultActive: false,
|
|
isSystemVisible: true,
|
|
soldOut: false,
|
|
},
|
|
판매중: {
|
|
selectable: true,
|
|
isDefaultActive: true,
|
|
isSystemVisible: true,
|
|
soldOut: false,
|
|
},
|
|
판매완료: {
|
|
selectable: false,
|
|
isDefaultActive: false,
|
|
isSystemVisible: true,
|
|
soldOut: true,
|
|
},
|
|
};
|
|
|
|
/** 필터 칩 표시 순서 정의 */
|
|
export const STATUS_ORDER = {
|
|
판매중: 1,
|
|
판매예정: 2,
|
|
판매완료: 3,
|
|
미판매: 4,
|
|
};
|
|
|
|
/** 시스템에 표시될 상태 필터 목록 (STATUS_META 기반 자동 생성) */
|
|
export const STATUS_FILTERS = Object.keys(STATUS_META)
|
|
.filter((key) => STATUS_META[key].isSystemVisible)
|
|
.map((key) => ({ key, label: key }))
|
|
.sort((a, b) => (STATUS_ORDER[a.key] || 99) - (STATUS_ORDER[b.key] || 99));
|
|
|
|
/** 상태별 UI 컬러 (Tailwind CSS 클래스) */
|
|
export const STATUS_COLOR = {
|
|
판매중: 'bg-primary/10 text-primary border-primary/30',
|
|
판매예정: 'bg-amber-400/10 text-amber-600 border-amber-400/30',
|
|
판매완료: 'bg-slate-400/10 text-slate-500 border-slate-400/30',
|
|
미판매: 'bg-slate-200/10 text-slate-400 border-slate-300/30',
|
|
};
|
|
|
|
// ==========================================================================
|
|
// 3. 태그 및 컨디션 스타일 (Tag & Condition Styles)
|
|
// ==========================================================================
|
|
|
|
/** 커스텀 태그(customTag)별 특정 테마 스타일 */
|
|
export const TAG_STYLES = {
|
|
완전생산한정판: 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400',
|
|
특전포함: 'bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400',
|
|
미개봉: 'bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400',
|
|
무료배송: 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400',
|
|
풀윤활완료: 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400',
|
|
급매: 'bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400',
|
|
정품: 'bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-400',
|
|
풀옵션: 'bg-teal-100 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400',
|
|
};
|
|
|
|
/** 정의되지 않은 태그의 기본 스타일 */
|
|
export const TAG_DEFAULT_STYLE = 'bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400';
|
|
|
|
/** * 상품 상태(Condition) 등급 및 라벨 설정
|
|
* specs.condition 값과 매칭됩니다.
|
|
*/
|
|
export const PRODUCT_CONDITIONS = {
|
|
BRAND_NEW: { label: 'Brand New (미개봉)', color: 'text-emerald-600', level: 'S' },
|
|
LIKE_NEW: { label: 'Like New (단순개봉)', color: 'text-blue-600', level: 'A+' },
|
|
EXCELLENT: { label: 'Excellent (최상급)', color: 'text-sky-600', level: 'A' },
|
|
GOOD: { label: 'Good (보통/사용감)', color: 'text-slate-600', level: 'B' },
|
|
INCOMPLETE: { label: 'Incomplete (구성품 누락)', color: 'text-amber-600', level: 'C' },
|
|
DAMAGED: { label: 'Damaged (하자/파손)', color: 'text-orange-600', level: 'D' },
|
|
JUNK: { label: 'Junk (동작불가/부품용)', color: 'text-red-600', level: 'F' },
|
|
OTHER: { label: '기타 (상세설명 참고)', color: 'text-indigo-600', level: '-' },
|
|
}; |