fix(LOY-105): use existing translation for t&c text * fix(LOY-105): use existing translation for t&c text in signup Approved-by: Christian Andolf
16 lines
454 B
TypeScript
16 lines
454 B
TypeScript
import { signupErrors } from "@/components/Forms/Signup/schema"
|
|
|
|
import type { IntlShape } from "react-intl"
|
|
|
|
export function getErrorMessage(intl: IntlShape, errorCode?: string) {
|
|
switch (errorCode) {
|
|
case signupErrors.TERMS_REQUIRED:
|
|
return intl.formatMessage({
|
|
defaultMessage: "You must accept the terms and conditions",
|
|
})
|
|
default:
|
|
console.warn("Error code not supported:", errorCode)
|
|
return errorCode
|
|
}
|
|
}
|