Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/shared/src/graphql/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ export const SOURCE_DIRECTORY_QUERY = gql`
topVideoSources {
...SourceDirectoryInfo
}
trendingUserSources {
...SourceDirectoryInfo
}
popularUserSources {
...SourceDirectoryInfo
}
}
${SOURCE_DIRECTORY_INFO_FRAGMENT}
`;
Expand Down
18 changes: 18 additions & 0 deletions packages/webapp/pages/sources/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ interface SourcesPageProps {
trendingSources: Source[];
popularSources: Source[];
topVideoSources: Source[];
trendingUserSources: Source[];
popularUserSources: Source[];
}

const SourcesPage = ({
mostRecentSources,
trendingSources,
popularSources,
topVideoSources,
trendingUserSources,
popularUserSources,
}: SourcesPageProps): ReactElement => {
const { isFallback: isLoading } = useRouter();
const { openModal } = useLazyModal();
Expand Down Expand Up @@ -89,6 +93,16 @@ const SourcesPage = ({
items={topVideoSources}
isLoading={isLoading}
/>
<SourceTopList
containerProps={{ title: 'Trending user sources' }}
items={trendingUserSources}
isLoading={isLoading}
/>
<SourceTopList
containerProps={{ title: 'Popular user sources' }}
items={popularUserSources}
isLoading={isLoading}
/>
</div>
</PageWrapperLayout>
);
Expand Down Expand Up @@ -118,6 +132,8 @@ export async function getStaticProps(): Promise<
trendingSources: res.trendingSources,
popularSources: res.popularSources,
topVideoSources: res.topVideoSources,
trendingUserSources: res.trendingUserSources,
popularUserSources: res.popularUserSources,
},
revalidate: 60,
};
Expand All @@ -134,6 +150,8 @@ export async function getStaticProps(): Promise<
trendingSources: [],
popularSources: [],
topVideoSources: [],
trendingUserSources: [],
popularUserSources: [],
},
revalidate: 60,
};
Expand Down