Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
indaviande committed Dec 17, 2024
1 parent 37bc6f4 commit b24e0ac
Showing 1 changed file with 8 additions and 43 deletions.
51 changes: 8 additions & 43 deletions src/components/primitives/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { forwardRef } from "react";
import { tv } from "tailwind-variants";
import { mergeClass } from "../../utils/css";
import type { Component, Styled } from "../../utils/types";
import { textStyles } from "./Text";
import { mergeClass } from "../../utils/css";

export const titleStyles = tv(
{
Expand All @@ -21,7 +21,7 @@ export const titleStyles = tv(
look: "base",
},
},
{ twMerge: false }
{ twMerge: false },
);

export type TitleProps = Component<
Expand All @@ -34,56 +34,21 @@ export type TitleProps = Component<

const Title = forwardRef<HTMLHeadingElement, TitleProps>(function Title(
{ look, h, size: _size, className, ...props }: TitleProps,
ref
ref,
) {
const size = _size ?? h;

switch (h) {
case 1:
return (
<h1
ref={ref}
className={mergeClass(titleStyles({ look, size }), className)}
children={" "}
{...props}
/>
);
return <h1 ref={ref} className={mergeClass(titleStyles({ look, size }), className)} children={" "} {...props} />;
case 2:
return (
<h2
ref={ref}
className={mergeClass(titleStyles({ look, size }), className)}
children={" "}
{...props}
/>
);
return <h2 ref={ref} className={mergeClass(titleStyles({ look, size }), className)} children={" "} {...props} />;
case 3:
return (
<h3
ref={ref}
className={mergeClass(titleStyles({ look, size }), className)}
children={" "}
{...props}
/>
);
return <h3 ref={ref} className={mergeClass(titleStyles({ look, size }), className)} children={" "} {...props} />;
case 4:
return (
<h4
ref={ref}
className={mergeClass(titleStyles({ look, size }), className)}
children={" "}
{...props}
/>
);
return <h4 ref={ref} className={mergeClass(titleStyles({ look, size }), className)} children={" "} {...props} />;
case 5:
return (
<h5
ref={ref}
className={mergeClass(titleStyles({ look, size }), className)}
children={" "}
{...props}
/>
);
return <h5 ref={ref} className={mergeClass(titleStyles({ look, size }), className)} children={" "} {...props} />;
default:
break;
}
Expand Down

0 comments on commit b24e0ac

Please sign in to comment.