Skip to content

Commit

Permalink
Merge pull request #1 from rhnorskov/feature/element-type
Browse files Browse the repository at this point in the history
  • Loading branch information
rhnorskov authored May 17, 2020
2 parents 10252ba + 4e15b72 commit 58c6efc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/CardCvcElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface CardCvcElementProps extends StripeCardCvcElementProps {
name: string;
}

export const CardCvcElement: React.FC<CardCvcElementProps> = ({
const CardCvcElement: React.FC<CardCvcElementProps> = ({
name,
onBlur,
onChange,
Expand Down Expand Up @@ -41,6 +41,11 @@ export const CardCvcElement: React.FC<CardCvcElementProps> = ({
);
};

// @ts-ignore
CardCvcElement.__elementType = StripeCardCvcElement.__elementType;

export { CardCvcElement };

function cardCvcElement(
this: ObjectSchema<object>,
messages?: {
Expand Down
7 changes: 6 additions & 1 deletion src/CardExpiryElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface CardExpiryElementProps extends StripeCardExpiryElementProps {
name: string;
}

export const CardExpiryElement: React.FC<CardExpiryElementProps> = ({
const CardExpiryElement: React.FC<CardExpiryElementProps> = ({
name,
onBlur,
onChange,
Expand Down Expand Up @@ -91,6 +91,11 @@ function cardExpiryElement(
});
}

// @ts-ignore
CardExpiryElement.__elementType = StripeCardExpiryElement.__elementType;

export { CardExpiryElement };

addMethod<ObjectSchema>(object, "cardExpiryElement", cardExpiryElement);

declare module "yup" {
Expand Down
7 changes: 6 additions & 1 deletion src/CardNumberElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface CardNumberElementProps extends StripeCardNumberElementProps {
name: string;
}

export const CardNumberElement: React.FC<CardNumberElementProps> = ({
const CardNumberElement: React.FC<CardNumberElementProps> = ({
name,
onBlur,
onChange,
Expand Down Expand Up @@ -41,6 +41,11 @@ export const CardNumberElement: React.FC<CardNumberElementProps> = ({
);
};

// @ts-ignore
CardNumberElement.__elementType = StripeCardNumberElement.__elementType;

export { CardNumberElement };

function cardNumberElement(
this: ObjectSchema<object>,
messages?: { empty?: string; invalid?: string; incomplete?: string }
Expand Down

0 comments on commit 58c6efc

Please sign in to comment.