feat(SW-285): Add support for sidebar
This commit is contained in:
33
components/Content/Sidebar/JoinLoyalty/Contact/index.tsx
Normal file
33
components/Content/Sidebar/JoinLoyalty/Contact/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
import ContactRow from "./ContactRow"
|
||||
|
||||
import styles from "./contact.module.css"
|
||||
|
||||
import { JoinLoyaltyContactTypenameEnum } from "@/types/components/content/enums"
|
||||
import type { ContactProps } from "@/types/components/content/sidebar"
|
||||
|
||||
export default async function Contact({ contactBlock }: ContactProps) {
|
||||
const { formatMessage } = await getIntl()
|
||||
return (
|
||||
<article className={styles.contactContainer}>
|
||||
<Subtitle>{formatMessage({ id: "Contact us" })}</Subtitle>
|
||||
<section className={styles.contact}>
|
||||
{contactBlock.map(({ contact, __typename }, i) => {
|
||||
switch (__typename) {
|
||||
case JoinLoyaltyContactTypenameEnum.ContentPageSidebarJoinLoyaltyContactBlockContactContact:
|
||||
return (
|
||||
<ContactRow
|
||||
key={`${contact.display_text}-${i}`}
|
||||
contact={contact}
|
||||
/>
|
||||
)
|
||||
default:
|
||||
return null
|
||||
}
|
||||
})}
|
||||
</section>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user