-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: design improvements + create
posts
component
- Loading branch information
Showing
6 changed files
with
54 additions
and
20 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,32 @@ | ||
<script lang="ts"> | ||
import type { Post } from '@/types/post.type'; | ||
import Badge from '@/ui/badge/badge.svelte'; | ||
import { formatDate } from '@/utils'; | ||
export let postData: Post[] = []; | ||
</script> | ||
|
||
<section class="flex flex-col space-y-4"> | ||
<h2 class="text-xl font-medium">Posts</h2> | ||
{#each postData as post} | ||
<div class="w-full rounded-md border border-neutral-300 p-3 dark:border-neutral-800"> | ||
<div class="mb-3 flex flex-col space-y-1"> | ||
<a | ||
href={`/post/${post.slug}`} | ||
class="w-max text-lg font-medium decoration-neutral-500 decoration-dotted underline-offset-[5px] duration-150 hover:underline hover:opacity-80" | ||
> | ||
{post.title} | ||
</a> | ||
<p class="text-pretty text-sm dark:text-neutral-400"> | ||
{post.description} | ||
</p> | ||
</div> | ||
<div class="flex items-center justify-between"> | ||
<Badge>{post.category}</Badge> | ||
<p class="font-mono text-sm text-neutral-500 dark:text-neutral-400"> | ||
{formatDate(post.date)} | ||
</p> | ||
</div> | ||
</div> | ||
{/each} | ||
</section> |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<span | ||
class="cursor-default rounded-md border border-neutral-200 bg-neutral-200/50 px-2 py-1 font-mono text-xs font-medium text-neutral-600 dark:border-neutral-800 dark:bg-neutral-800/60 dark:text-neutral-300" | ||
class="cursor-default rounded-md border border-neutral-300 bg-neutral-200/50 px-2 py-1 font-mono text-xs font-medium text-neutral-600 dark:border-neutral-800 dark:bg-neutral-800/60 dark:text-neutral-300" | ||
> | ||
<slot /> | ||
</span> |