Merged in feat/SW-1711-switch-icons (pull request #1558)
Switches out all the old icons to new ones, and moves them to the design system. The new icons are of three different types: Materialise Symbol, Nucleo, and Customized. Also adds further mapping between facilities/amenities and icons. Approved-by: Michael Zetterberg Approved-by: Erik Tiekstra
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
import type { IconName } from "@/types/components/icon"
|
||||
import type { IconName } from "@/components/Icons/iconName"
|
||||
import type { accordionItemVariants } from "./variants"
|
||||
|
||||
export interface AccordionItemProps
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
import { useRef } from "react"
|
||||
|
||||
import { ChevronDownIcon } from "@/components/Icons"
|
||||
import { getIconByIconName } from "@/components/Icons/get-icon-by-icon-name"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
||||
|
||||
import { IconByIconName } from "@/components/Icons/IconByIconName"
|
||||
import { trackAccordionClick } from "@/utils/tracking"
|
||||
|
||||
import Body from "../../Text/Body"
|
||||
@@ -28,10 +29,11 @@ export default function AccordionItem({
|
||||
const contentRef = useRef<HTMLDivElement>(null)
|
||||
const detailsRef = useRef<HTMLDetailsElement>(null)
|
||||
|
||||
const FoundIcon = getIconByIconName(iconName)
|
||||
const IconComp = icon
|
||||
? icon
|
||||
: FoundIcon && <FoundIcon color="baseTextHighcontrast" />
|
||||
: iconName && (
|
||||
<IconByIconName iconName={iconName} color="Icon/Interactive/Accent" />
|
||||
)
|
||||
|
||||
function toggleAccordion() {
|
||||
const details = detailsRef.current
|
||||
@@ -83,11 +85,11 @@ export default function AccordionItem({
|
||||
{subtitle && <Body color="baseTextHighContrast">{subtitle}</Body>}
|
||||
</div>
|
||||
)}
|
||||
<ChevronDownIcon
|
||||
<MaterialIcon
|
||||
icon="keyboard_arrow_down"
|
||||
className={styles.chevron}
|
||||
color="burgundy"
|
||||
width={20}
|
||||
height={20}
|
||||
color="Icon/Interactive/Default"
|
||||
size={20}
|
||||
/>
|
||||
</summary>
|
||||
<div ref={contentRef} className={styles.content}>
|
||||
|
||||
Reference in New Issue
Block a user