From f32014ca255d755035606151b96627e42eea9933 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Tue, 28 Oct 2025 19:50:37 -0400 Subject: [PATCH] Refactor/shared home layout (#230) * group home pages with shared layout * tweak discover button styles * make discover dynamic * add lazy loading for pub icon and bg images --- actions/getIdentityData.ts | 9 +- .../discover/PubListing.tsx | 27 ++-- .../discover/SortButtons.tsx | 0 .../discover/SortedPublicationList.tsx | 7 +- app/{ => (home-pages)}/discover/page.tsx | 32 ++--- .../home/Actions/AccountSettings.tsx | 0 .../home/Actions/Actions.tsx | 0 .../home/Actions/CreateNewButton.tsx | 0 .../home/Actions/HomeHelp.tsx | 0 .../home/HomeEmpty/DiscoverIllo.tsx | 0 .../home/HomeEmpty/HomeEmpty.tsx | 0 .../home/HomeEmpty/WelcomeToLeafletIllo.tsx | 0 app/{ => (home-pages)}/home/HomeLayout.tsx | 2 +- .../home/IdentitySetter.tsx | 0 .../home/LeafletList/LeafletContent.tsx | 0 .../home/LeafletList/LeafletInfo.tsx | 0 .../home/LeafletList/LeafletListItem.tsx | 0 .../home/LeafletList/LeafletOptions.tsx | 0 .../LeafletList/LeafletPreview.module.css | 0 .../home/LeafletList/LeafletPreview.tsx | 0 .../home/LoggedOutWarning.tsx | 0 app/{ => (home-pages)}/home/icon.tsx | 2 +- app/(home-pages)/home/page.tsx | 43 ++++++ app/{ => (home-pages)}/home/storage.ts | 0 app/(home-pages)/layout.tsx | 38 ++++++ app/(home-pages)/notifications/page.tsx | 3 + .../reader/ReaderContent.tsx | 3 +- .../reader/SubscriptionsContent.tsx | 2 +- .../reader/getReaderFeed.ts | 0 .../reader/getSubscriptions.ts | 0 app/{ => (home-pages)}/reader/idResolver.ts | 0 app/(home-pages)/reader/page.tsx | 38 ++++++ app/home/page.tsx | 124 ------------------ .../[publication]/dashboard/DraftList.tsx | 2 +- app/login/LoginForm.tsx | 2 +- app/reader/page.tsx | 104 --------------- components/ActionBar/Publications.tsx | 18 +-- components/Pages/useCardBorderHidden.ts | 2 +- components/ShareOptions/index.tsx | 2 +- components/ThemeManager/ThemeProvider.tsx | 2 +- components/utils/AddLeafletToHomepage.tsx | 2 +- 41 files changed, 180 insertions(+), 284 deletions(-) rename app/{ => (home-pages)}/discover/PubListing.tsx (73%) rename app/{ => (home-pages)}/discover/SortButtons.tsx (100%) rename app/{ => (home-pages)}/discover/SortedPublicationList.tsx (96%) rename app/{ => (home-pages)}/discover/page.tsx (78%) rename app/{ => (home-pages)}/home/Actions/AccountSettings.tsx (100%) rename app/{ => (home-pages)}/home/Actions/Actions.tsx (100%) rename app/{ => (home-pages)}/home/Actions/CreateNewButton.tsx (100%) rename app/{ => (home-pages)}/home/Actions/HomeHelp.tsx (100%) rename app/{ => (home-pages)}/home/HomeEmpty/DiscoverIllo.tsx (100%) rename app/{ => (home-pages)}/home/HomeEmpty/HomeEmpty.tsx (100%) rename app/{ => (home-pages)}/home/HomeEmpty/WelcomeToLeafletIllo.tsx (100%) rename app/{ => (home-pages)}/home/HomeLayout.tsx (99%) rename app/{ => (home-pages)}/home/IdentitySetter.tsx (100%) rename app/{ => (home-pages)}/home/LeafletList/LeafletContent.tsx (100%) rename app/{ => (home-pages)}/home/LeafletList/LeafletInfo.tsx (100%) rename app/{ => (home-pages)}/home/LeafletList/LeafletListItem.tsx (100%) rename app/{ => (home-pages)}/home/LeafletList/LeafletOptions.tsx (100%) rename app/{ => (home-pages)}/home/LeafletList/LeafletPreview.module.css (100%) rename app/{ => (home-pages)}/home/LeafletList/LeafletPreview.tsx (100%) rename app/{ => (home-pages)}/home/LoggedOutWarning.tsx (100%) rename app/{ => (home-pages)}/home/icon.tsx (99%) create mode 100644 app/(home-pages)/home/page.tsx rename app/{ => (home-pages)}/home/storage.ts (100%) create mode 100644 app/(home-pages)/layout.tsx create mode 100644 app/(home-pages)/notifications/page.tsx rename app/{ => (home-pages)}/reader/ReaderContent.tsx (99%) rename app/{ => (home-pages)}/reader/SubscriptionsContent.tsx (97%) rename app/{ => (home-pages)}/reader/getReaderFeed.ts (100%) rename app/{ => (home-pages)}/reader/getSubscriptions.ts (100%) rename app/{ => (home-pages)}/reader/idResolver.ts (100%) create mode 100644 app/(home-pages)/reader/page.tsx delete mode 100644 app/home/page.tsx delete mode 100644 app/reader/page.tsx diff --git a/actions/getIdentityData.ts b/actions/getIdentityData.ts index 17d62de2..c9c407b5 100644 --- a/actions/getIdentityData.ts +++ b/actions/getIdentityData.ts @@ -2,8 +2,9 @@ import { cookies } from "next/headers"; import { supabaseServerClient } from "supabase/serverClient"; - -export async function getIdentityData() { +import { cache } from "react"; +export const getIdentityData = cache(uncachedGetIdentityData); +export async function uncachedGetIdentityData() { let cookieStore = await cookies(); let auth_token = cookieStore.get("auth_token")?.value || @@ -18,7 +19,9 @@ export async function getIdentityData() { bsky_profiles(*), publication_subscriptions(*), custom_domains!custom_domains_identity_id_fkey(publication_domains(*), *), - home_leaflet:permission_tokens!identities_home_page_fkey(*, permission_token_rights(*)), + home_leaflet:permission_tokens!identities_home_page_fkey(*, permission_token_rights(*, + entity_sets(entities(facts(*))) + )), permission_token_on_homepage( created_at, permission_tokens!inner( diff --git a/app/discover/PubListing.tsx b/app/(home-pages)/discover/PubListing.tsx similarity index 73% rename from app/discover/PubListing.tsx rename to app/(home-pages)/discover/PubListing.tsx index 582dc331..e3bc5224 100644 --- a/app/discover/PubListing.tsx +++ b/app/(home-pages)/discover/PubListing.tsx @@ -1,6 +1,6 @@ "use client"; import { AtUri } from "@atproto/syntax"; -import { PublicationSubscription } from "app/reader/getSubscriptions"; +import { PublicationSubscription } from "app/(home-pages)/reader/getSubscriptions"; import { PubIcon } from "components/ActionBar/Publications"; import { Separator } from "components/Layout"; import { usePubTheme } from "components/ThemeManager/PublicationThemeProvider"; @@ -31,19 +31,30 @@ export const PubListing = ( + {backgroundImage && ( + + )}
diff --git a/app/discover/SortButtons.tsx b/app/(home-pages)/discover/SortButtons.tsx similarity index 100% rename from app/discover/SortButtons.tsx rename to app/(home-pages)/discover/SortButtons.tsx diff --git a/app/discover/SortedPublicationList.tsx b/app/(home-pages)/discover/SortedPublicationList.tsx similarity index 96% rename from app/discover/SortedPublicationList.tsx rename to app/(home-pages)/discover/SortedPublicationList.tsx index 9641f29f..dee6e495 100644 --- a/app/discover/SortedPublicationList.tsx +++ b/app/(home-pages)/discover/SortedPublicationList.tsx @@ -81,12 +81,7 @@ const SortButton = (props: {
diff --git a/app/discover/page.tsx b/app/(home-pages)/discover/page.tsx similarity index 78% rename from app/discover/page.tsx rename to app/(home-pages)/discover/page.tsx index f050732e..7e14bf2a 100644 --- a/app/discover/page.tsx +++ b/app/(home-pages)/discover/page.tsx @@ -4,9 +4,6 @@ import { SortedPublicationList } from "./SortedPublicationList"; import { Metadata } from "next"; import { DashboardLayout } from "components/PageLayouts/DashboardLayout"; -export const dynamic = "force-static"; -export const revalidate = 60; - export type PublicationsList = Awaited>; async function getPublications() { let { data: publications, error } = await supabaseServerClient @@ -34,24 +31,21 @@ export default async function Discover(props: { searchParams: Promise<{ [key: string]: string | string[] | undefined }>; }) { let order = ((await props.searchParams).order as string) || "recentlyUpdated"; - let publications = await getPublications(); return ( -
- , - }, - }} - /> -
+ , + }, + }} + /> ); } diff --git a/app/home/Actions/AccountSettings.tsx b/app/(home-pages)/home/Actions/AccountSettings.tsx similarity index 100% rename from app/home/Actions/AccountSettings.tsx rename to app/(home-pages)/home/Actions/AccountSettings.tsx diff --git a/app/home/Actions/Actions.tsx b/app/(home-pages)/home/Actions/Actions.tsx similarity index 100% rename from app/home/Actions/Actions.tsx rename to app/(home-pages)/home/Actions/Actions.tsx diff --git a/app/home/Actions/CreateNewButton.tsx b/app/(home-pages)/home/Actions/CreateNewButton.tsx similarity index 100% rename from app/home/Actions/CreateNewButton.tsx rename to app/(home-pages)/home/Actions/CreateNewButton.tsx diff --git a/app/home/Actions/HomeHelp.tsx b/app/(home-pages)/home/Actions/HomeHelp.tsx similarity index 100% rename from app/home/Actions/HomeHelp.tsx rename to app/(home-pages)/home/Actions/HomeHelp.tsx diff --git a/app/home/HomeEmpty/DiscoverIllo.tsx b/app/(home-pages)/home/HomeEmpty/DiscoverIllo.tsx similarity index 100% rename from app/home/HomeEmpty/DiscoverIllo.tsx rename to app/(home-pages)/home/HomeEmpty/DiscoverIllo.tsx diff --git a/app/home/HomeEmpty/HomeEmpty.tsx b/app/(home-pages)/home/HomeEmpty/HomeEmpty.tsx similarity index 100% rename from app/home/HomeEmpty/HomeEmpty.tsx rename to app/(home-pages)/home/HomeEmpty/HomeEmpty.tsx diff --git a/app/home/HomeEmpty/WelcomeToLeafletIllo.tsx b/app/(home-pages)/home/HomeEmpty/WelcomeToLeafletIllo.tsx similarity index 100% rename from app/home/HomeEmpty/WelcomeToLeafletIllo.tsx rename to app/(home-pages)/home/HomeEmpty/WelcomeToLeafletIllo.tsx diff --git a/app/home/HomeLayout.tsx b/app/(home-pages)/home/HomeLayout.tsx similarity index 99% rename from app/home/HomeLayout.tsx rename to app/(home-pages)/home/HomeLayout.tsx index 8cd426fa..f10b35e5 100644 --- a/app/home/HomeLayout.tsx +++ b/app/(home-pages)/home/HomeLayout.tsx @@ -63,7 +63,7 @@ type Leaflet = { }; export const HomeLayout = (props: { - entityID: string; + entityID: string | null; titles: { [root_entity: string]: string }; initialFacts: { [root_entity: string]: Fact[]; diff --git a/app/home/IdentitySetter.tsx b/app/(home-pages)/home/IdentitySetter.tsx similarity index 100% rename from app/home/IdentitySetter.tsx rename to app/(home-pages)/home/IdentitySetter.tsx diff --git a/app/home/LeafletList/LeafletContent.tsx b/app/(home-pages)/home/LeafletList/LeafletContent.tsx similarity index 100% rename from app/home/LeafletList/LeafletContent.tsx rename to app/(home-pages)/home/LeafletList/LeafletContent.tsx diff --git a/app/home/LeafletList/LeafletInfo.tsx b/app/(home-pages)/home/LeafletList/LeafletInfo.tsx similarity index 100% rename from app/home/LeafletList/LeafletInfo.tsx rename to app/(home-pages)/home/LeafletList/LeafletInfo.tsx diff --git a/app/home/LeafletList/LeafletListItem.tsx b/app/(home-pages)/home/LeafletList/LeafletListItem.tsx similarity index 100% rename from app/home/LeafletList/LeafletListItem.tsx rename to app/(home-pages)/home/LeafletList/LeafletListItem.tsx diff --git a/app/home/LeafletList/LeafletOptions.tsx b/app/(home-pages)/home/LeafletList/LeafletOptions.tsx similarity index 100% rename from app/home/LeafletList/LeafletOptions.tsx rename to app/(home-pages)/home/LeafletList/LeafletOptions.tsx diff --git a/app/home/LeafletList/LeafletPreview.module.css b/app/(home-pages)/home/LeafletList/LeafletPreview.module.css similarity index 100% rename from app/home/LeafletList/LeafletPreview.module.css rename to app/(home-pages)/home/LeafletList/LeafletPreview.module.css diff --git a/app/home/LeafletList/LeafletPreview.tsx b/app/(home-pages)/home/LeafletList/LeafletPreview.tsx similarity index 100% rename from app/home/LeafletList/LeafletPreview.tsx rename to app/(home-pages)/home/LeafletList/LeafletPreview.tsx diff --git a/app/home/LoggedOutWarning.tsx b/app/(home-pages)/home/LoggedOutWarning.tsx similarity index 100% rename from app/home/LoggedOutWarning.tsx rename to app/(home-pages)/home/LoggedOutWarning.tsx diff --git a/app/home/icon.tsx b/app/(home-pages)/home/icon.tsx similarity index 99% rename from app/home/icon.tsx rename to app/(home-pages)/home/icon.tsx index 1ad8e4d7..47fc61f5 100644 --- a/app/home/icon.tsx +++ b/app/(home-pages)/home/icon.tsx @@ -1,7 +1,7 @@ import { ImageResponse } from "next/og"; import type { Fact } from "src/replicache"; import type { Attribute } from "src/replicache/attributes"; -import { Database } from "../../supabase/database.types"; +import { Database } from "supabase/database.types"; import { createServerClient } from "@supabase/ssr"; import { parseHSBToRGB } from "src/utils/parseHSB"; import { cookies } from "next/headers"; diff --git a/app/(home-pages)/home/page.tsx b/app/(home-pages)/home/page.tsx new file mode 100644 index 00000000..32c8fd95 --- /dev/null +++ b/app/(home-pages)/home/page.tsx @@ -0,0 +1,43 @@ +import { getIdentityData } from "actions/getIdentityData"; +import { getFactsFromHomeLeaflets } from "app/api/rpc/[command]/getFactsFromHomeLeaflets"; +import { supabaseServerClient } from "supabase/serverClient"; + +import { HomeLayout } from "./HomeLayout"; + +export default async function Home() { + let auth_res = await getIdentityData(); + + let [allLeafletFacts] = await Promise.all([ + auth_res + ? getFactsFromHomeLeaflets.handler( + { + tokens: auth_res.permission_token_on_homepage.map( + (r) => r.permission_tokens.root_entity, + ), + }, + { supabase: supabaseServerClient }, + ) + : undefined, + ]); + + let home_docs_initialFacts = allLeafletFacts?.result || {}; + + return ( + { + let title = + tok.permission_tokens.leaflets_in_publications[0]?.title; + if (title) acc[tok.permission_tokens.root_entity] = title; + return acc; + }, + {} as { [k: string]: string }, + ), + }} + entityID={auth_res?.home_leaflet?.root_entity || null} + initialFacts={home_docs_initialFacts.facts || {}} + /> + ); +} diff --git a/app/home/storage.ts b/app/(home-pages)/home/storage.ts similarity index 100% rename from app/home/storage.ts rename to app/(home-pages)/home/storage.ts diff --git a/app/(home-pages)/layout.tsx b/app/(home-pages)/layout.tsx new file mode 100644 index 00000000..068caf12 --- /dev/null +++ b/app/(home-pages)/layout.tsx @@ -0,0 +1,38 @@ +import { getIdentityData } from "actions/getIdentityData"; +import { EntitySetProvider } from "components/EntitySetProvider"; +import { + ThemeProvider, + ThemeBackgroundProvider, +} from "components/ThemeManager/ThemeProvider"; +import { ReplicacheProvider, type Fact } from "src/replicache"; + +export default async function HomePagesLayout(props: { + children: React.ReactNode; +}) { + let identityData = await getIdentityData(); + if (!identityData?.home_leaflet) return <>{props.children}; + let facts = + (identityData?.home_leaflet?.permission_token_rights[0].entity_sets?.entities.flatMap( + (e) => e.facts, + ) || []) as Fact[]; + + let root_entity = identityData.home_leaflet.root_entity; + return ( + + + + + {props.children} + + + + + ); +} diff --git a/app/(home-pages)/notifications/page.tsx b/app/(home-pages)/notifications/page.tsx new file mode 100644 index 00000000..7e19c974 --- /dev/null +++ b/app/(home-pages)/notifications/page.tsx @@ -0,0 +1,3 @@ +export default async function Notifications() { + return
Notifications
; +} diff --git a/app/reader/ReaderContent.tsx b/app/(home-pages)/reader/ReaderContent.tsx similarity index 99% rename from app/reader/ReaderContent.tsx rename to app/(home-pages)/reader/ReaderContent.tsx index 669df6c6..11e49566 100644 --- a/app/reader/ReaderContent.tsx +++ b/app/(home-pages)/reader/ReaderContent.tsx @@ -23,7 +23,6 @@ import Link from "next/link"; import { useLocalizedDate } from "src/hooks/useLocalizedDate"; export const ReaderContent = (props: { - root_entity: string; posts: Post[]; nextCursor: Cursor | null; }) => { @@ -205,7 +204,7 @@ const PostInfo = (props: { year: "numeric", month: "short", day: "numeric", - } + }, ); return ( diff --git a/app/reader/SubscriptionsContent.tsx b/app/(home-pages)/reader/SubscriptionsContent.tsx similarity index 97% rename from app/reader/SubscriptionsContent.tsx rename to app/(home-pages)/reader/SubscriptionsContent.tsx index d2272a96..ca9cce13 100644 --- a/app/reader/SubscriptionsContent.tsx +++ b/app/(home-pages)/reader/SubscriptionsContent.tsx @@ -1,5 +1,5 @@ "use client"; -import { PubListing } from "app/discover/PubListing"; +import { PubListing } from "app/(home-pages)/discover/PubListing"; import { ButtonPrimary } from "components/Buttons"; import { DiscoverSmall } from "components/Icons/DiscoverSmall"; import { Json } from "supabase/database.types"; diff --git a/app/reader/getReaderFeed.ts b/app/(home-pages)/reader/getReaderFeed.ts similarity index 100% rename from app/reader/getReaderFeed.ts rename to app/(home-pages)/reader/getReaderFeed.ts diff --git a/app/reader/getSubscriptions.ts b/app/(home-pages)/reader/getSubscriptions.ts similarity index 100% rename from app/reader/getSubscriptions.ts rename to app/(home-pages)/reader/getSubscriptions.ts diff --git a/app/reader/idResolver.ts b/app/(home-pages)/reader/idResolver.ts similarity index 100% rename from app/reader/idResolver.ts rename to app/(home-pages)/reader/idResolver.ts diff --git a/app/(home-pages)/reader/page.tsx b/app/(home-pages)/reader/page.tsx new file mode 100644 index 00000000..f30e480a --- /dev/null +++ b/app/(home-pages)/reader/page.tsx @@ -0,0 +1,38 @@ +import { getIdentityData } from "actions/getIdentityData"; + +import { DashboardLayout } from "components/PageLayouts/DashboardLayout"; +import { ReaderContent } from "./ReaderContent"; +import { SubscriptionsContent } from "./SubscriptionsContent"; +import { getReaderFeed } from "./getReaderFeed"; +import { getSubscriptions } from "./getSubscriptions"; + +export default async function Reader(props: {}) { + let posts = await getReaderFeed(); + let publications = await getSubscriptions(); + return ( + + ), + }, + Subscriptions: { + controls: null, + content: ( + + ), + }, + }} + /> + ); +} diff --git a/app/home/page.tsx b/app/home/page.tsx deleted file mode 100644 index bcf27599..00000000 --- a/app/home/page.tsx +++ /dev/null @@ -1,124 +0,0 @@ -import { cookies } from "next/headers"; -import { Fact, ReplicacheProvider, useEntity } from "src/replicache"; -import type { Attribute } from "src/replicache/attributes"; -import { - ThemeBackgroundProvider, - ThemeProvider, -} from "components/ThemeManager/ThemeProvider"; -import { EntitySetProvider } from "components/EntitySetProvider"; -import { createIdentity } from "actions/createIdentity"; -import { drizzle } from "drizzle-orm/node-postgres"; -import { IdentitySetter } from "./IdentitySetter"; - -import { getIdentityData } from "actions/getIdentityData"; -import { getFactsFromHomeLeaflets } from "app/api/rpc/[command]/getFactsFromHomeLeaflets"; -import { supabaseServerClient } from "supabase/serverClient"; -import { pool } from "supabase/pool"; - -import { NotFoundLayout } from "components/PageLayouts/NotFoundLayout"; -import { HomeLayout } from "./HomeLayout"; - -export default async function Home() { - let cookieStore = await cookies(); - let auth_res = await getIdentityData(); - let identity: string | undefined; - if (auth_res) identity = auth_res.id; - else identity = cookieStore.get("identity")?.value; - let needstosetcookie = false; - if (!identity) { - const client = await pool.connect(); - const db = drizzle(client); - let newIdentity = await createIdentity(db); - client.release(); - identity = newIdentity.id; - needstosetcookie = true; - } - - async function setCookie() { - "use server"; - - (await cookies()).set("identity", identity as string, { - sameSite: "strict", - }); - } - - let permission_token = auth_res?.home_leaflet; - if (!permission_token) { - let res = await supabaseServerClient - .from("identities") - .select( - `*, - permission_tokens!identities_home_page_fkey(*, permission_token_rights(*)) - `, - ) - .eq("id", identity) - .single(); - permission_token = res.data?.permission_tokens; - } - - if (!permission_token) - return ( - -

Sorry, we can't find this home!

-

- This may be a glitch on our end. If the issue persists please{" "} - send us a note. -

- - ); - let [homeLeafletFacts, allLeafletFacts] = await Promise.all([ - supabaseServerClient.rpc("get_facts", { - root: permission_token.root_entity, - }), - auth_res - ? getFactsFromHomeLeaflets.handler( - { - tokens: auth_res.permission_token_on_homepage.map( - (r) => r.permission_tokens.root_entity, - ), - }, - { supabase: supabaseServerClient }, - ) - : undefined, - ]); - let initialFacts = - (homeLeafletFacts.data as unknown as Fact[]) || []; - - let root_entity = permission_token.root_entity; - let home_docs_initialFacts = allLeafletFacts?.result || {}; - - return ( - - - - - - { - let title = - tok.permission_tokens.leaflets_in_publications[0]?.title; - if (title) acc[tok.permission_tokens.root_entity] = title; - return acc; - }, - {} as { [k: string]: string }, - ), - }} - entityID={root_entity} - initialFacts={home_docs_initialFacts.facts || {}} - /> - - - - - ); -} diff --git a/app/lish/[did]/[publication]/dashboard/DraftList.tsx b/app/lish/[did]/[publication]/dashboard/DraftList.tsx index bab3d325..fadce76f 100644 --- a/app/lish/[did]/[publication]/dashboard/DraftList.tsx +++ b/app/lish/[did]/[publication]/dashboard/DraftList.tsx @@ -3,7 +3,7 @@ import { NewDraftSecondaryButton } from "./NewDraftButton"; import React from "react"; import { usePublicationData } from "./PublicationSWRProvider"; -import { LeafletList } from "app/home/HomeLayout"; +import { LeafletList } from "app/(home-pages)/home/HomeLayout"; export function DraftList(props: { searchValue: string; diff --git a/app/login/LoginForm.tsx b/app/login/LoginForm.tsx index fdaad325..a44a6061 100644 --- a/app/login/LoginForm.tsx +++ b/app/login/LoginForm.tsx @@ -5,7 +5,7 @@ import { } from "actions/emailAuth"; import { loginWithEmailToken } from "actions/login"; import { ActionAfterSignIn } from "app/api/oauth/[route]/afterSignInActions"; -import { getHomeDocs } from "app/home/storage"; +import { getHomeDocs } from "app/(home-pages)/home/storage"; import { ButtonPrimary } from "components/Buttons"; import { ArrowRightTiny } from "components/Icons/ArrowRightTiny"; import { BlueskySmall } from "components/Icons/BlueskySmall"; diff --git a/app/reader/page.tsx b/app/reader/page.tsx deleted file mode 100644 index fcc2f251..00000000 --- a/app/reader/page.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { cookies } from "next/headers"; -import { Fact, ReplicacheProvider } from "src/replicache"; -import type { Attribute } from "src/replicache/attributes"; -import { - ThemeBackgroundProvider, - ThemeProvider, -} from "components/ThemeManager/ThemeProvider"; -import { EntitySetProvider } from "components/EntitySetProvider"; -import { getIdentityData } from "actions/getIdentityData"; -import { supabaseServerClient } from "supabase/serverClient"; - -import { NotFoundLayout } from "components/PageLayouts/NotFoundLayout"; -import { DashboardLayout } from "components/PageLayouts/DashboardLayout"; -import { ReaderContent, ReaderEmpty } from "./ReaderContent"; -import { - SubscriptionsContent, - SubscriptionsEmpty, -} from "./SubscriptionsContent"; -import { getReaderFeed } from "./getReaderFeed"; -import { getSubscriptions } from "./getSubscriptions"; - -export default async function Reader(props: {}) { - let cookieStore = await cookies(); - let auth_res = await getIdentityData(); - let identity: string | undefined; - let permission_token = auth_res?.home_leaflet; - if (!permission_token) - return ( - , - }, - Subscriptions: { - controls: null, - content: , - }, - }} - /> - ); - let [homeLeafletFacts] = await Promise.all([ - supabaseServerClient.rpc("get_facts", { - root: permission_token.root_entity, - }), - ]); - let initialFacts = - (homeLeafletFacts.data as unknown as Fact[]) || []; - let root_entity = permission_token.root_entity; - - if (!auth_res?.atp_did) return; - let posts = await getReaderFeed(); - let publications = await getSubscriptions(); - return ( - - - - - - ), - }, - Subscriptions: { - controls: null, - content: ( - - ), - }, - }} - /> - - - - - ); -} diff --git a/components/ActionBar/Publications.tsx b/components/ActionBar/Publications.tsx index 3be27318..fee908b7 100644 --- a/components/ActionBar/Publications.tsx +++ b/components/ActionBar/Publications.tsx @@ -102,15 +102,15 @@ export const PubIcon = (props: { let iconSizeClassName = `${props.small ? "w-4 h-4" : props.large ? "w-12 h-12" : "w-6 h-6"} rounded-full`; return props.record.icon ? ( -
+
+ {`${props.record.name} +
) : (