feat(SW-322): implement two column list

This commit is contained in:
Fredrik Thorsson
2024-10-07 10:38:07 +02:00
parent 81ece30a0d
commit 5ea3410006
11 changed files with 118 additions and 26 deletions
+8 -19
View File
@@ -1,10 +1,8 @@
import { ArrowRightIcon } from "@/components/Icons"
import SectionContainer from "@/components/Section/Container"
import SectionHeader from "@/components/Section/Header"
import Link from "@/components/TempDesignSystem/Link"
import Body from "@/components/TempDesignSystem/Text/Body"
import styles from "./shortcuts.module.css"
import OneColumnList from "./OneColumnList"
import TwoColumnList from "./TwoColumList"
import type { ShortcutsProps } from "@/types/components/myPages/myPage/shortcuts"
@@ -13,25 +11,16 @@ export default function Shortcuts({
shortcuts,
subtitle,
title,
columns,
}: ShortcutsProps) {
return (
<SectionContainer>
<SectionHeader preamble={subtitle} title={title} topTitle={firstItem} />
<section className={styles.links}>
{shortcuts.map((shortcut) => (
<Link
href={shortcut.url}
key={shortcut.title}
target={shortcut.openInNewTab ? "_blank" : undefined}
variant="shortcut"
>
<Body textTransform="bold" color="burgundy">
<span>{shortcut.text ? shortcut.text : shortcut.title}</span>
</Body>
<ArrowRightIcon color="burgundy" className={styles.arrowRight} />
</Link>
))}
</section>
{columns ? (
<TwoColumnList linkList={shortcuts} />
) : (
<OneColumnList linkList={shortcuts} />
)}
</SectionContainer>
)
}