Skip to content

Commit c725c51

Browse files
committed
CurrencyInput: add showPrefix prop
1 parent f90037b commit c725c51

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/@next/CurrencyInput/CurrencyInput.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type CurrencyInputProps = Omit<
88
locale?: string;
99
value?: number | null;
1010
allowEmptyValue?: boolean;
11+
showPrefix?: boolean;
1112
onChange?: (value: number | undefined) => void;
1213
currencyCode: string;
1314
currencySymbol?: string;
@@ -21,6 +22,7 @@ export const CurrencyInput = React.forwardRef<
2122
locale = 'en',
2223
value,
2324
allowEmptyValue = false,
25+
showPrefix = true,
2426
onChange,
2527
currencyCode,
2628
currencySymbol,
@@ -107,9 +109,11 @@ export const CurrencyInput = React.forwardRef<
107109
ref={ref}
108110
type="text"
109111
prefix={
110-
<div>
111-
{getCurrencySymbol(localeValue, currencyCode, currencySymbol)}
112-
</div>
112+
showPrefix && (
113+
<div>
114+
{getCurrencySymbol(localeValue, currencyCode, currencySymbol)}
115+
</div>
116+
)
113117
}
114118
{...props}
115119
value={formattedValue}

0 commit comments

Comments
 (0)