Skip to content
Draft
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
3 changes: 2 additions & 1 deletion packages/hosted-widget-integration/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": ["../../.eslintrc.json"],
"rules": {
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unnecessary-condition": "off"
"@typescript-eslint/no-unnecessary-condition": "off",
"react-hooks/exhaustive-deps": "off"
}
}
31 changes: 31 additions & 0 deletions packages/hosted-widget-integration/src/EditButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import classNames from 'classnames';
import React, { type ReactNode } from 'react';

import { preventDefault } from '@bigcommerce/checkout/dom-utils';
import { TranslatedString } from '@bigcommerce/checkout/locale';

interface EditButtonProps {
buttonId: string | undefined;
shouldShowEditButton: boolean | undefined;
}

export const EditButton = ({ buttonId, shouldShowEditButton }: EditButtonProps): ReactNode => {
if (shouldShowEditButton) {
const translatedString = <TranslatedString id="remote.select_different_card_action" />;

return (
<p>
<button
className={classNames('stepHeader', 'widget-link-amazonpay')}
id={buttonId}
onClick={preventDefault()}
type="button"
>
{translatedString}
</button>
</p>
);
}

return null;
};
Loading