feat(SW-667): read more section to join loyalty sidebar

This commit is contained in:
Chuma McPhoy
2024-10-25 13:55:08 +02:00
parent cf0449ae8e
commit 2fddc503c5
5 changed files with 105 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n"
import Contact from "./Contact"
import ReadMore from "./ReadMore"
import styles from "./joinLoyalty.module.css"
@@ -18,15 +19,15 @@ import type { JoinLoyaltyContactProps } from "@/types/components/sidebar/joinLoy
export default async function JoinLoyaltyContact({
block,
}: JoinLoyaltyContactProps) {
const intl = await getIntl()
const user = await getName()
const [intl, user] = await Promise.all([getIntl(), getName()])
// Check if we have user, that means we are logged in.
if (user) {
return null
}
return (
<section>
<section className={styles.joinLoyaltyContainer}>
<article className={styles.wrapper}>
<Title as="h4" level="h3" textTransform="capitalize">
{block.title}
@@ -70,6 +71,7 @@ export default async function JoinLoyaltyContact({
</section>
</article>
{block.contact ? <Contact contactBlock={block.contact} /> : null}
<ReadMore />
</section>
)
}