정렬 박스 및 드랍다운 섹션 화살표 공통화 처리

This commit is contained in:
focp212@naver.com
2025-09-19 09:49:39 +09:00
parent 3a813420dd
commit 34dc536455
19 changed files with 49 additions and 139 deletions

View File

@@ -1,9 +1,9 @@
import { DetailInfoSectionProps } from '../model/types';
import { InvoiceArrow } from './invoice-arrow';
import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow';
export const DetailAmountInfoSection = ({
amountInfo,
show,
isOpen,
onClickToShowInfo
}: DetailInfoSectionProps) => {
@@ -16,7 +16,7 @@ export const DetailAmountInfoSection = ({
className="chip-btn"
type="button"
>
<span></span> <InvoiceArrow show={ show }></InvoiceArrow>
<span></span> <SectionTitleArrow isOpen={ isOpen }></SectionTitleArrow>
</button>
</div>
<div className="amount-expand">

View File

@@ -2,7 +2,7 @@ import { DetailInfoSectionProps } from '../model/types';
export const DetailPublishInfoSection = ({
publishInfo,
show,
isOpen,
onClickToShowInfo
}: DetailInfoSectionProps) => {

View File

@@ -2,7 +2,7 @@ import { DetailInfoSectionProps } from '../model/types';
export const DetailReceiverInfoSection = ({
receiverInfo,
show,
isOpen,
onClickToShowInfo
}: DetailInfoSectionProps) => {

View File

@@ -2,7 +2,7 @@ import { DetailInfoSectionProps } from '../model/types';
export const DetailSupplierInfoSection = ({
supplierInfo,
show,
isOpen,
onClickToShowInfo
}: DetailInfoSectionProps) => {

View File

@@ -1,24 +0,0 @@
import { useEffect, useState } from 'react';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { AltMsgKeys } from '@/entities/common/model/types';
import { InvoiceArrowProps } from '../model/types';
export const InvoiceArrow = ({ show }: InvoiceArrowProps) => {
const [altMsg, setAltMsg] = useState<AltMsgKeys>(AltMsgKeys.Fold);
const [className, setClassName] = useState<string>('ic20 rot-180');
useEffect(() => {
setAltMsg((show)? AltMsgKeys.Fold: AltMsgKeys.UnFold);
setClassName(`ic20 ${(show)? 'rot-180': ''}`);
}, [show]);
return (
<>
<img
className={ className }
src={ IMAGE_ROOT + '/select_arrow.svg' }
alt={ altMsg }
/>
</>
);
};

View File

@@ -1,8 +1,8 @@
import { useEffect, useState } from 'react';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { InvoiceFilter } from './invoice-filter';
import { SortOptionsBox } from './sort-options-box';
import { SortByKeys } from '../model/types';
import { SortOptionsBox } from '@/entities/common/ui/sort-options-box';
import { SortByKeys } from '@/entities/common/model/types';
import { InvoiceList } from './invoice-list';
export const InvoiceListWrap = () => {
@@ -21,7 +21,7 @@ export const InvoiceListWrap = () => {
const onClickToOpenFIlter = () => {
setFilterOn(true);
};
const onCliCkToSort = (sort: SortByKeys) => {
const onClickToSort = (sort: SortByKeys) => {
setSortBy(sort);
};
@@ -60,7 +60,7 @@ export const InvoiceListWrap = () => {
<div className="filter-section mt-10">
<SortOptionsBox
sortBy={ sortBy }
onCliCkToSort={ onCliCkToSort }
onClickToSort={ onClickToSort }
></SortOptionsBox>
</div>
<InvoiceList

View File

@@ -1,25 +0,0 @@
import {
SortByKeys,
SortOptionsBoxProps
} from '../model/types';
export const SortOptionsBox = ({
sortBy,
onCliCkToSort
}: SortOptionsBoxProps) => {
return (
<>
<div className="sort-options">
<button
className={ `sort-btn ${(sortBy === SortByKeys.New)? 'active': ''}` }
onClick={ () => onCliCkToSort(SortByKeys.New) }
></button>
<span className="sort-divider">|</span>
<button
className={ `sort-btn ${(sortBy === SortByKeys.Amount)? 'active': ''}` }
onClick={ () => onCliCkToSort(SortByKeys.Amount) }
></button>
</div>
</>
);
};