updated to nextjs 13 features and behaviour

main
Alex the Emperor Penguin 3 years ago
parent a20dcb13d9
commit ca6701c817

1
.gitignore vendored

@ -18,6 +18,7 @@
# misc # misc
.DS_Store .DS_Store
*.pem *.pem
just-stuff
# debug # debug
npm-debug.log* npm-debug.log*

@ -0,0 +1,6 @@
export default async function Page({ children }) {
return(
<h1>
</h1>
);
}

@ -0,0 +1,6 @@
export default async function Page({ children }) {
return(
<h1>
</h1>
);
}

@ -0,0 +1,6 @@
export default async function Page({ children }) {
return(
<h1>
</h1>
);
}

@ -0,0 +1,44 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
height: 100%;
}
a {
color: inherit;
text-decoration: none;
}
a:hover {
color: lightskyblue;
}
* {
box-sizing: border-box;
}
main {
display: flex;
flex-direction: row;
gap: 10rem;
height: 100%;
}
nav {
background-color: #2d2d2d;
display: flex;
flex-direction: column;
justify-content: space-evenly;
padding-left: 3rem;
padding-right: 3rem;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
body {
color: white;
background: black;
}
}

@ -0,0 +1,39 @@
/* eslint-disable @next/next/no-head-element */
import Link from "next/link";
import './globals.css';
export default function RootLayout({ children }) {
return (
<html>
<head></head>
<body>
<main>
<nav>
<Link href="/">
Home
</Link>
<Link href="courses">
Kueren
</Link>
<Link href ="user">
Mäi Konto
</Link>
<Link href="register">
Registréieren
</Link>
<Link href="forum">
Forum
</Link>
<Link href="contact">
Kontakt
</Link>
</nav>
<div>
{children}
</div>
</main>
</body>
</html>
);
}

@ -0,0 +1,39 @@
import PocketBase from "pocketbase";
async function getItems() {
const client = new PocketBase('https://backend.saachen.lu');
const adminAuthData = await client.admins.authViaEmail(process.env.USERNAME, process.env.PASSWORD);
//console.log(adminAuthData);
const resultList = await client.records.getList('forums', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
console.log(resultList);
return resultList;
}
export default async function Page({ children }) {
const resultList = await getItems();
return (
<div>
<h1>hi</h1>
<div>
{resultList.items.map((item, i) => (
<div key={i}>
// Show all things which you want
<br/>
{i}
<br/>
{item.title}
<br/>
{i}
<br/>
{item.description}
</div>
))
}
</div>
</div>
);
}
export default Page;

@ -0,0 +1,6 @@
export default async function Page({ children }) {
return(
<h1>
</h1>
);
}

@ -0,0 +1,6 @@
export default async function Page({ children }) {
return(
<h1>
</h1>
);
}

@ -0,0 +1,7 @@
import '../styles/globals.css'
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
export default MyApp

@ -0,0 +1,5 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default function handler(req, res) {
res.status(200).json({ name: 'John Doe' })
}

@ -1,13 +1,14 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
reactStrictMode: true, reactStrictMode: true,
webpack: (config) => { experimental:{appDir: true},
/*webpack: (config) => {
config.experiments = { config.experiments = {
topLevelAwait: true, topLevelAwait: true,
layers: true, layers: true,
} }
return config return config
}, },*/
} }
module.exports = nextConfig module.exports = nextConfig

@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev --turbo",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint" "lint": "next lint"

Loading…
Cancel
Save