From 9286fc81b100f5a2f83357ec874706f836c135b3 Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 29 Dec 2022 04:16:30 +0100 Subject: [PATCH] push latest changes --- .gitignore | 1 + components/Button.tsx | 22 + components/CharacterCard.tsx | 65 ++ components/Header.tsx | 29 + components/Logo.tsx | 36 ++ components/Nav.tsx | 31 + next.config.js | 3 + package.json | 7 +- pages/_app.tsx | 16 +- pages/_document.tsx | 36 +- pages/api/refs.ts | 13 + pages/characters/[characters].tsx | 22 + pages/characters/index.tsx | 39 ++ pages/index.tsx | 35 +- public/fonts/FukuCatch Detetiive.otf | Bin 0 -> 14052 bytes public/galleries/dark.svg | 3 + public/galleries/light.svg | 3 + public/gallery-logo-dark.svg | 4 + public/gallery-logo-light.svg | 4 + public/logos/dark.svg | 3 + public/logos/light.svg | 3 + styles/Home.module.css | 1 + utils/getRefs.ts | 21 + utils/noco.ts | 10 + utils/types.ts | 20 + yarn.lock | 906 ++++++++++++++++++++++++++- 26 files changed, 1283 insertions(+), 50 deletions(-) create mode 100644 components/Button.tsx create mode 100644 components/CharacterCard.tsx create mode 100644 components/Header.tsx create mode 100644 components/Logo.tsx create mode 100644 components/Nav.tsx create mode 100644 pages/api/refs.ts create mode 100644 pages/characters/[characters].tsx create mode 100644 pages/characters/index.tsx create mode 100644 public/fonts/FukuCatch Detetiive.otf create mode 100644 public/galleries/dark.svg create mode 100644 public/galleries/light.svg create mode 100644 public/gallery-logo-dark.svg create mode 100644 public/gallery-logo-light.svg create mode 100644 public/logos/dark.svg create mode 100644 public/logos/light.svg create mode 100644 utils/getRefs.ts create mode 100644 utils/noco.ts create mode 100644 utils/types.ts diff --git a/.gitignore b/.gitignore index c87c9b3..c5b834e 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts +.env diff --git a/components/Button.tsx b/components/Button.tsx new file mode 100644 index 0000000..069d17d --- /dev/null +++ b/components/Button.tsx @@ -0,0 +1,22 @@ +import { Inter } from '@next/font/google' +import styles from '../styles/Home.module.css' +const inter = Inter({ subsets: ['latin'] }) + + +const Button = ({ title, subtitle, link }: { title: string, subtitle: string, link: string }) => { + + return ( + <> + +

+ {title} -> +

+

+ {subtitle} +

+
+ + ) +} + +export default Button \ No newline at end of file diff --git a/components/CharacterCard.tsx b/components/CharacterCard.tsx new file mode 100644 index 0000000..4e395bd --- /dev/null +++ b/components/CharacterCard.tsx @@ -0,0 +1,65 @@ +import { Inter } from '@next/font/google' +import { Character } from '../utils/types' +const inter = Inter({ subsets: ['latin'] }) +import { Container, Card, Col, Text } from "@nextui-org/react"; + +export const CharacterCard = (props: Character) => ( + + + + + + + {props.species} + + + {props.name} + + + + + + + + +); + +// const CharacterCard = (props: Character) => { + +// return ( + + +// +// {''} + +//

+// {props.name} -> +//

+//

+// {props.species} +//

+//
+// ) +// } + +export default CharacterCard \ No newline at end of file diff --git a/components/Header.tsx b/components/Header.tsx new file mode 100644 index 0000000..ef3fd10 --- /dev/null +++ b/components/Header.tsx @@ -0,0 +1,29 @@ +import { Inter } from '@next/font/google' +import styles from '../styles/Home.module.css' +// const inter = Inter({ subsets: ['latin'] }) +import localFont from "@next/font/local" +import { ReactNode } from 'react' + +const Fuku = localFont({ src: "../public/fonts/FukuCatch Detetiive.otf" }) + + +const Header = ({ children, title }: { children: ReactNode | ReactNode[], title: string }) => { + + return ( + <> +
+
+ {/*
*/} +

{title}

