feat: add JoinLoyalty component
This commit is contained in:
20
components/Loyalty/Sidebar/index.tsx
Normal file
20
components/Loyalty/Sidebar/index.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import JsonToHtml from "@/components/JsonToHtml"
|
||||
import JoinLoyaltyContact from "./JoinLoyalty"
|
||||
|
||||
import { Sidebar, SidebarTypenameEnum } from "@/types/requests/loyaltyPage"
|
||||
|
||||
export default function SidebarLoyalty({ block }: { block: Sidebar }) {
|
||||
switch (block.__typename) {
|
||||
case SidebarTypenameEnum.LoyaltyPageSidebarContent:
|
||||
return (
|
||||
<JsonToHtml
|
||||
embeds={block.content.embedded_itemsConnection.edges}
|
||||
nodes={block.content.json.children}
|
||||
/>
|
||||
)
|
||||
case SidebarTypenameEnum.LoyaltyPageSidebarJoinLoyaltyContact:
|
||||
return <JoinLoyaltyContact block={block.join_loyalty_contact} />
|
||||
default:
|
||||
return null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user