-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccbd8e0
commit 2613efa
Showing
5 changed files
with
94 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Badge } from "@/components/ui/badge" | ||
import { Separator } from "@/components/ui/separator" | ||
import { Metadata } from "next" | ||
import Link from "next/link" | ||
|
||
const MOCK_DATA = [ | ||
{ | ||
id: 1, | ||
created_at: '12 oct 2024', | ||
title: 'Create and animate beautiful patterns', | ||
tag: 'Design', | ||
slug: 'create-and-animate-beautiful-patterns', | ||
}, | ||
{ | ||
id: 2, | ||
created_at: '24 oct 2024', | ||
title: 'Magic git commands', | ||
tag: 'Git', | ||
slug: 'magic-git-commands', | ||
}, | ||
] | ||
|
||
export const metadata: Metadata = { | ||
title: 'Thoughts. | moonlitspace', | ||
description: 'my graceful thoughts', | ||
} | ||
|
||
export default function Thoughts() { | ||
return ( | ||
<main className="w-full flex flex-col gap-10 mt-10"> | ||
<h2 className="text-3xl font-bold">Thoughts.</h2> | ||
<div className="flex flex-col gap-5"> | ||
{MOCK_DATA.map((item) => ( | ||
<div key={item.id} className="flex flex-col"> | ||
<span className="text-xs uppercase font-bold text-muted-foreground">{item.created_at}</span> | ||
<div className="flex items-center gap-2"> | ||
<Link href={`/thoughts/${item.slug}`} className="text-lg relative before:bg-transparent before:absolute before:bottom-1 before:w-full before:h-0.5 before:duration-200 hover:before:bottom-0 hover:before:bg-primary"> | ||
{item.title} | ||
</Link> | ||
<Separator className="flex-1" /> | ||
<Badge>{item.tag}</Badge> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from "react" | ||
import { cva, type VariantProps } from "class-variance-authority" | ||
|
||
import { cn } from "@/lib/utils" | ||
|
||
const badgeVariants = cva( | ||
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", | ||
{ | ||
variants: { | ||
variant: { | ||
default: | ||
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80", | ||
secondary: | ||
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", | ||
destructive: | ||
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", | ||
outline: "text-foreground", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
}, | ||
} | ||
) | ||
|
||
export interface BadgeProps | ||
extends React.HTMLAttributes<HTMLDivElement>, | ||
VariantProps<typeof badgeVariants> {} | ||
|
||
function Badge({ className, variant, ...props }: BadgeProps) { | ||
return ( | ||
<div className={cn(badgeVariants({ variant }), className)} {...props} /> | ||
) | ||
} | ||
|
||
export { Badge, badgeVariants } |