Files
web/apps/scandic-web/components/Sidebar/JoinLoyalty/index.tsx
Joakim Jäderberg aafad9781f Merged in feat/lokalise-rebuild (pull request #2993)
Feat/lokalise rebuild

* chore(lokalise): update translation ids

* chore(lokalise): easier to switch between projects

* chore(lokalise): update translation ids

* .

* .

* .

* .

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* .

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* chore(lokalise): new translations

* merge

* switch to errors for missing id's

* merge

* sync translations


Approved-by: Linus Flood
2025-10-22 11:00:03 +00:00

69 lines
2.2 KiB
TypeScript

import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { ScandicFriends } from "@/components/Levels"
import { getIntl } from "@/i18n"
import { isLoggedInUser } from "@/utils/isLoggedInUser"
import Contact from "./Contact"
import { LoyaltyLoginButton } from "./LoyaltyLoginButton"
import ReadMore from "./ReadMore"
import styles from "./joinLoyalty.module.css"
import type { JoinLoyaltyContactProps } from "@/types/components/sidebar/joinLoyaltyContact"
export default async function JoinLoyaltyContact({
block,
}: JoinLoyaltyContactProps) {
const [intl, isLoggedIn] = await Promise.all([getIntl(), isLoggedInUser()])
if (isLoggedIn) {
return null
}
return (
<section className={styles.joinLoyaltyContainer}>
<article className={styles.wrapper}>
{block.title ? (
<Typography variant={"Title/Subtitle/md"}>
<h4 className={styles.title}>{block.title}</h4>
</Typography>
) : null}
<ScandicFriends color="red" />
{block.preamble ? (
<Typography variant={"Body/Paragraph/mdRegular"}>
<p className={styles.preamble}>{block.preamble}</p>
</Typography>
) : null}
{block.button ? (
<Typography variant={"Body/Paragraph/mdBold"}>
<ButtonLink
className={styles.button}
size={"Small"}
wrapping
href={block.button.href}
target={block.button.openInNewTab ? "_blank" : "_self"}
>
{block.button.title}
</ButtonLink>
</Typography>
) : null}
<section className={styles.loginContainer}>
<Typography variant={"Body/Paragraph/mdRegular"}>
<p>
{intl.formatMessage({
id: "loyalty.alreadyFriend",
defaultMessage: "Already a friend?",
})}
</p>
</Typography>
<LoyaltyLoginButton />
</section>
</article>
{block.contact ? <Contact contactBlock={block.contact} /> : null}
<ReadMore />
</section>
)
}