diff --git a/packages/commonwealth/client/scripts/views/components/feed.tsx b/packages/commonwealth/client/scripts/views/components/feed.tsx index ec8b76e428b..776f5d17891 100644 --- a/packages/commonwealth/client/scripts/views/components/feed.tsx +++ b/packages/commonwealth/client/scripts/views/components/feed.tsx @@ -27,17 +27,9 @@ import { } from 'state/api/feeds/fetchUserActivity'; import useUserStore from 'state/ui/user'; import Permissions from 'utils/Permissions'; -import { DashboardViews } from 'views/pages/user_dashboard'; import { z } from 'zod'; import { ThreadCard } from '../pages/discussions/ThreadCard'; -type FeedProps = { - dashboardView: DashboardViews; - noFeedMessage: string; - defaultCount?: number; - customScrollParent?: HTMLElement; -}; - const DEFAULT_COUNT = 10; const FeedThread = ({ thread }: { thread: Thread }) => { @@ -189,16 +181,15 @@ function mapThread(thread: z.infer): Thread { }); } -// eslint-disable-next-line react/no-multi-comp -export const Feed = ({ - dashboardView, - noFeedMessage, - customScrollParent, -}: FeedProps) => { - const userFeed = useFetchUserActivityQuery(); - const globalFeed = useFetchGlobalActivityQuery(); +type FeedProps = { + query: typeof useFetchGlobalActivityQuery | typeof useFetchUserActivityQuery; + defaultCount?: number; + customScrollParent?: HTMLElement; +}; - const feed = dashboardView === DashboardViews.Global ? globalFeed : userFeed; +// eslint-disable-next-line react/no-multi-comp +export const Feed = ({ query, customScrollParent }: FeedProps) => { + const feed = query(); if (feed.isLoading) { return ( @@ -220,7 +211,9 @@ export const Feed = ({ if (feed.data.length === 0) { return (
-
{noFeedMessage}
+
+ Join some communities to see Activity! +
); } diff --git a/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx b/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx index 20c05b639e9..5ab534223e4 100644 --- a/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx +++ b/packages/commonwealth/client/scripts/views/pages/user_dashboard/index.tsx @@ -1,3 +1,7 @@ +import { + useFetchGlobalActivityQuery, + useFetchUserActivityQuery, +} from 'client/scripts/state/api/feeds/fetchUserActivity'; import { notifyInfo } from 'controllers/app/notifications'; import { useBrowserAnalyticsTrack } from 'hooks/useBrowserAnalyticsTrack'; import useBrowserWindow from 'hooks/useBrowserWindow'; @@ -123,11 +127,17 @@ const UserDashboard = ({ type }: UserDashboardProps) => { /> - + {activePage === DashboardViews.Global ? ( + + ) : ( + + )} {isWindowExtraSmall ? ( <>