feat(SW-322): make Shortcut reusable component
This commit is contained in:
28
components/Blocks/Shortcuts/Shortcut/index.tsx
Normal file
28
components/Blocks/Shortcuts/Shortcut/index.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { ArrowRightIcon } from "@/components/Icons"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
|
||||
import styles from "./shortcut.module.css"
|
||||
|
||||
import { ShortcutsListProps } from "@/types/components/myPages/myPage/shortcuts"
|
||||
|
||||
export default function Shortcut({ linkList }: ShortcutsListProps) {
|
||||
return (
|
||||
<>
|
||||
{linkList.map((shortcut) => (
|
||||
<Link
|
||||
href={shortcut.url}
|
||||
key={shortcut.title}
|
||||
target={shortcut.openInNewTab ? "_blank" : undefined}
|
||||
variant="shortcut"
|
||||
className={styles.link}
|
||||
>
|
||||
<Body textTransform="bold" color="burgundy">
|
||||
<span>{shortcut.text ? shortcut.text : shortcut.title}</span>
|
||||
</Body>
|
||||
<ArrowRightIcon color="burgundy" width={24} height={24} />
|
||||
</Link>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
}
|
||||
3
components/Blocks/Shortcuts/Shortcut/shortcut.module.css
Normal file
3
components/Blocks/Shortcuts/Shortcut/shortcut.module.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.link {
|
||||
background-color: var(--Base-Surface-Primary-light-Normal);
|
||||
}
|
||||
Reference in New Issue
Block a user