Skip to content

Commit d389b77

Browse files
feat(checkout): Add optional param to display Send title on Transfer widget (#2734)
1 parent f00cbc2 commit d389b77

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

packages/checkout/sdk/src/widgets/definitions/configurations/transfer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ import { WidgetConfiguration } from './widget';
55
*/
66
export type TransferWidgetConfiguration = {
77
customTitle?: string;
8+
customCoinAmountTitle?: string;
89
showHeader?: boolean;
910
} & WidgetConfiguration;

packages/checkout/widgets-lib/src/widgets/transfer/TransferForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function TransferForm({
3131
showBackButton,
3232
showHeader,
3333
title,
34+
coinAmountTitle,
3435
}: {
3536
config: StrongCheckoutWidgetsConfig;
3637
viewState: TransferFormState;
@@ -39,6 +40,7 @@ export function TransferForm({
3940
showBackButton: boolean | undefined;
4041
showHeader: boolean;
4142
title: string;
43+
coinAmountTitle: string;
4244
}) {
4345
const { t } = useTranslation();
4446
const { track } = useAnalytics();
@@ -166,7 +168,7 @@ export function TransferForm({
166168
<Stack gap="base.spacing.x9">
167169
<Stack gap="base.spacing.x1">
168170
<Heading size="xSmall">
169-
{t('views.TRANSFER.form.coinAmountHeading')}
171+
{coinAmountTitle}
170172
</Heading>
171173
<SelectInput
172174
testId="transfer-token-select"

packages/checkout/widgets-lib/src/widgets/transfer/TransferWidget.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ function TransferWidgetInner(props: TransferWidgetInputs) {
207207
showBackButton={props.showBackButton}
208208
showHeader={props.transferConfig.showHeader ?? true}
209209
title={props.transferConfig.customTitle ?? t('views.TRANSFER.header.title')}
210+
coinAmountTitle={props.transferConfig.customCoinAmountTitle ?? t('views.TRANSFER.form.coinAmountHeading')}
210211
/>
211212
);
212213
case 'AWAITING_APPROVAL':

packages/checkout/widgets-sample-app/src/components/ui/checkout/checkout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ function CheckoutUI() {
301301
},
302302
TRANSFER: {
303303
customTitle: "Dromedary Transfer",
304+
customCoinAmountTitle: "Send dromedary",
305+
// showHeader: false,
304306
},
305307
/*
306308
ONRAMP: {

0 commit comments

Comments
 (0)