From 3a92c58a0fc4ac18e0d37beb07b5095a78ac9445 Mon Sep 17 00:00:00 2001 From: guilhermer Date: Mon, 16 Dec 2024 10:37:29 -0300 Subject: [PATCH] worked on review comments. forced types in drop-in render fn --- .../Dropin/components/DropinComponent.tsx | 42 +++++++++---------- packages/lib/src/components/Dropin/types.ts | 11 ++--- .../PayPalFastlane/components/Fastlane.scss | 4 ++ .../components/FastlaneComponent.tsx | 2 +- .../components/internal/UIElement/types.ts | 4 +- 5 files changed, 35 insertions(+), 28 deletions(-) diff --git a/packages/lib/src/components/Dropin/components/DropinComponent.tsx b/packages/lib/src/components/Dropin/components/DropinComponent.tsx index c9229876d..c3c089768 100644 --- a/packages/lib/src/components/Dropin/components/DropinComponent.tsx +++ b/packages/lib/src/components/Dropin/components/DropinComponent.tsx @@ -2,14 +2,13 @@ import { Component, Fragment, h } from 'preact'; import PaymentMethodList from './PaymentMethod/PaymentMethodList'; import Status from './status'; import getOrderStatus from '../../../core/Services/order-status'; -import { DropinComponentProps, DropinComponentState, DropinStatusProps, onOrderCancelData } from '../types'; import './DropinComponent.scss'; -import { UIElementStatus } from '../../internal/UIElement/types'; import { sanitizeOrder } from '../../internal/UIElement/utils'; import { PaymentAmount } from '../../../types/global-types'; import { ANALYTICS_RENDERED_STR } from '../../../core/Analytics/constants'; import AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError'; import Button from '../../internal/Button'; +import type { DropinComponentProps, DropinComponentState, DropinStatus, DropinStatusProps, onOrderCancelData } from '../types'; export class DropinComponent extends Component { public state: DropinComponentState = { @@ -64,7 +63,7 @@ export class DropinComponent extends Component { + public setStatus = (status: DropinStatus['type'], props: DropinStatusProps = {}) => { this.setState({ status: { type: status, props } }); }; @@ -77,6 +76,7 @@ export class DropinComponent extends Component void; - render( - props, - { + render() { + const { elements, fastlanePaymentElement, instantPaymentElements, @@ -165,17 +164,15 @@ export class DropinComponent extends Component; + return ; case 'error': return ; @@ -189,7 +186,7 @@ export class DropinComponent extends Component -