-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into upload-deploy-trace
- Loading branch information
Showing
39 changed files
with
532 additions
and
489 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
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,12 @@ | ||
/* Core */ | ||
import { NextResponse } from 'next/server' | ||
|
||
export async function POST(req: Request, res: Response) { | ||
const body = await req.json() | ||
const { amount = 1 } = body | ||
|
||
// simulate IO latency | ||
await new Promise((r) => setTimeout(r, 500)) | ||
|
||
return NextResponse.json({ data: amount }) | ||
} |
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
File renamed without changes.
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,31 @@ | ||
'use client' | ||
|
||
/* Core */ | ||
import Link from 'next/link' | ||
import { usePathname } from 'next/navigation' | ||
|
||
/* Instruments */ | ||
import styles from '../styles/layout.module.css' | ||
|
||
export const Nav = () => { | ||
const pathname = usePathname() | ||
|
||
return ( | ||
<nav className={styles.nav}> | ||
<Link | ||
className={`${styles.link} ${pathname === '/' ? styles.active : ''}`} | ||
href="/" | ||
> | ||
Home | ||
</Link> | ||
<Link | ||
className={`${styles.link} ${ | ||
pathname === '/verify' ? styles.active : '' | ||
}`} | ||
href="/verify" | ||
> | ||
Verify | ||
</Link> | ||
</nav> | ||
) | ||
} |
File renamed without changes.
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,66 @@ | ||
/* Components */ | ||
import { Providers } from '@/lib/providers' | ||
import { Nav } from './components/Nav' | ||
|
||
/* Instruments */ | ||
import styles from './styles/layout.module.css' | ||
import './styles/globals.css' | ||
|
||
export default function RootLayout(props: React.PropsWithChildren) { | ||
return ( | ||
<Providers> | ||
<html lang="en"> | ||
<body> | ||
<section className={styles.container}> | ||
<Nav /> | ||
|
||
<header className={styles.header}> | ||
<img src="/logo.svg" className={styles.logo} alt="logo" /> | ||
</header> | ||
|
||
<main className={styles.main}>{props.children}</main> | ||
|
||
<footer className={styles.footer}> | ||
<span>Learn </span> | ||
<a | ||
className={styles.link} | ||
href="https://reactjs.org/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
React | ||
</a> | ||
<span>, </span> | ||
<a | ||
className={styles.link} | ||
href="https://redux.js.org/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Redux | ||
</a> | ||
<span>, </span> | ||
<a | ||
className={styles.link} | ||
href="https://redux-toolkit.js.org/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Redux Toolkit | ||
</a> | ||
,<span> and </span> | ||
<a | ||
className={styles.link} | ||
href="https://react-redux.js.org/" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
React Redux | ||
</a> | ||
</footer> | ||
</section> | ||
</body> | ||
</html> | ||
</Providers> | ||
) | ||
} |
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,10 @@ | ||
/* Components */ | ||
import { Counter } from './components/Counter/Counter' | ||
|
||
export default function IndexPage() { | ||
return <Counter /> | ||
} | ||
|
||
export const metadata = { | ||
title: 'Redux Toolkit', | ||
} |
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,16 @@ | ||
html, | ||
body { | ||
min-height: 100vh; | ||
padding: 0; | ||
margin: 0; | ||
font-family: system-ui, sans-serif; | ||
} | ||
|
||
a { | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
|
||
* { | ||
box-sizing: border-box; | ||
} |
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,77 @@ | ||
.container { | ||
display: grid; | ||
grid-template-areas: | ||
'nav' | ||
'header' | ||
'main' | ||
'footer'; | ||
grid-template-rows: auto auto 1fr 36px; | ||
align-items: center; | ||
min-height: 100vh; | ||
} | ||
|
||
.logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
.header { | ||
grid-area: header; | ||
} | ||
|
||
.main { | ||
grid-area: main; | ||
} | ||
|
||
.header, | ||
.main { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.footer { | ||
grid-area: footer; | ||
justify-self: center; | ||
} | ||
|
||
.nav { | ||
grid-area: nav; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 8px; | ||
padding: 8px; | ||
font-size: calc(10px + 2vmin); | ||
} | ||
|
||
.link:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.link { | ||
color: #704cb6; | ||
} | ||
|
||
.link.active { | ||
text-decoration: underline; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.logo { | ||
animation: logo-float infinite 3s ease-in-out; | ||
} | ||
} | ||
|
||
@keyframes logo-float { | ||
0% { | ||
transform: translateY(0); | ||
} | ||
50% { | ||
transform: translateY(10px); | ||
} | ||
100% { | ||
transform: translateY(0px); | ||
} | ||
} |
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,11 @@ | ||
export default function VerifyPage() { | ||
return ( | ||
<> | ||
<h1>Verify page</h1> | ||
<p> | ||
This page is intended to verify that Redux state is persisted across | ||
page navigations. | ||
</p> | ||
</> | ||
) | ||
} |
Oops, something went wrong.