Skip to content

Commit

Permalink
imported my nextjs boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
felixlaii committed Mar 9, 2024
1 parent 9e37d7d commit 61c4c96
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 75 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY=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
Binary file removed src/app/favicon.ico
Binary file not shown.
33 changes: 0 additions & 33 deletions src/app/globals.css

This file was deleted.

22 changes: 0 additions & 22 deletions src/app/layout.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/app/page.tsx

This file was deleted.

19 changes: 19 additions & 0 deletions src/components/layout/ProjectLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { PropsWithChildren } from "react";
import { Content } from "./project-layout/Content";
import Footer from "./project-layout/Footer";
import { Header } from "./project-layout/Header";
import { Wrapper } from "./project-layout/Wrapper";

/**
* Responsive web UI layout for RheumInfo.
* Includes a header with responsive navigation menu and a footer.
*/
export const ProjectLayout: React.FC<PropsWithChildren> = ({ children }) => {
return (
<Wrapper>
<Header />
<Content>{children}</Content>
<Footer />
</Wrapper>
);
};
24 changes: 24 additions & 0 deletions src/components/layout/project-layout/Content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { PropsWithChildren } from "react";
import clsx from "clsx";

export interface ContentProps {
containerPaddingStyle?: string;
extraClassName?: string;
}

/**
* Content wrapper of ProjectLayout that sets responsive max widths, padding, etc. and renders its
* children inside of a `<main>..</main>` block.
*/
export const Content: React.FC<PropsWithChildren<ContentProps>> = ({
extraClassName,
children,
}) => {
return (
<main
className={clsx("flex-1 w-screen pb-12 xl:py-0 mx-0 z-0", extraClassName)}
>
{children}
</main>
);
};
5 changes: 5 additions & 0 deletions src/components/layout/project-layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Footer: React.FC = () => {
return <div className="w-screen"></div>;
};

export default Footer;
3 changes: 3 additions & 0 deletions src/components/layout/project-layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const Header: React.FC = () => {
return <div></div>;
};
8 changes: 8 additions & 0 deletions src/components/layout/project-layout/Wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { PropsWithChildren } from "react";

/**
* Wrapper component for children of ProjectLayout that resets z-index and defines the base flex column layout.
*/
export const Wrapper: React.FC<PropsWithChildren<{}>> = ({ children }) => {
return <div className="min-h-screen">{children}</div>;
};
17 changes: 17 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ProjectLayout } from "@/components/layout/ProjectLayout";
import "@/styles/globals.css";
import type { AppProps } from "next/app";
import Head from "next/head";

export default function App({ Component, pageProps }: AppProps) {
return (
<div>
<Head>
<title></title>
</Head>
<ProjectLayout>
<Component {...pageProps} />
</ProjectLayout>
</div>
);
}
13 changes: 13 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
13 changes: 13 additions & 0 deletions src/pages/api/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'

type Data = {
name: string
}

export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
}
8 changes: 8 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React, { useState } from "react";
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ["latin"] });

export default function Home() {
return <div></div>;
}
3 changes: 3 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

0 comments on commit 61c4c96

Please sign in to comment.