feat(WEB-112): adjust current-blocks-page to new model
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import Link from "next/link"
|
||||
import { cva } from "class-variance-authority"
|
||||
import { BlockListItemsEnum } from "@/types/requests/blocks/list"
|
||||
|
||||
@@ -63,27 +62,6 @@ export default function ListItem({ listItem }: { listItem: ListItem }) {
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
case BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink:
|
||||
const link = listItem.list_item_internal_link.pageConnection.edges[0]
|
||||
const linkUrlWithLocale = `/${link.node.system.locale}${link.node.url}`
|
||||
return (
|
||||
<li
|
||||
key={link.node.system.uid}
|
||||
className={listItemStyle({
|
||||
type: listItem.list_item_internal_link.list_item_style,
|
||||
})}
|
||||
>
|
||||
<Link href={linkUrlWithLocale} className={styles.link}>
|
||||
{listItem.list_item_internal_link.link_text}
|
||||
</Link>
|
||||
{listItem.list_item_internal_link.subtitle && (
|
||||
<span>
|
||||
<br />
|
||||
{listItem.list_item_internal_link.subtitle}
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
)
|
||||
|
||||
default:
|
||||
return null
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import type { ListProps } from "@/types/requests/blocks/list"
|
||||
import ListItem from "./ListItem"
|
||||
|
||||
import styles from "./list.module.css"
|
||||
import ListItem from "./ListItem"
|
||||
|
||||
import type { ListProps } from "@/types/requests/blocks/list"
|
||||
|
||||
export default function List({ list }: ListProps) {
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
{list.title ? <h2 className={styles.title}>{list.title}</h2> : null}
|
||||
<ul className={styles.ul}>
|
||||
{list.list_items.map((item, i) => (
|
||||
<ListItem listItem={item} key={`list-item-${i}`} />
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
.title {
|
||||
color: #483729;
|
||||
font-family: BrandonText-Bold, Arial, Helvetica, sans-serif;
|
||||
font-size: 1.375rem;
|
||||
line-height: 1.1em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 400;
|
||||
color: #483729;
|
||||
line-height: 1.1em;
|
||||
margin-bottom: 1rem;
|
||||
margin-top: 2rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.title:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.ul {
|
||||
@@ -64,4 +69,4 @@
|
||||
.title {
|
||||
font-size: 1.625rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user