Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add id prop to StripeCardInput component #2274

Merged
merged 3 commits into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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