Merged in fix/sw-2132-unlink-error (pull request #1816)
Add UnlinkError for when SAS account unlinking fails * Add UnlinkError for when unlinking fails Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"use client"
|
||||
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { GenericError } from "./GenericError"
|
||||
import { SASModalContactBlock } from "./SASModal"
|
||||
|
||||
export function UnlinkError() {
|
||||
const intl = useIntl()
|
||||
|
||||
return (
|
||||
<GenericError
|
||||
title={intl.formatMessage({
|
||||
defaultMessage: "We could not unlink your accounts",
|
||||
})}
|
||||
>
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p>
|
||||
{intl.formatMessage({
|
||||
defaultMessage:
|
||||
"We couldn’t unlink your accounts. Please contact us and we’ll help you resolve this.",
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
<SASModalContactBlock />
|
||||
</GenericError>
|
||||
)
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { GenericError } from "../components/GenericError"
|
||||
import { SASModalContactBlock } from "../components/SASModal"
|
||||
import { TooManyCodesError } from "../components/TooManyCodesError"
|
||||
import { TooManyFailedAttemptsError } from "../components/TooManyFailedAttemptsError"
|
||||
import { UnlinkError } from "../components/UnlinkError"
|
||||
|
||||
import type { LangParams, PageArgs, SearchParams } from "@/types/params"
|
||||
|
||||
@@ -34,6 +35,10 @@ export default async function Page({
|
||||
return <AlreadyLinkedError />
|
||||
}
|
||||
|
||||
if (errorCode === "unlinkError") {
|
||||
return <UnlinkError />
|
||||
}
|
||||
|
||||
return (
|
||||
<GenericError
|
||||
title={intl.formatMessage({
|
||||
|
||||
@@ -223,7 +223,7 @@ async function handleUnlinkAccount({
|
||||
}
|
||||
case "error":
|
||||
return {
|
||||
url: `/${lang}/sas-x-scandic/error`,
|
||||
url: `/${lang}/sas-x-scandic/error?errorCode=unlinkError`,
|
||||
type: "replace",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user