-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip * fonts * page animations * mv * wip * middleware * mv * wip * fix link * slug server page * fix * ts * single * slug from params * e2e test updates w/o serversideprops * warnings * cleanup * e2e node version * wait * shared var * remove old config val
- Loading branch information
Showing
52 changed files
with
600 additions
and
546 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
node-version: 18.x | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
|
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> | ||
); | ||
} |
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.
d97b7a6
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.
Successfully deployed to the following URLs:
nextjs-sanity-fe – ./
nextjs-sanity-fe-formidable-labs.vercel.app
nextjs-sanity-fe-git-main-formidable-labs.vercel.app
nextjs-sanity-fe.vercel.app