Skip to content

Commit

Permalink
fix: add id prop to StripeCardInput component (#2274)
Browse files Browse the repository at this point in the history
* fix: add `id` prop to StripeCardInput component

* fix: add id prop to type declaration

Co-authored-by: Jose Leandro Torres <jtorressicilia@gmail.com>
  • Loading branch information
HellWolf93 and LeandroTorresSicilia committed Sep 6, 2021
1 parent efae180 commit 28a0578
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/StripeCardInput/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface StripeCardEvent {
}

export interface StripeCardInput extends BaseProps {
id?: string;
apiKey: string;
label?: ReactNode;
labelAlignment?: LabelAlignment;
Expand Down
5 changes: 5 additions & 0 deletions src/components/StripeCardInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import StyledCardInput from './styled/cardInput';
*/
const StripeCardInput = React.forwardRef((props, ref) => {
const {
id,
apiKey,
label,
labelAlignment,
Expand Down Expand Up @@ -83,6 +84,7 @@ const StripeCardInput = React.forwardRef((props, ref) => {

return (
<StyledContainer
id={id}
ref={ref}
className={className}
style={style}
Expand Down Expand Up @@ -110,6 +112,8 @@ const StripeCardInput = React.forwardRef((props, ref) => {
});

StripeCardInput.propTypes = {
/** The id of the outer element. */
id: PropTypes.string,
/** The application's API key. To use Stripe,
* you must get an API Key. See https://dashboard.stripe.com/account/apikeys
* to get an API Key. */
Expand Down Expand Up @@ -177,6 +181,7 @@ StripeCardInput.propTypes = {
};

StripeCardInput.defaultProps = {
id: undefined,
label: undefined,
labelAlignment: 'center',
hideLabel: false,
Expand Down

0 comments on commit 28a0578

Please sign in to comment.