Skip to content

Commit

Permalink
feat(ui): add description prop on Title component
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Nov 8, 2023
1 parent 6516af3 commit 4badc98
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/shared/components/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ import { ComponentProps } from 'react'

interface Props extends ComponentProps<'h1'> {
text: string
description?: string
}

export function Title({ text, ...props }: Props) {
export function Title({ text, description, ...props }: Props) {
return (
<h1
{...props}
className="mb-8 bg-gradient-to-br from-neutral-900 via-neutral-900/90 to-neutral-900/70 bg-clip-text text-center text-4xl font-semibold text-transparent dark:from-neutral-300 dark:via-neutral-300/90 dark:to-neutral-300/70 md:w-fit md:text-left"
>
{text}
</h1>
<div className="mb-8 inline">
<h1
{...props}
className="bg-gradient-to-br from-neutral-900 via-neutral-900/90 to-neutral-900/70 bg-clip-text text-center text-4xl font-semibold text-transparent dark:from-neutral-300 dark:via-neutral-300/90 dark:to-neutral-300/70 md:w-fit md:text-left"
>
{text}
</h1>
{description && (
<span className="text-xs text-neutral-400 dark:text-neutral-600">
{description}
</span>
)}
</div>
)
}

0 comments on commit 4badc98

Please sign in to comment.