fix(BOOK-436): Added new section component and deprecated the other
Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
48
apps/scandic-web/components/Section/Header/Deprecated.tsx
Normal file
48
apps/scandic-web/components/Section/Header/Deprecated.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import Preamble from "@scandic-hotels/design-system/Preamble"
|
||||
import Title, { type HeadingProps } from "@scandic-hotels/design-system/Title"
|
||||
|
||||
import SectionLink from "../Link"
|
||||
|
||||
import styles from "./header.module.css"
|
||||
|
||||
type HeaderProps = {
|
||||
link?: {
|
||||
href: string
|
||||
text: string
|
||||
}
|
||||
preamble?: string | null
|
||||
textTransform?: HeadingProps["textTransform"]
|
||||
title?: string | null
|
||||
headingLevel?: HeadingProps["level"]
|
||||
headingAs?: HeadingProps["as"]
|
||||
}
|
||||
/**
|
||||
* @deprecated Use `@/components/Section/Header` instead.
|
||||
*/
|
||||
export default function SectionHeader({
|
||||
link,
|
||||
preamble,
|
||||
title,
|
||||
textTransform,
|
||||
headingAs = "h4",
|
||||
headingLevel = "h2",
|
||||
}: HeaderProps) {
|
||||
if (!title && !preamble && !link) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<header className={styles.header}>
|
||||
<Title
|
||||
as={headingAs}
|
||||
className={styles.title}
|
||||
level={headingLevel}
|
||||
textTransform={textTransform}
|
||||
>
|
||||
{title}
|
||||
</Title>
|
||||
{preamble && <Preamble className={styles.preamble}>{preamble}</Preamble>}
|
||||
<SectionLink link={link} variant="desktop" />
|
||||
</header>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user