diff --git a/packages/checkout/widgets-lib/src/context/view-context/ViewContext.ts b/packages/checkout/widgets-lib/src/context/view-context/ViewContext.ts index 0098c561c8..531877697d 100644 --- a/packages/checkout/widgets-lib/src/context/view-context/ViewContext.ts +++ b/packages/checkout/widgets-lib/src/context/view-context/ViewContext.ts @@ -12,14 +12,12 @@ export enum SharedViews { ERROR_VIEW = 'ERROR_VIEW', SERVICE_UNAVAILABLE_ERROR_VIEW = 'SERVICE_UNAVAILABLE_ERROR_VIEW', TOP_UP_VIEW = 'TOP_UP_VIEW', - SANCTIONED_ADDRESS_ERROR_VIEW = 'SANCTIONED_ADDRESS_ERROR_VIEW', } export type SharedView = LoadingView | ErrorView | ServiceUnavailableErrorView - | SanctionedAddressErrorView | TopUpView; interface LoadingView extends ViewType { @@ -32,16 +30,11 @@ export interface ErrorView extends ViewType { tryAgain?: () => Promise } -export interface ServiceUnavailableErrorView extends ViewType { +interface ServiceUnavailableErrorView extends ViewType { type: SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW; error: Error; } -interface SanctionedAddressErrorView extends ViewType { - type: SharedViews.SANCTIONED_ADDRESS_ERROR_VIEW; - error: Error; -} - interface TopUpView extends ViewType { type: SharedViews.TOP_UP_VIEW, swapData?: PrefilledSwapForm, diff --git a/packages/checkout/widgets-lib/src/locales/en.json b/packages/checkout/widgets-lib/src/locales/en.json index c61103834e..185df5ff16 100644 --- a/packages/checkout/widgets-lib/src/locales/en.json +++ b/packages/checkout/widgets-lib/src/locales/en.json @@ -71,11 +71,11 @@ "SERVICE_UNAVAILABLE_ERROR_VIEW": { "heading": { "swap": "Swapping is not available in your region", - "sanction": "This service is not available in your region" + "generic": "This service is not available in your region" }, "body": { "swap": "Please refer to Quickswap’s website for further information.", - "sanction": "For further assistance visit the Immutable support page." + "generic": "For further assistance visit the Immutable support page." } }, "LOADING_VIEW": { diff --git a/packages/checkout/widgets-lib/src/locales/ja.json b/packages/checkout/widgets-lib/src/locales/ja.json index a784cb5492..86f118badf 100644 --- a/packages/checkout/widgets-lib/src/locales/ja.json +++ b/packages/checkout/widgets-lib/src/locales/ja.json @@ -75,11 +75,11 @@ "SERVICE_UNAVAILABLE_ERROR_VIEW": { "heading": { "swap": "お住まいの地域では交換が利用できません", - "sanction": "このサービスはお住まいの地域では利用できません" + "generic": "このサービスはお住まいの地域では利用できません" }, "body": { "swap": "Quickswapのウェブサイトで詳細情報をご覧ください。", - "sanction": "詳しいサポートについては、Immutableサポートページをご覧ください." + "generic": "詳しいサポートについては、Immutableサポートページをご覧ください." } }, "LOADING_VIEW": { diff --git a/packages/checkout/widgets-lib/src/locales/ko.json b/packages/checkout/widgets-lib/src/locales/ko.json index 3ef5ae92f6..b56ce6890d 100644 --- a/packages/checkout/widgets-lib/src/locales/ko.json +++ b/packages/checkout/widgets-lib/src/locales/ko.json @@ -71,11 +71,11 @@ "SERVICE_UNAVAILABLE_ERROR_VIEW": { "heading": { "swap": "귀하의 지역에서는 스왑이 가능하지 않습니다", - "sanction": "이 서비스는 귀하의 지역에서 이용할 수 없습니다" + "generic": "이 서비스는 귀하의 지역에서 이용할 수 없습니다" }, "body": { "swap": "자세한 정보는 Quickswap 웹사이트를 참조하십시오.", - "sanction": "추가 지원이 필요하시면 Immutable 지원 페이지를 방문하세요." + "generic": "추가 지원이 필요하시면 Immutable 지원 페이지를 방문하세요." } }, "LOADING_VIEW": { diff --git a/packages/checkout/widgets-lib/src/locales/zh.json b/packages/checkout/widgets-lib/src/locales/zh.json index 013bef0038..827a7d3294 100644 --- a/packages/checkout/widgets-lib/src/locales/zh.json +++ b/packages/checkout/widgets-lib/src/locales/zh.json @@ -71,11 +71,11 @@ "SERVICE_UNAVAILABLE_ERROR_VIEW": { "heading": { "swap": "您所在的地区不支持兑换", - "sanction": "该服务在您的地区不可用" + "generic": "该服务在您的地区不可用" }, "body": { "swap": "请参考Quickswap的网站了解更多信息。", - "sanction": "如需进一步帮助,请访问Immutable支持页面。" + "generic": "如需进一步帮助,请访问Immutable支持页面。" } }, "LOADING_VIEW": { diff --git a/packages/checkout/widgets-lib/src/views/error/serviceTypes.ts b/packages/checkout/widgets-lib/src/views/error/serviceTypes.ts index 5ca9d5d2df..2b618a1512 100644 --- a/packages/checkout/widgets-lib/src/views/error/serviceTypes.ts +++ b/packages/checkout/widgets-lib/src/views/error/serviceTypes.ts @@ -1,4 +1,4 @@ export enum ServiceType { SWAP = 'swap', - SANCTION = 'sanction', + GENERIC = 'generic', } diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx index 3d865f093d..2af9ad1a76 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx @@ -339,9 +339,9 @@ export default function BridgeWidget({ testId="claim-withdrawal-fail-view" /> )} - {viewState.view.type === SharedViews.SANCTIONED_ADDRESS_ERROR_VIEW && ( + {viewState.view.type === SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && ( sendBridgeWidgetCloseEvent(eventTarget)} /> )} diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx index 5b0565c8e7..94f8f6d3ab 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx @@ -215,7 +215,7 @@ export function WalletAndNetworkSelector() { payload: { type: ViewActions.UPDATE_VIEW, view: { - type: SharedViews.SANCTIONED_ADDRESS_ERROR_VIEW, + type: SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW, error: new Error('Sanctioned address'), }, }, @@ -345,7 +345,7 @@ export function WalletAndNetworkSelector() { payload: { type: ViewActions.UPDATE_VIEW, view: { - type: SharedViews.SANCTIONED_ADDRESS_ERROR_VIEW, + type: SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW, error: new Error('Sanctioned address'), }, }, diff --git a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx index b6926221f8..4a0d38d259 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx @@ -259,9 +259,9 @@ export default function ConnectWidget({ onCloseClick={() => sendCloseEvent()} /> )} - {view.type === SharedViews.SANCTIONED_ADDRESS_ERROR_VIEW && ( + {view.type === SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && ( )} diff --git a/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx b/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx index 0771092d6e..8ff1b32cc9 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx @@ -180,7 +180,7 @@ export function WalletList(props: WalletListProps) { payload: { type: ViewActions.UPDATE_VIEW, view: { - type: SharedViews.SANCTIONED_ADDRESS_ERROR_VIEW, + type: SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW, error: new Error('Sanctioned address'), }, },