버그 픽스
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -194,7 +194,6 @@ export const AllTransactionPartCancel = ({
|
||||
<span className="value">
|
||||
<NumericFormat
|
||||
value={ totalCancelAmount }
|
||||
thousandSeparator
|
||||
displayType="input"
|
||||
allowNegative={ false }
|
||||
max={ remainAmount }
|
||||
|
||||
@@ -2,6 +2,7 @@ import { FilterRangeAmountProps } from '@/entities/common/model/types';
|
||||
import { useEffect } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { ChangeEvent } from 'react';
|
||||
import { NumericFormat } from 'react-number-format';
|
||||
|
||||
export const FilterRangeAmount = ({
|
||||
title,
|
||||
@@ -12,6 +13,13 @@ export const FilterRangeAmount = ({
|
||||
}: FilterRangeAmountProps) => {
|
||||
const [filterTitle, setFilterTitle] = useState<string>(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 = ({
|
||||
<div className="opt-label">{ filterTitle }</div>
|
||||
<div className="opt-controls">
|
||||
<div className="input-wrapper ">
|
||||
<input
|
||||
type="number"
|
||||
placeholder=""
|
||||
<NumericFormat
|
||||
value={ minAmount }
|
||||
onChange={ (e: ChangeEvent<HTMLInputElement>) => setMinAmount(parseInt(e.target.value)) }
|
||||
/>
|
||||
allowNegative={ false }
|
||||
displayType="input"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => onChangeMinAmount(parseInt(e.target.value)) }
|
||||
></NumericFormat>
|
||||
</div>
|
||||
<span> ~ </span>
|
||||
<div className="input-wrapper date">
|
||||
<input
|
||||
type="number"
|
||||
placeholder=""
|
||||
<NumericFormat
|
||||
value={ maxAmount }
|
||||
onChange={ (e: ChangeEvent<HTMLInputElement>) => setMaxAmount(parseInt(e.target.value)) }
|
||||
/>
|
||||
allowNegative={ false }
|
||||
displayType="input"
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => onChangeMaxAmount(parseInt(e.target.value)) }
|
||||
></NumericFormat>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user