-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature/app router #213
Merged
Merged
Feature/app router #213
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5fc4e59
wip
nlkluth 87c6310
fonts
nlkluth 0652f76
page animations
nlkluth 8fc6368
mv
nlkluth 53c2f02
wip
nlkluth c7b943d
middleware
nlkluth d90c97e
mv
nlkluth 1c22a3f
wip
nlkluth 7762399
fix link
nlkluth 822bf3d
slug server page
nlkluth 87c5c30
fix
nlkluth 05b4c1d
ts
nlkluth 5473d33
single
nlkluth 3e03837
slug from params
nlkluth e615659
e2e test updates w/o serversideprops
nlkluth aeb9625
warnings
nlkluth 4ebc04b
cleanup
nlkluth b2e06d3
e2e node version
nlkluth 98f0adb
wait
nlkluth 6938414
shared var
nlkluth cb7c862
remove old config val
nlkluth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import AboutPage from "app/migration/about"; | ||
|
||
export default async function Page() { | ||
return <AboutPage />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import CategoriesPage from "app/migration/categories"; | ||
import { getAllCategories } from "utils/getAllCategoriesQuery"; | ||
import { isString, pluralize } from "utils/pluralize"; | ||
|
||
const getData = async () => { | ||
const categories = await getAllCategories(); | ||
const categoryNames = pluralize((categories || []).map((cat) => cat.name).filter(isString)); | ||
|
||
return { | ||
categories, | ||
categoryNames, | ||
}; | ||
}; | ||
|
||
export default async function Page() { | ||
const data = await getData(); | ||
|
||
return <CategoriesPage {...data} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,85 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
body { | ||
margin: 0; | ||
@apply bg-secondary; | ||
} | ||
|
||
/* Cabinet Grotesk */ | ||
/* See: https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@500,700,400,300&display=swap */ | ||
/* See: https://nextjs.org/docs/app/building-your-application/styling/css-modules#external-stylesheets */ | ||
@font-face { | ||
font-family: 'Cabinet Grotesk'; | ||
src: url('//cdn.fontshare.com/wf/7GWNQ5AHAZORLOWZ7ELKPLOIQITAR5S5/NYLYMGXMB4RANWVNJSIHG2IKPZ44CN5E/MT4CWVHB3N2C6KFUZ75QK4JQ2FYK4J4M.woff2') format('woff2'), | ||
url('//cdn.fontshare.com/wf/7GWNQ5AHAZORLOWZ7ELKPLOIQITAR5S5/NYLYMGXMB4RANWVNJSIHG2IKPZ44CN5E/MT4CWVHB3N2C6KFUZ75QK4JQ2FYK4J4M.woff') format('woff'), | ||
url('//cdn.fontshare.com/wf/7GWNQ5AHAZORLOWZ7ELKPLOIQITAR5S5/NYLYMGXMB4RANWVNJSIHG2IKPZ44CN5E/MT4CWVHB3N2C6KFUZ75QK4JQ2FYK4J4M.ttf') format('truetype'); | ||
font-weight: 300; | ||
font-display: swap; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Cabinet Grotesk'; | ||
src: url('//cdn.fontshare.com/wf/J6PPRPKWXDUIYA47IXLEQB4R4OPVYDQH/N2ZXAXWEHVMLISD2TIXJC7EF4GOY43L4/NXM4Z4TDCMYWBZ7AVI2N6DQ5VMWNENMU.woff2') format('woff2'), | ||
url('//cdn.fontshare.com/wf/J6PPRPKWXDUIYA47IXLEQB4R4OPVYDQH/N2ZXAXWEHVMLISD2TIXJC7EF4GOY43L4/NXM4Z4TDCMYWBZ7AVI2N6DQ5VMWNENMU.woff') format('woff'), | ||
url('//cdn.fontshare.com/wf/J6PPRPKWXDUIYA47IXLEQB4R4OPVYDQH/N2ZXAXWEHVMLISD2TIXJC7EF4GOY43L4/NXM4Z4TDCMYWBZ7AVI2N6DQ5VMWNENMU.ttf') format('truetype'); | ||
font-weight: 400; | ||
font-display: swap; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Cabinet Grotesk'; | ||
src: url('//cdn.fontshare.com/wf/CKQBK2QBTCDREE7L3MXZ3PPW7LDNJCWU/OTOY7FQFSFOJVZKJWKO2EHUJLOGBDN4Q/4CO2ETY7NITKLUDKMYJ75RHJSPHOJ7XT.woff2') format('woff2'), | ||
url('//cdn.fontshare.com/wf/CKQBK2QBTCDREE7L3MXZ3PPW7LDNJCWU/OTOY7FQFSFOJVZKJWKO2EHUJLOGBDN4Q/4CO2ETY7NITKLUDKMYJ75RHJSPHOJ7XT.woff') format('woff'), | ||
url('//cdn.fontshare.com/wf/CKQBK2QBTCDREE7L3MXZ3PPW7LDNJCWU/OTOY7FQFSFOJVZKJWKO2EHUJLOGBDN4Q/4CO2ETY7NITKLUDKMYJ75RHJSPHOJ7XT.ttf') format('truetype'); | ||
font-weight: 500; | ||
font-display: swap; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Cabinet Grotesk'; | ||
src: url('//cdn.fontshare.com/wf/XMXWOHABYLQDJ42L65EFRYNVRY37HQCB/B2O4O6V3JMFM2WDCYQI3A47L5U4THDUL/WN5274VQ3AUBDFP74GB4EC4XYJ3EKVNE.woff2') format('woff2'), | ||
url('//cdn.fontshare.com/wf/XMXWOHABYLQDJ42L65EFRYNVRY37HQCB/B2O4O6V3JMFM2WDCYQI3A47L5U4THDUL/WN5274VQ3AUBDFP74GB4EC4XYJ3EKVNE.woff') format('woff'), | ||
url('//cdn.fontshare.com/wf/XMXWOHABYLQDJ42L65EFRYNVRY37HQCB/B2O4O6V3JMFM2WDCYQI3A47L5U4THDUL/WN5274VQ3AUBDFP74GB4EC4XYJ3EKVNE.ttf') format('truetype'); | ||
font-weight: 700; | ||
font-display: swap; | ||
font-style: normal; | ||
} | ||
|
||
|
||
@font-face { | ||
font-family: "JeanLuc"; | ||
src: url('../assets/fonts/jeanluc/jeanlucweb-bold.woff'); | ||
font-weight: bold; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: "JeanLuc"; | ||
src: url('../assets/fonts/jeanluc/jeanlucweb-thin.woff'); | ||
font-weight: auto; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: "JetBrains Mono"; | ||
src: url('../assets/fonts/jetbrainsmono/JetBrainsMono-Bold.woff2'); | ||
font-weight: bold; | ||
font-style: normal; | ||
} | ||
|
||
@font-face { | ||
font-family: "JetBrains Mono"; | ||
src: url('../assets/fonts/jetbrainsmono/JetBrainsMono-Regular.woff2'); | ||
font-weight: auto; | ||
font-style: normal; | ||
} | ||
|
||
code { | ||
@apply rounded-md bg-black/5 px-1.5 py-0.5; | ||
font-family: 'JetBrains Mono', monospace; | ||
font-size: 0.9rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,39 @@ | ||
import { Footer, MobileNavProvider } from "./ui/shared-ui"; | ||
import "./global.css"; | ||
import { Header } from "components/Header/Header"; | ||
import { Metadata } from "next"; | ||
import { CartProvider } from "components/CartContext"; | ||
import { AnimatePresence, MotionConfig } from "./ui/framer"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Home", | ||
description: "Welcome to Next.js", | ||
}; | ||
|
||
export const viewport = { | ||
width: "device-width", | ||
}; | ||
|
||
export default function RootLayout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
<body> | ||
<MotionConfig reducedMotion="user"> | ||
<CartProvider> | ||
<div className="min-h-screen flex flex-col"> | ||
<MobileNavProvider> | ||
<Header /> | ||
</MobileNavProvider> | ||
<main className="flex-1"> | ||
<AnimatePresence initial={false} mode="wait"> | ||
{children} | ||
</AnimatePresence> | ||
</main> | ||
<Footer /> | ||
</div> | ||
</CartProvider> | ||
</MotionConfig> | ||
</body> | ||
</html> | ||
); | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from migration guide -- old pages are now client side components. Future work entails moving client components to leaf nodes of component tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// TODO: This file can be imported from shared-ui once the server/client split is resolved | ||
|
||
import { ParsedUrlQuery } from "querystring"; | ||
import { SORT_OPTIONS, SORT_QUERY_PARAM } from "./sorting"; | ||
|
||
export const getOrderingFromQuery = (query: ParsedUrlQuery) => { | ||
const { [SORT_QUERY_PARAM]: sortValue } = query; | ||
|
||
// Sort/ordering | ||
let ordering = SORT_OPTIONS.default.ordering; | ||
if (sortValue) { | ||
// If sort is string[], use first item | ||
// (e.g. User modified url, wouldn't happen normally) | ||
const sortType = Array.isArray(sortValue) ? sortValue[0] : sortValue; | ||
const sortOption = SORT_OPTIONS[sortType]; | ||
if (sortOption?.ordering) { | ||
ordering = sortOption.ordering; | ||
} | ||
} | ||
|
||
return ordering; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From migration guide -- create basic routes and put old pages as client components