diff --git a/src/entities/common/model/types.ts b/src/entities/common/model/types.ts index f5a9b02..faf72da 100644 --- a/src/entities/common/model/types.ts +++ b/src/entities/common/model/types.ts @@ -52,8 +52,8 @@ export interface FilterRangeAmountProps { title?: string; minAmount?: number; maxAmount?: number; - setMinAmount: (minAmount: number) => void; - setMaxAmount: (maxAmount: number) => void; + setMinAmount: (minAmount: number | undefined) => void; + setMaxAmount: (maxAmount: number | undefined) => void; }; export interface FilterButtonGroupsProps { title: string; diff --git a/src/entities/transaction/ui/all-transaction-part-cancel.tsx b/src/entities/transaction/ui/all-transaction-part-cancel.tsx index cef3dfc..dde9e51 100644 --- a/src/entities/transaction/ui/all-transaction-part-cancel.tsx +++ b/src/entities/transaction/ui/all-transaction-part-cancel.tsx @@ -194,7 +194,6 @@ export const AllTransactionPartCancel = ({ { const [filterTitle, setFilterTitle] = useState(title || '거래금액'); + const onChangeMinAmount = (val?: number) => { + setMinAmount(val || undefined); + }; + const onChangeMaxAmount = (val?: number) => { + setMaxAmount(val || undefined); + } + useEffect(() => { setFilterTitle(title || '거래금액'); }, [title]) @@ -21,21 +29,21 @@ export const FilterRangeAmount = ({
{ filterTitle }
- ) => setMinAmount(parseInt(e.target.value)) } - /> + allowNegative={ false } + displayType="input" + onChange={(e: ChangeEvent) => onChangeMinAmount(parseInt(e.target.value)) } + >
~
- ) => setMaxAmount(parseInt(e.target.value)) } - /> + allowNegative={ false } + displayType="input" + onChange={(e: ChangeEvent) => onChangeMaxAmount(parseInt(e.target.value)) } + >