-
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.
- Loading branch information
Showing
19 changed files
with
645 additions
and
482 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,59 @@ | ||
import { formatDate } from "@lib/utils" | ||
import type { CollectionEntry } from "astro:content" | ||
import { formatDate } from '@lib/utils' | ||
|
||
type Props = { | ||
entry: CollectionEntry<"blog"> | CollectionEntry<"projects"> | ||
entry: any | ||
pill?: boolean | ||
} | ||
|
||
export default function ArrowCard({entry, pill}: Props) { | ||
return ( | ||
<a href={`/${entry.collection}/${entry.slug}`} class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out"> | ||
export default function ArrowCard({ entry, pill }: Props) { | ||
return ( | ||
<a | ||
href={`/${entry.collection}/${entry.slug}`} | ||
class="group p-4 gap-3 flex items-center border rounded-lg hover:bg-black/5 hover:dark:bg-white/10 border-black/15 dark:border-white/20 transition-colors duration-300 ease-in-out"> | ||
<div class="w-full group-hover:text-black group-hover:dark:text-white blend"> | ||
<div class="flex flex-wrap items-center gap-2"> | ||
{pill && | ||
{pill && ( | ||
<div class="text-sm capitalize px-2 py-0.5 rounded-full border border-black/15 dark:border-white/25"> | ||
{entry.collection === "blog" ? "post" : "project"} | ||
{entry.collection === 'blog' ? 'post' : 'project'} | ||
</div> | ||
} | ||
<div class="text-sm uppercase"> | ||
{formatDate(entry.data.date)} | ||
</div> | ||
)} | ||
<div class="text-sm uppercase">{formatDate(entry.data.date)}</div> | ||
</div> | ||
<div class="font-semibold mt-3 text-black dark:text-white"> | ||
{entry.data.title} | ||
</div> | ||
|
||
<div class="text-sm line-clamp-2"> | ||
{entry.data.summary} | ||
</div> | ||
<div class="text-sm line-clamp-2">{entry.data.summary}</div> | ||
<ul class="flex flex-wrap mt-2 gap-1"> | ||
{entry.data.tags.map((tag:string) => ( // this line has an error; Parameter 'tag' implicitly has an 'any' type.ts(7006) | ||
{entry.data.tags.map((tag: string) => ( | ||
<li class="text-xs uppercase py-0.5 px-1 rounded bg-black/5 dark:bg-white/20 text-black/75 dark:text-white/75"> | ||
{tag} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="stroke-current group-hover:stroke-black group-hover:dark:stroke-white"> | ||
<line x1="5" y1="12" x2="19" y2="12" class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" /> | ||
<polyline points="12 5 19 12 12 19" class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" /> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="20" | ||
height="20" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
stroke-width="2.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
class="stroke-current group-hover:stroke-black group-hover:dark:stroke-white"> | ||
<line | ||
x1="5" | ||
y1="12" | ||
x2="19" | ||
y2="12" | ||
class="scale-x-0 group-hover:scale-x-100 translate-x-4 group-hover:translate-x-1 transition-all duration-300 ease-in-out" | ||
/> | ||
<polyline | ||
points="12 5 19 12 12 19" | ||
class="translate-x-0 group-hover:translate-x-1 transition-all duration-300 ease-in-out" | ||
/> | ||
</svg> | ||
</a> | ||
) | ||
} | ||
) | ||
} |
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
Oops, something went wrong.