Skip to content

Commit

Permalink
feat: display subs and earn for lists list
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 25, 2024
1 parent 9fac848 commit c0d2663
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
36 changes: 16 additions & 20 deletions apps/renderer/src/modules/settings/tabs/lists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { apiClient } from "~/lib/api-fetch"
import { cn, isBizId } from "~/lib/utils"
import type { ListModel } from "~/models"
import { ViewSelectorRadioGroup } from "~/modules/shared/ViewSelectorRadioGroup"
import { Balance } from "~/modules/wallet/balance"
import { Queries } from "~/queries"
import { feedActions, getFeedById, useFeedById } from "~/store/feed"
import { useSubscriptionStore } from "~/store/subscription"
Expand Down Expand Up @@ -78,16 +79,11 @@ export const SettingLists = () => {
<TableHeader className="border-b">
<TableRow className="[&_*]:!font-semibold">
<TableHead size="sm">{t.settings("lists.title")}</TableHead>
<TableHead className="w-36" size="sm">
{t.settings("lists.view")}
</TableHead>
<TableHead className="w-20" size="sm">
{t.settings("lists.fee.label")}
</TableHead>

<TableHead className="w-20 text-center" size="sm">
{t.common("words.actions")}
</TableHead>
<TableHead size="sm">{t.settings("lists.view")}</TableHead>
<TableHead size="sm">{t.settings("lists.fee.label")}</TableHead>
<TableHead size="sm">{t.settings("lists.subscriptions")}</TableHead>
<TableHead size="sm">{t.settings("lists.earnings")}</TableHead>
<TableHead size="sm">{t.common("words.actions")}</TableHead>
</TableRow>
</TableHeader>
<TableBody className="border-t-[12px] border-transparent [&_td]:!px-3">
Expand All @@ -107,22 +103,22 @@ export const SettingLists = () => {
<span className="inline-block max-w-[200px] truncate">{row.title}</span>
</a>
</TableCell>
<TableCell align="center" size="sm">
<div className="flex items-center gap-1">
{t(views[row.view].name)}
<span className={cn("inline-flex items-center", views[row.view].className)}>
{views[row.view].icon}
</span>
</div>
<TableCell size="sm">
<span className={cn("inline-flex items-center", views[row.view].className)}>
{views[row.view].icon}
</span>
</TableCell>
<TableCell align="center" size="sm">
<TableCell size="sm">
<div className="flex items-center gap-1">
{row.fee}
<i className="i-mgc-power shrink-0 text-lg text-accent" />
</div>
</TableCell>

<TableCell align="center" size="sm">
<TableCell size="sm">{row.subscriptionCount}</TableCell>
<TableCell size="sm">
<Balance>{BigInt(row.purchaseAmount || 0n)}</Balance>
</TableCell>
<TableCell size="sm">
<Tooltip>
<TooltipTrigger>
<Button
Expand Down
6 changes: 4 additions & 2 deletions locales/settings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"feeds.noFeeds": "No claimed feeds",
"feeds.tableHeaders.entryCount": "Entries",
"feeds.tableHeaders.name": "Name",
"feeds.tableHeaders.subscriptionCount": "Subscriptions",
"feeds.tableHeaders.tipAmount": "Received tips",
"feeds.tableHeaders.subscriptionCount": "Subs",
"feeds.tableHeaders.tipAmount": "Tips",
"general.app": "App",
"general.data_persist.description": "Persist data locally to enable offline access and local search.",
"general.data_persist.label": "Persist data for offline usage",
Expand Down Expand Up @@ -156,6 +156,7 @@
"lists.created.error": "Failed to create list.",
"lists.created.success": "List created successfully!",
"lists.description": "Description",
"lists.earnings": "Earn",
"lists.edit.error": "Failed to edit list.",
"lists.edit.label": "Edit",
"lists.edit.success": "List edited successfully!",
Expand All @@ -177,6 +178,7 @@
"lists.info": "Lists are collections of feeds that you can share or sell for others to subscribe to. Subscribers will synchronize and access all feeds in the list.",
"lists.noLists": "No lists",
"lists.submit": "Submit",
"lists.subscriptions": "Subs",
"lists.title": "Title",
"lists.view": "View",
"profile.avatar.label": "Avatar",
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/hono.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,8 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
handle: string | null;
createdAt: string;
} | null | undefined;
subscriptionCount?: number | undefined;
purchaseAmount?: number | undefined;
}[];
};
outputFormat: "json" | "text";
Expand Down

0 comments on commit c0d2663

Please sign in to comment.