refactor to app directory

This commit is contained in:
isaconantonis 2023-08-02 10:49:45 +02:00
parent 4b9364fdb3
commit 3c8a7543bf
17 changed files with 87 additions and 307 deletions

11
app/actions.ts Normal file
View file

@ -0,0 +1,11 @@
import client from "@/lib/mongodb";
export async function getTeamPlayers() {
const db = client.db("SloppyFuckers")
return await db.collection("players").find({}).toArray();
}
export async function getEvents() {
const db = client.db("SloppyFuckers")
return await db.collection("events").find({}).toArray();
}

42
app/layout.tsx Normal file
View file

@ -0,0 +1,42 @@
import { Metadata } from "next"
import Footer from "../components/Footer/Footer"
import Navbar from "../components/Navbar/Navbar"
import "../styles/tailwind.css"
export const metadata: Metadata = {
title: "IsaCon",
description: "IsaCon Consulting",
openGraph: {
type: "website",
url: "https://isacon.be",
title: "IsaCon",
description: "IsaCon Consulting",
siteName: "IsaCon",
images: [
{
url: "/Isacon logo RBG_1.png",
},
],
},
}
export default function RootLayout({
// Layouts must accept a children prop.
// This will be populated with nested layouts or pages
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>
<div className="flex min-h-screen flex-col justify-between">
<Navbar />
<main className="mb-auto min-h-screen bg-primary-50">{children}</main>
<Footer />
</div>
</body>
</html>
)
}

13
app/page.tsx Normal file
View file

@ -0,0 +1,13 @@
export default function Web() {
return (
<section>
<div className="mx-auto grid max-w-screen-xl px-4 py-8 text-center lg:py-16">
<div className="mx-auto place-self-center">
<h1 className="mb-4 max-w-2xl text-4xl font-extrabold leading-none tracking-tight md:text-5xl xl:text-6xl">
IsaCon
</h1>
</div>
</div>
</section>
)
}