Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix app router 404 #2155

Merged
merged 2 commits into from
Dec 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
MenuList,
Portal,
} from '@chakra-ui/react';
import { GoogleAnalytics } from './GoogleAnalytics';
import { GoogleAnalytics } from './google-analytics';
import { SmartLink } from '@components/ui/SmartLink';
import {
faArrowRight,
Expand Down
49 changes: 49 additions & 0 deletions frontend/app/(defaultLayout)/components/not-found-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use client';

import { Center, Divider, Heading, Text, VStack } from '@chakra-ui/react';
import { AppProviders } from '@components/common/AppProviders';
import type { DefaultLayoutProps } from '@layouts/default/server';
import IFixitPageFrame from './ifixit-page-frame';

export function NotFoundPage(props: DefaultLayoutProps) {
return (
<AppProviders>
<IFixitPageFrame {...props}>
<Center
flexGrow={1}
paddingTop="16px"
paddingBottom="60px"
paddingLeft="20px"
paddingRight="20px"
>
<VStack>
<Heading
as="h2"
fontSize={{ base: '4xl', md: '5xl' }}
fontWeight="medium"
>
404
</Heading>
<Text fontWeight="medium" pb="3" textTransform="uppercase">
Page not found
</Text>
<Divider
borderWidth="1px"
borderColor="red.500"
width="50px"
/>
<Text
pt="3"
overflowWrap="break-word"
align="center"
maxW="360px"
>
We can&apos;t find the page you&apos;re looking for.
Whoops.
</Text>
</VStack>
</Center>
</IFixitPageFrame>
</AppProviders>
);
}
2 changes: 1 addition & 1 deletion frontend/app/(defaultLayout)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AppProviders } from '@components/common/AppProviders';
import { DEFAULT_STORE_CODE } from '@config/env';
import { getLayoutServerSideProps } from '@layouts/default/server';
import { ReactNode } from 'react';
import IFixitPageFrame from './components/IFixitPageFrame';
import IFixitPageFrame from './components/ifixit-page-frame';

export default async function DefaultLayout({
children,
Expand Down
47 changes: 2 additions & 45 deletions frontend/app/(defaultLayout)/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
'use client';

import { Center, Divider, Heading, Text, VStack } from '@chakra-ui/react';
import { AppProviders } from '@components/common/AppProviders';
import { DEFAULT_STORE_CODE } from '@config/env';
import { getLayoutServerSideProps } from '@layouts/default/server';
import IFixitPageFrame from './components/IFixitPageFrame';
import { NotFoundPage } from './components/not-found-page';

export default async function NotFound() {
const layoutPropsPromise = getLayoutServerSideProps({
Expand All @@ -13,44 +9,5 @@ export default async function NotFound() {

const layoutProps = await layoutPropsPromise;

return (
<AppProviders>
<IFixitPageFrame {...layoutProps}>
<Center
flexGrow={1}
paddingTop="16px"
paddingBottom="60px"
paddingLeft="20px"
paddingRight="20px"
>
<VStack>
<Heading
as="h2"
fontSize={{ base: '4xl', md: '5xl' }}
fontWeight="medium"
>
404
</Heading>
<Text fontWeight="medium" pb="3" textTransform="uppercase">
Page not found
</Text>
<Divider
borderWidth="1px"
borderColor="red.500"
width="50px"
/>
<Text
pt="3"
overflowWrap="break-word"
align="center"
maxW="360px"
>
We can&apos;t find the page you&apos;re looking for.
Whoops.
</Text>
</VStack>
</Center>
</IFixitPageFrame>
</AppProviders>
);
return <NotFoundPage {...layoutProps} />;
}
2 changes: 1 addition & 1 deletion frontend/lib/shopify-storefront-sdk/generated/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ export type Checkout = Node & {
note?: Maybe<Scalars['String']>;
/** The resulting order from a paid checkout. */
order?: Maybe<Order>;
/** The Order Status Page for this Checkout, null when checkout isn't completed. */
/** The <b>Order status</b> page for this Checkout, null when checkout isn't completed. */
orderStatusUrl?: Maybe<Scalars['URL']>;
/** The amount left to be paid. This is equal to the cost of the line items, taxes, and shipping, minus discounts and gift cards. */
paymentDue: MoneyV2;
Expand Down