Move user router to trpc package * Move more schemas in hotel router * Fix deps * fix getNonContentstackUrls * Fix import error * Fix entry error handling * Fix generateMetadata metrics * Fix alertType enum * Fix duplicated types * lint:fix * Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package * Fix broken imports * Move booking router to trpc package * Move partners router to trpc package * Move autocomplete router to trpc package * Move booking router to trpc package * Remove translations from My Pages navigation trpc procedure * Move navigation router to trpc package * Move user router to trpc package * Merge branch 'master' into feat/sw-2862-move-booking-router-to-trpc-package * Merge branch 'feat/sw-2862-move-booking-router-to-trpc-package' into feat/sw-2865-move-navigation-router-to-trpc-package * Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package * Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package * Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package * Merge branch 'feat/sw-2865-move-navigation-router-to-trpc-package' into feat/sw-2867-move-user-router-to-trpc-package * Merge branch 'master' into feat/sw-2867-move-user-router-to-trpc-package Approved-by: Linus Flood
79 lines
2.3 KiB
TypeScript
79 lines
2.3 KiB
TypeScript
import React from "react"
|
|
|
|
import { signup } from "@scandic-hotels/common/constants/routes/signup"
|
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
|
import { isValidSession } from "@scandic-hotels/trpc/utils/session"
|
|
|
|
import { dtmcLogin } from "@/constants/routes/dtmc"
|
|
import { login } from "@/constants/routes/handleAuth"
|
|
|
|
import { auth } from "@/auth"
|
|
import ButtonLink from "@/components/ButtonLink"
|
|
import { getIntl } from "@/i18n"
|
|
import { getLang } from "@/i18n/serverContext"
|
|
|
|
import styles from "./callToActions.module.css"
|
|
|
|
export default async function EmployeeBenefitsCallToActions() {
|
|
const session = await auth()
|
|
const intl = await getIntl()
|
|
const lang = await getLang()
|
|
|
|
const loginAndLinkURL = `${login[lang]}?redirectTo=${encodeURIComponent(dtmcLogin[lang])}`
|
|
|
|
if (!isValidSession(session)) {
|
|
return (
|
|
<>
|
|
<div className={styles.container}>
|
|
<Typography variant="Body/Paragraph/mdBold">
|
|
<p>
|
|
{intl.formatMessage({
|
|
defaultMessage: "Already a Scandic Friends member?",
|
|
})}
|
|
</p>
|
|
</Typography>
|
|
<ButtonLink href={loginAndLinkURL} size="Medium" variant="Tertiary">
|
|
{intl.formatMessage({
|
|
defaultMessage: "Log in and link employment",
|
|
})}
|
|
</ButtonLink>
|
|
</div>
|
|
|
|
<div className={styles.container}>
|
|
<Typography variant="Body/Paragraph/mdBold">
|
|
<p>
|
|
{intl.formatMessage({
|
|
defaultMessage: "Don't have a Scandic Friends account yet?",
|
|
})}
|
|
</p>
|
|
</Typography>
|
|
<ButtonLink href={signup[lang]} size="Medium" variant="Secondary">
|
|
{intl.formatMessage({
|
|
defaultMessage: "Sign up and link employment",
|
|
})}
|
|
</ButtonLink>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
// -- TODO [LOY-196] --
|
|
// Handle case of authed user and already connected work account.
|
|
// Show member card modal.
|
|
|
|
return (
|
|
<div className={styles.container}>
|
|
<ButtonLink
|
|
href={dtmcLogin[lang]}
|
|
size="Medium"
|
|
variant="Tertiary"
|
|
color="Primary"
|
|
>
|
|
{intl.formatMessage({
|
|
defaultMessage: "Link Employment",
|
|
})}
|
|
</ButtonLink>
|
|
</div>
|
|
)
|
|
}
|