feat(WEB-154): my profile view
This commit is contained in:
@@ -1,41 +1,21 @@
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from "./title.module.css"
|
||||
import { headingVariants } from "./variants"
|
||||
|
||||
import type { HeadingProps } from "@/types/components/myPages/title"
|
||||
|
||||
const config = {
|
||||
variants: {
|
||||
text: {
|
||||
uppercase: styles.uppercase,
|
||||
},
|
||||
type: {
|
||||
h1: styles.h1,
|
||||
h2: styles.h2,
|
||||
h3: styles.h3,
|
||||
h4: styles.h4,
|
||||
h5: styles.h5,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
type: "h1",
|
||||
},
|
||||
} as const
|
||||
|
||||
const headingStyles = cva(styles.heading, config)
|
||||
|
||||
export default function Title({
|
||||
as,
|
||||
children,
|
||||
className = "",
|
||||
level = "h1",
|
||||
uppercase = false,
|
||||
weight,
|
||||
}: HeadingProps) {
|
||||
const Hx = level
|
||||
const classNames = headingStyles({
|
||||
const classNames = headingVariants({
|
||||
className,
|
||||
text: uppercase ? "uppercase" : undefined,
|
||||
type: as ?? level,
|
||||
weight,
|
||||
})
|
||||
return <Hx className={classNames}>{children}</Hx>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user