Skip to content
Merged
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: 3 additions & 3 deletions packages/webapp/pages/posts/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const PostPage = ({
const [position, setPosition] =
useState<CSSProperties['position']>('relative');
const router = useRouter();
const { isFallback } = router;
const isFallback = false;
const { shouldShowAuthBanner } = useOnboardingActions();
const isLaptop = useViewSize(ViewSize.Laptop);
const { post, isError, isLoading } = usePostById({
Expand Down Expand Up @@ -213,7 +213,7 @@ export const PostPage = ({

usePostReferrer({ post });

if (isLoading || isFallback || privateSourceJoin.isActive) {
if (isLoading || privateSourceJoin.isActive) {
return (
<>
<PostSEOSchema post={post} topComments={topComments} />
Expand Down Expand Up @@ -280,7 +280,7 @@ PostPage.layoutProps = {
export default PostPage;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

export async function getStaticProps({
Expand Down
14 changes: 3 additions & 11 deletions packages/webapp/pages/sources/[source].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -159,14 +157,10 @@ const SourcePage = ({ source }: SourcePageProps): ReactElement => {
);
const { shouldUseListFeedLayout, FeedPageLayoutComponent } = useFeedLayout();

if (!isFallback && !source) {
if (!source) {
return <Custom404 />;
}

if (isFallback || !source) {
return <></>;
}

return (
<FeedPageLayoutComponent className="overflow-x-hidden">
<PageInfoHeader
Expand Down Expand Up @@ -255,7 +249,7 @@ SourcePage.layoutProps = {
export default SourcePage;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

interface SourcePageParams extends ParsedUrlQuery {
Expand Down Expand Up @@ -313,9 +307,7 @@ export async function getStaticProps({
)
) {
return {
props: {
source: null,
},
notFound: true,
revalidate: 60,
};
}
Expand Down
18 changes: 2 additions & 16 deletions packages/webapp/pages/tags/[tag].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -231,20 +231,6 @@ const TagPage = ({
return 'unfollowed';
}, [feedSettings, tag]);

if (isFallback) {
const fallbackTag = typeof query.tag === 'string' ? query.tag : tag;
return (
<FeedPageLayoutComponent>
<PageInfoHeader className="mx-4 !w-auto">
<div className="flex items-center font-bold">
<HashtagIcon size={IconSize.XXLarge} />
<h1 className="ml-2 w-fit typo-title2">{fallbackTag}</h1>
</div>
</PageInfoHeader>
</FeedPageLayoutComponent>
);
}

const followButtonProps: ButtonProps<'button'> = {
size: ButtonSize.Small,
icon: tagStatus === 'followed' ? <XIcon /> : <PlusIcon />,
Expand Down Expand Up @@ -475,7 +461,7 @@ TagPage.layoutProps = mainFeedLayoutProps;
export default TagPage;

export async function getStaticPaths(): Promise<GetStaticPathsResult> {
return { paths: [], fallback: true };
return { paths: [], fallback: 'blocking' };
}

interface TagPageParams extends ParsedUrlQuery {
Expand Down