-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee3f261
commit 36e80bf
Showing
1 changed file
with
4 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
import React, { FC } from 'react'; | ||
import MaskedInputBase, { MaskedInputProps as RTMaskedInputProps } from 'react-text-mask'; | ||
import MaskedInputBase, { MaskedInputProps } from 'react-text-mask'; | ||
|
||
interface MaskedInputProps extends RTMaskedInputProps { | ||
'data-testid'?: string; | ||
} | ||
const MaskedInput: FC<MaskedInputProps> = ({ guide = false, ...props }) => ( | ||
<MaskedInputBase className="form-control" guide={guide} {...props} /> | ||
); | ||
|
||
const MaskedInput: FC<MaskedInputProps> = ({ guide = false, ...props }) => { | ||
if (props && !props['data-testid']) { | ||
props['data-testid'] = 'react-gears-maskedinput'; | ||
} | ||
return <MaskedInputBase className="form-control" guide={guide} {...props} />; | ||
}; | ||
export default MaskedInput; |