Skip to content

Commit

Permalink
fix: improve recently used apps card (#1066)
Browse files Browse the repository at this point in the history
fix: minor improvements for copy / app filtering for new installations
  • Loading branch information
reneaaron authored Feb 6, 2025
1 parent 342dfe2 commit 7fafed3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/src/components/home/widgets/LatestUsedAppsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ import { useApps } from "src/hooks/useApps";

export function LatestUsedAppsWidget() {
const { data: apps } = useApps();
if (!apps?.length) {
const usedApps = apps?.filter((x) => x.lastEventAt);

if (!usedApps?.length) {
return null;
}

return (
<Card>
<CardHeader>
<CardTitle>Latest Used Apps</CardTitle>
<CardTitle>Recently Used Apps</CardTitle>
</CardHeader>
<CardContent className="grid grid-cols-1 gap-4">
{apps
{usedApps
.sort(
(a, b) =>
new Date(b.lastEventAt ?? 0).getTime() -
Expand All @@ -34,12 +36,12 @@ export function LatestUsedAppsWidget() {
<div className="flex items-center justify-between w-full">
<div className="flex items-center justify-center gap-4">
<AppAvatar app={app} className="w-14 h-14 rounded-lg" />
<p className="text-xl font-semibold">
<p className="text-sm font-medium">
{app.name === "getalby.com" ? "Alby Account" : app.name}
</p>
</div>
<div className="flex items-center justify-center gap-4">
<p className="text-sm text-muted-foreground">
<p className="text-xs text-muted-foreground">
{app.lastEventAt
? dayjs(app.lastEventAt).fromNow()
: "never"}
Expand Down

0 comments on commit 7fafed3

Please sign in to comment.