diff --git a/dashboard/app/api/analystics/topapps/getAppStats.ts b/dashboard/app/api/analystics/topapps/getAppStats.ts index 22fb96e..17e6006 100644 --- a/dashboard/app/api/analystics/topapps/getAppStats.ts +++ b/dashboard/app/api/analystics/topapps/getAppStats.ts @@ -2,6 +2,8 @@ import { duckdb, toParquetSql } from "@/lib/duckdb" import "server-only" +import { apps } from "@/config/apps" + import { DateRangeKey, getDateRangeCondition } from "../utils" export async function getTotalApps() { @@ -17,6 +19,9 @@ export async function getTotalApps() { export type TopApps = { name: string value: number + description?: string + icon?: string + url?: string }[] export async function getTopApps(rangeKey: DateRangeKey) { @@ -34,6 +39,15 @@ export async function getTopApps(rangeKey: DateRangeKey) { if (!r.name) { r.name = "other" } + + const allApps = apps.find( + (app) => app.name.toLowerCase() === r.name.toLowerCase() + ) + if (allApps) { + r.description = allApps.description + r.icon = allApps.icon + r.url = allApps.url + } }) return result as TopApps diff --git a/dashboard/app/page.tsx b/dashboard/app/page.tsx index 6ca43e2..958d44f 100644 --- a/dashboard/app/page.tsx +++ b/dashboard/app/page.tsx @@ -1,9 +1,9 @@ import DailyProfileStats from "@/components/daily-profile-stats" import DailyPublicationStats from "@/components/daily-publication-stats" +import DailyApps from "@/components/dailyapps" import DauStats from "@/components/dau-stats" import Publications, { PublicationsProps } from "@/components/publications" import StatCards from "@/components/stat-cards" -import TopProfiles from "@/components/top-profiles" export const revalidate = 900 @@ -18,11 +18,9 @@ export default async function Home() { return (
-
-
- -
-
+
+ +
diff --git a/dashboard/components/apps-summary.tsx b/dashboard/components/apps-summary.tsx index 912f6e9..92f4e86 100644 --- a/dashboard/components/apps-summary.tsx +++ b/dashboard/components/apps-summary.tsx @@ -1,52 +1,13 @@ import Image from "next/image" import Link from "next/link" +import { recommendApps } from "@/config/apps" import { getTotalApps } from "@/app/api/analystics/topapps/getAppStats" import { Button } from "./ui/button" import { Card, CardContent } from "./ui/card" export default async function AppsSummary() { - // recommend apps list - const recommendApps = [ - { - name: "Orb", - description: - "Mobile experience with a focus on creators and communities ", - icon: "/apps/orb.png", - url: "https://orb.ac", - }, - { - name: "Buttrfly", - description: "Web3 Social Explorer", - icon: "/apps/buttrfly.png", - url: "https://buttrfly.app/", - }, - { - name: "T2", - description: "Where writers find their niche", - icon: "/apps/t2.png", - url: "https://t2.world/", - }, - { - name: "Hey", - description: "Open source platform for desktop", - icon: "/apps/hey.png", - url: "https://hey.xyz/", - }, - { - name: "Tape", - description: "Open-source video platform for desktop", - icon: "/apps/tape.png", - url: "https://tape.xyz", - }, - { - name: "Dumpling", - description: "Streaming and steaming the best content from Lens", - icon: "/apps/dumpling.png", - url: "https://www.dumpling.lol/", - }, - ] const totalApps = await getTotalApps() return (
diff --git a/dashboard/components/charts/top-apps.tsx b/dashboard/components/charts/top-apps.tsx index 795fc6c..cc4dd60 100644 --- a/dashboard/components/charts/top-apps.tsx +++ b/dashboard/components/charts/top-apps.tsx @@ -6,6 +6,8 @@ import useSWR from "swr" import fetcher from "@/lib/fetcher" +import { Error } from "../error" +import { Loader } from "../loader" import { ChartCard } from "./chart-card" interface TopAppsProps { @@ -13,9 +15,19 @@ interface TopAppsProps { } export default function TopApps({ className }: TopAppsProps) { - const [range, setRange] = useState("ALL") + const [range, setRange] = useState("1D") const queryString = `/api/analystics/topapps?range=${range}` - const { data, error } = useSWR(queryString, fetcher) + const { data: rawData, error } = useSWR(queryString, fetcher) + if (error) return + if (!rawData) return + + // only get name, value from data + const data: any = rawData.map((item: any) => { + return { + name: item.name, + value: item.value, + } + }) return ( + + +
Daily Apps
+ + + +
+
+
+ + {dailyApps.map((app) => ( + + + Orb logo +
+ {app.name} + + {app.description} + +
+ + + +
+
+ ))} +
+
+ + ) +} diff --git a/dashboard/components/footer.tsx b/dashboard/components/footer.tsx index 3b7d841..5b391af 100644 --- a/dashboard/components/footer.tsx +++ b/dashboard/components/footer.tsx @@ -1,11 +1,10 @@ +import Image from "next/image" import Link from "next/link" import { FaTelegram } from "react-icons/fa" import { FaXTwitter } from "react-icons/fa6" import { siteConfig } from "@/config/site" -import { Icons } from "./icons" - const navigation = [ { name: "Twitter", @@ -13,9 +12,9 @@ const navigation = [ icon: , }, { - name: "Lenster", + name: "Hey", href: siteConfig.links.lenster, - icon: , + icon: hey, }, { name: "Telegram", diff --git a/dashboard/components/icons.tsx b/dashboard/components/icons.tsx index 06e9673..498cc9c 100644 --- a/dashboard/components/icons.tsx +++ b/dashboard/components/icons.tsx @@ -63,7 +63,7 @@ export const Icons = { ), - hey: (props: IconProps) => ( + lenster: (props: IconProps) => ( - - Daily Stars - - - - {topProfiles.map((profile) => ( - -
- - {profile.metadata?.displayName || profile.handle?.localName} - -
- -
-
-
-

- {profile.stats.followers} -

-

Followers

-
-
-

- {profile.stats.following} -

-

Following

-
- {/*
-

{11}

-

Score

-
*/} -
-
- - ))} - - - - - ) -} diff --git a/dashboard/config/apps.ts b/dashboard/config/apps.ts new file mode 100644 index 0000000..6379f8c --- /dev/null +++ b/dashboard/config/apps.ts @@ -0,0 +1,48 @@ +export const recommendApps = [ + { + name: "Orb", + description: "Mobile experience with a focus on creators and communities ", + icon: "/apps/orb.png", + url: "https://orb.ac", + }, + { + name: "Buttrfly", + description: "Web3 Social Explorer", + icon: "/apps/buttrfly.png", + url: "https://buttrfly.app/", + }, + { + name: "T2", + description: "Where writers find their niche", + icon: "/apps/t2.png", + url: "https://t2.world/", + }, + { + name: "Hey", + description: "Open source platform for desktop", + icon: "/apps/hey.png", + url: "https://hey.xyz/", + }, + { + name: "Tape", + description: "Open-source video platform for desktop", + icon: "/apps/tape.png", + url: "https://tape.xyz", + }, + { + name: "Dumpling", + description: "Streaming and steaming the best content from Lens", + icon: "/apps/dumpling.png", + url: "https://www.dumpling.lol/", + }, +] + +export const apps = [ + ...recommendApps, + { + name: "Phaver", + description: "Social Without Silos", + icon: "/apps/phaver.svg", + url: "https://phaver.com/", + }, +] diff --git a/dashboard/public/apps/phaver.svg b/dashboard/public/apps/phaver.svg new file mode 100644 index 0000000..cb7a051 --- /dev/null +++ b/dashboard/public/apps/phaver.svg @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file