+ {/*
*/} +
+ + {children} + +
+
+ + ) +} + +export default Header \ No newline at end of file diff --git a/components/Logo.tsx b/components/Logo.tsx new file mode 100644 index 0000000..62792d0 --- /dev/null +++ b/components/Logo.tsx @@ -0,0 +1,36 @@ +import Image from "next/image" +import LogoWhite from "../public/gallery-logo-dark.svg" +import LogoBlack from "../public/gallery-logo-light.svg" + +const width = 200 +const height = 100 +const viewBox = `0 0 ${width} ${height}` +const Light = () => ( + + + + + +) + +const Dark = () => ( + + + + + +) + +const Logo = ({ dark }: { dark?: boolean }) => { + const logo_size = 150; + return ( + {"Lio's + ) +} + + +export default Logo \ No newline at end of file diff --git a/components/Nav.tsx b/components/Nav.tsx new file mode 100644 index 0000000..7a7c7c1 --- /dev/null +++ b/components/Nav.tsx @@ -0,0 +1,31 @@ +import { Navbar, Text } from '@nextui-org/react' +import Logo from './Logo' +// import { useRouter } from 'next/router' + +export default function Nav() { + return ( + // <> + + + + + + + Characters + + + Gallery + + + Writing + + + + + Personal Site + + + + // + ) +} \ No newline at end of file diff --git a/next.config.js b/next.config.js index a843cbe..0312937 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,9 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, + images: { + domains: ['booru.lio.gallery', 'noco.lio.systems'], + }, } module.exports = nextConfig diff --git a/package.json b/package.json index 4f56917..b26d61a 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,18 @@ "lint": "next lint" }, "dependencies": { - "@next/font": "13.1.1", + "@next/font": "^13.1.1", + "@nextui-org/react": "^1.0.0-beta.11", "@types/node": "18.11.17", "@types/react": "18.0.26", "@types/react-dom": "18.0.10", + "axios": "^1.2.1", "next": "13.1.1", + "next-absolute-url": "^1.2.2", + "nocodb-sdk": "^0.100.2", "react": "18.2.0", "react-dom": "18.2.0", + "swr": "^2.0.0", "typescript": "4.9.4" } } diff --git a/pages/_app.tsx b/pages/_app.tsx index c055f25..a40c342 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,6 +1,14 @@ -import '../styles/globals.css' -import type { AppProps } from 'next/app' +// import '../styles/globals.css' +// 1. import `NextUIProvider` component +import { NextUIProvider } from '@nextui-org/react'; -export default function App({ Component, pageProps }: AppProps) { - return +function MyApp({ Component, pageProps }: any) { + return ( + // 2. Use at the root of your app + + + + ); } + +export default MyApp; \ No newline at end of file diff --git a/pages/_document.tsx b/pages/_document.tsx index 54e8bf3..3afbaed 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,13 +1,27 @@ -import { Html, Head, Main, NextScript } from 'next/document' +import React from 'react'; +import Document, { Html, Head, Main, NextScript } from 'next/document'; +import { CssBaseline } from '@nextui-org/react'; -export default function Document() { - return ( - - - -
- - - - ) +class MyDocument extends Document { + static async getInitialProps(ctx: any) { + const initialProps = await Document.getInitialProps(ctx); + return { + ...initialProps, + styles: React.Children.toArray([initialProps.styles]) + }; + } + + render() { + return ( + + {CssBaseline.flush()} + +
+ + + + ); + } } + +export default MyDocument; \ No newline at end of file diff --git a/pages/api/refs.ts b/pages/api/refs.ts new file mode 100644 index 0000000..cf37c86 --- /dev/null +++ b/pages/api/refs.ts @@ -0,0 +1,13 @@ +// Next.js API route support: https://nextjs.org/docs/api-routes/introduction +import type { NextApiRequest, NextApiResponse } from 'next' +import getRefs from '../../utils/getRefs' +import Noco from '../../utils/noco' +import { NocoCharacterResponse } from '../../utils/types' + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + // getRefs + let { list: OCList }: NocoCharacterResponse = await Noco.dbViewRow.list("noco", "gallery", "characters", "characters", { "where": "" }) + let refs = await getRefs(OCList) + + res.status(200).json(refs) +} diff --git a/pages/characters/[characters].tsx b/pages/characters/[characters].tsx new file mode 100644 index 0000000..c8f3ee0 --- /dev/null +++ b/pages/characters/[characters].tsx @@ -0,0 +1,22 @@ +import Noco from "../../utils/noco" + + +export default function Characters(props: any) { + // console.log(props.characters) + return ( + <> + Characters + + ) +} + + +export async function getStaticProps() { + const Characters = Noco.dbViewRow.list("noco", "gallery", "characters", "characters") + + return { + props: { + characters: Characters + }, revalidate: 60 * 2 + } +} \ No newline at end of file diff --git a/pages/characters/index.tsx b/pages/characters/index.tsx new file mode 100644 index 0000000..3c7bce0 --- /dev/null +++ b/pages/characters/index.tsx @@ -0,0 +1,39 @@ +import CharacterCard from '../../components/CharacterCard'; +import { CharacterList, NocoCharacterResponse } from '../../utils/types'; +import Header from '../../components/Header'; +import { Grid, Text } from "@nextui-org/react"; +import Nav from '../../components/Nav'; + +// @ts-ignore +const fetcher = (...args: string[]) => fetch(...args).then(res => res.json()) + +{/* + Characters + + + {props.characters.map(char => ( + + + + ))} + +*/} + +export default function Characters(props: { characters: CharacterList }) { + return ( + <> +