Skip to content

Commit

Permalink
feat: add last commit date to projects (#64)
Browse files Browse the repository at this point in the history
* feat: add last commit date to projects

* refactor: remove explicit locale

Co-authored-by: Leonardo Montini <[email protected]>

* fix: revert createAdminClient change

---------

Co-authored-by: Leonardo Montini <[email protected]>
  • Loading branch information
xRiku and Balastrong authored Dec 10, 2024
1 parent fab47f4 commit 10d00d0
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions src/components/PublicProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { use, useMemo } from "react"
import { Activity } from "react-activity-calendar"
import { ActivityCalendar } from "./ActivityCalendar"
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card"
import { History } from "lucide-react"

type Props = {
project: Tables<"projects">
Expand All @@ -31,25 +32,34 @@ export function PublicProjectCard({ project, activityPromise }: Props) {
return (
<Card className="w-full max-w-fit" style={{ order }}>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Image
width={40}
height={40}
src={`https://github.com/${project.ownerLogin}.png?size=80`}
alt={project.ownerLogin}
className={`size-10 bg-gray-300 ${
project.ownerType === "User" ? "rounded-full" : "rounded-md"
}`}
/>
<a
href={`https://github.com/${project.ownerLogin}/${project.name}`}
target="_blank"
className="text-nowrap"
>
<span>{project.ownerLogin}/</span>
<wbr />
<span>{project.name}</span>
</a>
<CardTitle className="flex items-center justify-between">
<div className="flex items-center gap-2">
<Image
width={40}
height={40}
src={`https://github.com/${project.ownerLogin}.png?size=80`}
alt={project.ownerLogin}
className={`size-10 bg-gray-300 ${
project.ownerType === "User" ? "rounded-full" : "rounded-md"
}`}
/>
<a
href={`https://github.com/${project.ownerLogin}/${project.name}`}
target="_blank"
className="text-nowrap"
>
<span>{project.ownerLogin}/</span>
<wbr />
<span>{project.name}</span>
</a>
</div>

{lastCommit && (
<span className="flex items-center gap-1 text-xs font-medium">
<History className="h-4 w-4" /> Last commit:{" "}
{new Date(lastCommit).toLocaleDateString()}
</span>
)}
</CardTitle>
</CardHeader>
<CardContent>
Expand Down

0 comments on commit 10d00d0

Please sign in to comment.