diff --git a/packages/webapp/pages/posts/[id]/index.tsx b/packages/webapp/pages/posts/[id]/index.tsx index 3991916502..d85c8f238c 100644 --- a/packages/webapp/pages/posts/[id]/index.tsx +++ b/packages/webapp/pages/posts/[id]/index.tsx @@ -164,7 +164,7 @@ export const PostPage = ({ const [position, setPosition] = useState('relative'); const router = useRouter(); - const { isFallback } = router; + const isFallback = false; const { shouldShowAuthBanner } = useOnboardingActions(); const isLaptop = useViewSize(ViewSize.Laptop); const { post, isError, isLoading } = usePostById({ @@ -213,7 +213,7 @@ export const PostPage = ({ usePostReferrer({ post }); - if (isLoading || isFallback || privateSourceJoin.isActive) { + if (isLoading || privateSourceJoin.isActive) { return ( <> @@ -280,7 +280,7 @@ PostPage.layoutProps = { export default PostPage; export async function getStaticPaths(): Promise { - return { paths: [], fallback: true }; + return { paths: [], fallback: 'blocking' }; } export async function getStaticProps({ diff --git a/packages/webapp/pages/sources/[source].tsx b/packages/webapp/pages/sources/[source].tsx index 329fedb48a..97f10c1567 100644 --- a/packages/webapp/pages/sources/[source].tsx +++ b/packages/webapp/pages/sources/[source].tsx @@ -6,7 +6,6 @@ import type { import type { ParsedUrlQuery } from 'querystring'; import type { ReactElement } from 'react'; import React, { useContext, useMemo } from 'react'; -import { useRouter } from 'next/router'; import type { NextSeoProps } from 'next-seo/lib/types'; import Feed from '@dailydotdev/shared/src/components/Feed'; import { @@ -124,7 +123,6 @@ const SimilarSources = ({ sourceId }: SourceIdProps) => { }; const SourcePage = ({ source }: SourcePageProps): ReactElement => { - const { isFallback } = useRouter(); const isLaptop = useViewSize(ViewSize.Laptop); const { shouldShowAuthBanner } = useOnboardingActions(); const shouldShowTagSourceSocialProof = shouldShowAuthBanner && isLaptop; @@ -159,14 +157,10 @@ const SourcePage = ({ source }: SourcePageProps): ReactElement => { ); const { shouldUseListFeedLayout, FeedPageLayoutComponent } = useFeedLayout(); - if (!isFallback && !source) { + if (!source) { return ; } - if (isFallback || !source) { - return <>; - } - return ( { - return { paths: [], fallback: true }; + return { paths: [], fallback: 'blocking' }; } interface SourcePageParams extends ParsedUrlQuery { @@ -313,9 +307,7 @@ export async function getStaticProps({ ) ) { return { - props: { - source: null, - }, + notFound: true, revalidate: 60, }; } diff --git a/packages/webapp/pages/tags/[tag].tsx b/packages/webapp/pages/tags/[tag].tsx index 045736e4ab..a31121f155 100644 --- a/packages/webapp/pages/tags/[tag].tsx +++ b/packages/webapp/pages/tags/[tag].tsx @@ -167,7 +167,7 @@ const TagPage = ({ topPosts, recommendedTags, }: TagPageProps): ReactElement => { - const { isFallback, push, query } = useRouter(); + const { push } = useRouter(); const showRoadmap = useFeature(feature.showRoadmap); const { user, showLogin } = useContext(AuthContext); const mostUpvotedQueryVariables = useMemo( @@ -231,20 +231,6 @@ const TagPage = ({ return 'unfollowed'; }, [feedSettings, tag]); - if (isFallback) { - const fallbackTag = typeof query.tag === 'string' ? query.tag : tag; - return ( - - -
- -

{fallbackTag}

-
-
-
- ); - } - const followButtonProps: ButtonProps<'button'> = { size: ButtonSize.Small, icon: tagStatus === 'followed' ? : , @@ -475,7 +461,7 @@ TagPage.layoutProps = mainFeedLayoutProps; export default TagPage; export async function getStaticPaths(): Promise { - return { paths: [], fallback: true }; + return { paths: [], fallback: 'blocking' }; } interface TagPageParams extends ParsedUrlQuery {