From 6e49effb7fd8c122183d17881b66ea69044a51aa Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:38:48 -0800 Subject: [PATCH 01/21] `npm run format` --- package-lock.json | 183 +++++++++++++++++++++++++- src/app/about/page.tsx | 5 +- src/app/components/News.tsx | 13 +- src/app/help/accessibility/page.tsx | 4 +- src/app/legal/copyright/page.tsx | 4 +- src/app/legal/privacy/page.tsx | 4 +- src/app/page.tsx | 4 +- src/app/status/notifications/page.tsx | 11 +- src/app/status/page.tsx | 4 +- src/app/subscribe/page.tsx | 4 +- 10 files changed, 215 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2948213..290fbb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -521,6 +521,32 @@ "node": ">=6.9.0" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -971,6 +997,38 @@ "react": "^18.0.0" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -1001,13 +1059,13 @@ "version": "15.7.11", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==", - "dev": true + "devOptional": true }, "node_modules/@types/react": { "version": "18.2.55", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz", "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==", - "dev": true, + "devOptional": true, "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -1027,7 +1085,7 @@ "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==", - "dev": true + "devOptional": true }, "node_modules/@typescript-eslint/parser": { "version": "6.21.0", @@ -1182,6 +1240,17 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1729,6 +1798,14 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1759,7 +1836,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true + "devOptional": true }, "node_modules/damerau-levenshtein": { "version": "1.0.8", @@ -3568,6 +3645,14 @@ "node": "14 || >=16.14" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4344,6 +4429,13 @@ "node": ">=8.10.0" } }, + "node_modules/redux": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "dev": true, + "peer": true + }, "node_modules/reflect.getprototypeof": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.5.tgz", @@ -5022,6 +5114,70 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "dev": true }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -5236,6 +5392,14 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", @@ -5455,6 +5619,17 @@ "node": ">= 14" } }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 3c498c0..671491a 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -28,10 +28,7 @@ export default function Page() {
  • You can contribute to our website development or add your documents and user account to eeXiv on our{' '} - + GitHub repository . diff --git a/src/app/components/News.tsx b/src/app/components/News.tsx index 1902c2d..710a794 100644 --- a/src/app/components/News.tsx +++ b/src/app/components/News.tsx @@ -31,14 +31,21 @@ export default function News() { eeXiv is currently under active development! There may be major updates, breaking changes, or weird bugs. Report bugs, suggest new features, or give us feedback at{' '} - + our issue tracker.
  • Want to upload your documents or just make yourself a profile on - eeXiv? Check our about page for more - information! + eeXiv? Check our{' '} + + about page + {' '} + for more information!
  • diff --git a/src/app/help/accessibility/page.tsx b/src/app/help/accessibility/page.tsx index ab26783..83be830 100644 --- a/src/app/help/accessibility/page.tsx +++ b/src/app/help/accessibility/page.tsx @@ -1,7 +1,9 @@ export default function Page() { return (
    -

    Accessibility

    +

    + Accessibility +

    If you encounter any accessibility-related issues related to your use of our site, it is likely because of our jank code architecture. diff --git a/src/app/legal/copyright/page.tsx b/src/app/legal/copyright/page.tsx index 8c75ebd..88a94ca 100644 --- a/src/app/legal/copyright/page.tsx +++ b/src/app/legal/copyright/page.tsx @@ -2,7 +2,9 @@ import Link from 'next/link' export default function Page() { return (

    -

    Copyright

    +

    + Copyright +

    All content on this site is licensed under the{' '} diff --git a/src/app/legal/privacy/page.tsx b/src/app/legal/privacy/page.tsx index 2aa189f..4449421 100644 --- a/src/app/legal/privacy/page.tsx +++ b/src/app/legal/privacy/page.tsx @@ -1,7 +1,9 @@ export default function Page() { return (

    -

    Privacy Policy

    +

    + Privacy Policy +

    {`User privacy is important to us. Just kidding. We don't collect any personal information. We only use it to help us improve eeXiv. Your diff --git a/src/app/page.tsx b/src/app/page.tsx index 1132f39..7e41dbd 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -45,7 +45,9 @@ export default function Home() {


    -
    Recently released documents
    +
    + Recently released documents +


    diff --git a/src/app/status/notifications/page.tsx b/src/app/status/notifications/page.tsx index 537d862..4e5d04d 100644 --- a/src/app/status/notifications/page.tsx +++ b/src/app/status/notifications/page.tsx @@ -3,12 +3,15 @@ import Link from 'next/link' export default function Page() { return (
    -

    Get status notifications

    +

    + Get status notifications +

    We currently do not have the technical support to implement mailing - lists in eeXiv. Check status frequently for updates. - The best way to stay connected with the status of the eeXiv project is - to watch it on GitHub. + lists in eeXiv. Check status frequently for + updates. The best way to stay connected with the status of the eeXiv + project is to watch it on{' '} + GitHub.

    ) diff --git a/src/app/status/page.tsx b/src/app/status/page.tsx index b0b96df..4ff8f8a 100644 --- a/src/app/status/page.tsx +++ b/src/app/status/page.tsx @@ -6,7 +6,9 @@ export default function Page() { return (

    Status

    -

    +

    eeXiv is online. All systems{' '} operational.

    diff --git a/src/app/subscribe/page.tsx b/src/app/subscribe/page.tsx index c8d62d1..14c036c 100644 --- a/src/app/subscribe/page.tsx +++ b/src/app/subscribe/page.tsx @@ -1,7 +1,9 @@ export default function Page() { return (
    -

    Subscribe

    +

    + Subscribe +

    We currently do not have the technical support to implement mailing lists in eeXiv. Check back later for updates. The best way to stay From 9445a624ad7811f1969c7433e2d7eb636a6f00d6 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:38:54 -0800 Subject: [PATCH 02/21] Add document version chooser --- .../document/view/[slug]/DocumentViewer.tsx | 33 +++------- .../document/view/[slug]/VersionChooser.tsx | 62 +++++++++++++++++++ src/app/globals.css | 5 ++ 3 files changed, 77 insertions(+), 23 deletions(-) create mode 100644 src/app/document/view/[slug]/VersionChooser.tsx diff --git a/src/app/document/view/[slug]/DocumentViewer.tsx b/src/app/document/view/[slug]/DocumentViewer.tsx index 4ecb327..e79fea9 100644 --- a/src/app/document/view/[slug]/DocumentViewer.tsx +++ b/src/app/document/view/[slug]/DocumentViewer.tsx @@ -1,4 +1,4 @@ -import { DocumentType, documents } from '@/app/db/data' +import { documents } from '@/app/db/data' import { Zilla_Slab } from 'next/font/google' import { epoch2datestring } from '@/app/utils/epoch2datestring' import { @@ -11,11 +11,14 @@ import { import { ItemBadge, Status } from '@/app/components/Badges' import Link from 'next/link' import { notFound } from 'next/navigation' +import VersionChooser from './VersionChooser' const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] }) -export default function DocumentViewer({ slug }: Readonly<{ slug: string }>) { - const { manifest, abstract, file, citation } = documents[slug] +const DocumentViewer = ({ slug }: Readonly<{ slug: string }>) => { + const doc = documents[slug] + const { manifest, abstract, file, citation } = doc + if (!manifest) return notFound() const { title, @@ -51,7 +54,7 @@ export default function DocumentViewer({ slug }: Readonly<{ slug: string }>) {

    - + Revision {latest} @@ -78,25 +81,9 @@ export default function DocumentViewer({ slug }: Readonly<{ slug: string }>) { Cite as: {citation ? <>{citation} : <>eeXiv:{slug}}

    - - - +
    ) } + +export default DocumentViewer diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx new file mode 100644 index 0000000..918e1ee --- /dev/null +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -0,0 +1,62 @@ +'use client' +import { useState } from 'react' +import { Document } from '@/app/db/data' +import Link from 'next/link' + +const VersionChooser = ({ + doc, + slug, +}: Readonly<{ doc: Document; slug: string }>) => { + const { file } = doc + const { + title, + authors, + topics, + dates, + references, + code, + type, + latest, + reviewers, + status, + } = doc.manifest + + const fileEnding = file === 'other' ? '' : `.${file}` + const [selectedRevision, setSelectedRevision] = useState(latest) // Initialize the selected revision with the latest revision + + return ( +
    + + + + +
    + ) +} + +export default VersionChooser diff --git a/src/app/globals.css b/src/app/globals.css index 678f2a8..3e7e485 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -20,6 +20,11 @@ a:hover { text-decoration: underline; } +option { + @apply font-sans; + @apply p-4; +} + .button-default { @apply bg-blue-600 text-slate-100 hover:bg-blue-400 font-semibold rounded py-2 px-4 my-2 shadow-sm shadow-slate-400; } From 5a34452f790af2d03c5041172288d5d008736943 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:41:04 -0800 Subject: [PATCH 03/21] Create style.yml --- .github/workflows/style.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000..99a11c7 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,23 @@ +name: npm run format + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + + steps: + - uses: actions/checkout@v4 + - uses: stefanzweifel/git-auto-commit-action@v5 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: npm install + - run: npm run format From fa09181e94e3a96c8972500ce7c2a2a58fbd0539 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:41:59 -0800 Subject: [PATCH 04/21] Update style.yml --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 99a11c7..7aa6930 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -3,7 +3,7 @@ name: npm run format on: [push] jobs: - build: + style: runs-on: ubuntu-latest From 9fe487eb3c7d2d263417bb5452de1bdd6ed785ec Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:42:28 -0800 Subject: [PATCH 05/21] Add style commit message --- .github/workflows/style.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 7aa6930..f055c56 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "style: format" - name: Use Node.js uses: actions/setup-node@v3 with: From 4bbd31bcd316f050e00e711736e60f79f7d2dc89 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:43:47 -0800 Subject: [PATCH 06/21] Clean up document page additions --- src/app/document/page.tsx | 8 -------- src/app/document/view/[slug]/DocumentViewer.tsx | 3 +-- src/app/document/view/[slug]/VersionChooser.tsx | 9 --------- 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 src/app/document/page.tsx diff --git a/src/app/document/page.tsx b/src/app/document/page.tsx deleted file mode 100644 index 0b7b6ad..0000000 --- a/src/app/document/page.tsx +++ /dev/null @@ -1,8 +0,0 @@ -export default function Page() { - return ( -

    - This is a placeholder for a document browser that will be implemented in - the future. In the meantime, you can view specific documents by searching. -

    - ) -} diff --git a/src/app/document/view/[slug]/DocumentViewer.tsx b/src/app/document/view/[slug]/DocumentViewer.tsx index e79fea9..0532e37 100644 --- a/src/app/document/view/[slug]/DocumentViewer.tsx +++ b/src/app/document/view/[slug]/DocumentViewer.tsx @@ -9,7 +9,6 @@ import { Reviewers, } from '@/app/components/DataDisplay' import { ItemBadge, Status } from '@/app/components/Badges' -import Link from 'next/link' import { notFound } from 'next/navigation' import VersionChooser from './VersionChooser' @@ -17,7 +16,7 @@ const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] }) const DocumentViewer = ({ slug }: Readonly<{ slug: string }>) => { const doc = documents[slug] - const { manifest, abstract, file, citation } = doc + const { manifest, abstract, citation } = doc if (!manifest) return notFound() const { diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index 918e1ee..55f3027 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -9,16 +9,7 @@ const VersionChooser = ({ }: Readonly<{ doc: Document; slug: string }>) => { const { file } = doc const { - title, - authors, - topics, - dates, - references, - code, - type, latest, - reviewers, - status, } = doc.manifest const fileEnding = file === 'other' ? '' : `.${file}` From 81b3e029264816260da9e126f03fefdb0b0cfeb8 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:45:38 -0800 Subject: [PATCH 07/21] Fix autocommit in style workflow --- .github/workflows/style.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index f055c56..934596c 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,6 +1,6 @@ name: npm run format -on: [push] +on: [push, manual_dispatch] jobs: style: @@ -14,12 +14,14 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: "style: format" + - name: Use Node.js uses: actions/setup-node@v3 with: node-version: '20.x' - run: npm install - run: npm run format + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "style: format" From 6039e8fbdc3cd119dbbdddad2d8dbde13bfe3e4e Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:46:28 -0800 Subject: [PATCH 08/21] Fix manual dispatch name in workflow --- .github/workflows/style.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 934596c..777a915 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,6 +1,6 @@ name: npm run format -on: [push, manual_dispatch] +on: [push, workflow_dispatch] jobs: style: From 4a5649a83297aa5e2ff58fda9169339b74c921e0 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:48:05 -0800 Subject: [PATCH 09/21] Give style workflow permission to update workflows --- .github/workflows/style.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 777a915..475b4b1 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -11,6 +11,7 @@ jobs: # Give the default GITHUB_TOKEN write permission to commit and push the # added or changed files to the repository. contents: write + workflows: write steps: - uses: actions/checkout@v4 From 63d34e475a273489369a1f67132ade495fa9c5db Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:48:50 -0800 Subject: [PATCH 10/21] YAML issue? --- .github/workflows/style.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 475b4b1..7c19a86 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -10,8 +10,8 @@ jobs: permissions: # Give the default GITHUB_TOKEN write permission to commit and push the # added or changed files to the repository. - contents: write - workflows: write + - contents: write + - workflows: write steps: - uses: actions/checkout@v4 From 929908d6e32de7e6593ea92108512e8ff4578c51 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:49:59 -0800 Subject: [PATCH 11/21] I give up --- .github/workflows/style.yml | 3 +-- .prettierrc | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 7c19a86..777a915 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -10,8 +10,7 @@ jobs: permissions: # Give the default GITHUB_TOKEN write permission to commit and push the # added or changed files to the repository. - - contents: write - - workflows: write + contents: write steps: - uses: actions/checkout@v4 diff --git a/.prettierrc b/.prettierrc index c5b38cc..6dae609 100644 --- a/.prettierrc +++ b/.prettierrc @@ -8,5 +8,6 @@ "jsxSingleQuote": true, "bracketSpacing": true, "jsxBracketSameLine": false, - "arrowParens": "always" + "arrowParens": "always", + "disableLanguages": ["yaml"] } From a388035ce7fc0b8fb518557dfdc87d1d6e510295 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:52:16 -0800 Subject: [PATCH 12/21] Don't trust Codeium But I trusted Codeium again --- .prettierignore | 1 + .prettierrc | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1cda54b --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.yml diff --git a/.prettierrc b/.prettierrc index 6dae609..c5b38cc 100644 --- a/.prettierrc +++ b/.prettierrc @@ -8,6 +8,5 @@ "jsxSingleQuote": true, "bracketSpacing": true, "jsxBracketSameLine": false, - "arrowParens": "always", - "disableLanguages": ["yaml"] + "arrowParens": "always" } From aef3211beebd2b58f100641aab64a92b380a986a Mon Sep 17 00:00:00 2001 From: Team1280Programming Date: Thu, 15 Feb 2024 00:52:47 +0000 Subject: [PATCH 13/21] style: format --- src/app/document/view/[slug]/VersionChooser.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index 55f3027..ef2b62e 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -8,9 +8,7 @@ const VersionChooser = ({ slug, }: Readonly<{ doc: Document; slug: string }>) => { const { file } = doc - const { - latest, - } = doc.manifest + const { latest } = doc.manifest const fileEnding = file === 'other' ? '' : `.${file}` const [selectedRevision, setSelectedRevision] = useState(latest) // Initialize the selected revision with the latest revision @@ -36,7 +34,9 @@ const VersionChooser = ({ { setSelectedRevision(parseInt(e.target.value.replace(/\D/g, ''), 10)) diff --git a/src/app/utils/epoch2datestring.ts b/src/app/utils/epoch2datestring.ts index f595cff..e93b144 100644 --- a/src/app/utils/epoch2datestring.ts +++ b/src/app/utils/epoch2datestring.ts @@ -11,3 +11,7 @@ export function epoch2datestring(epoch: number): string { return formattedDate } + +export function epoch2date(epoch: number): Date { + return new Date(epoch * 1000) +} From c3473f135aec6d39a5aee50842ac99daa63f449f Mon Sep 17 00:00:00 2001 From: Team1280Programming Date: Thu, 15 Feb 2024 02:11:36 +0000 Subject: [PATCH 17/21] style: format --- src/app/db/data.ts | 2 +- src/app/document/view/[slug]/VersionChooser.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/db/data.ts b/src/app/db/data.ts index 6e4d5db..a7270dd 100644 --- a/src/app/db/data.ts +++ b/src/app/db/data.ts @@ -20,7 +20,7 @@ export type DocumentStatus = | 'under review' | 'reviewed' | 'published no review' - + export interface Document { manifest: DocumentManifest abstract: string diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index 9172621..e9c7757 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -50,14 +50,14 @@ const VersionChooser = ({ className='ml-2 h-10 px-2.5 bg-slate-300 rounded-md' onClick={() => { const bibtex = `@article{ - author={${ - authors.map((a: string, i) => { + author={${authors + .map((a: string, i) => { const author = authorList[a].name.first + ' ' + authorList[a].name.last if (i === 0) return author else if (i === authors.length - 1) return ` and ${author}` else return `, ${author}` - }).join('') - }}, + }) + .join('')}}, title={${doc.manifest.title}}, journal={eeXiv journal}, year={${date.getFullYear()}}, From 7e5649c648a74cb5472d514112b28dbf1224d3f3 Mon Sep 17 00:00:00 2001 From: Team 1280 Programming Laptop <59985235+Team1280Programming@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:42:48 -0800 Subject: [PATCH 18/21] in the middle of fixing --- src/app/db/loaders.ts | 2 +- src/app/db/workers/authorLoader.worker.ts | 19 +++++++++++++++---- .../document/view/[slug]/VersionChooser.tsx | 10 ++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/app/db/loaders.ts b/src/app/db/loaders.ts index 7f5ecea..563e4ea 100644 --- a/src/app/db/loaders.ts +++ b/src/app/db/loaders.ts @@ -88,7 +88,7 @@ export const loadAllAuthors = (): Promise<{ [key: string]: Author }> => { }) } -export const loadAuthor = (id: string): Promise => { +export const loadAuthors = (authorIds: string[]): Promise => { return new Promise((resolve, reject) => { if (typeof Worker !== 'undefined') { const worker = new Worker( diff --git a/src/app/db/workers/authorLoader.worker.ts b/src/app/db/workers/authorLoader.worker.ts index 4ec63fe..99fd243 100644 --- a/src/app/db/workers/authorLoader.worker.ts +++ b/src/app/db/workers/authorLoader.worker.ts @@ -1,7 +1,18 @@ -import { authors } from '../data' +import { authors, Author } from '../data' + +const checkIsStringArray = (data: unknown): data is string[] => { + if (Array.isArray(data)) { + return data.every((d) => typeof d === 'string') + } + return false +} onmessage = (e) => { - if (e.data === 'LOAD') { - self.postMessage(authors) - } + let authorIds: string[] = [] + let authors = [] + checkIsStringArray(e.data) && (authorIds = e.data as string[]) + + authorIds.forEach(id => { + + }) } diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index e9c7757..70f532e 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -1,5 +1,5 @@ 'use client' -import { useState } from 'react' +import { useState, useEffect } from 'react' import { Document } from '@/app/db/data' import Link from 'next/link' import { loadAllAuthors } from '@/app/db/loaders' @@ -18,8 +18,10 @@ const VersionChooser = ({ }, }) if (error) throw error - - let authorList = data + + useEffect(() => { + console.log(data) + }, [data]) const { file } = doc const { authors, latest } = doc.manifest @@ -52,7 +54,7 @@ const VersionChooser = ({ const bibtex = `@article{ author={${authors .map((a: string, i) => { - const author = authorList[a].name.first + ' ' + authorList[a].name.last + const author = data[a].name.first + ' ' + data[a].name.last if (i === 0) return author else if (i === authors.length - 1) return ` and ${author}` else return `, ${author}` From 7375ab3d0aa1ab2e99c9a5507de2bef9a4e6e14c Mon Sep 17 00:00:00 2001 From: Team1280Programming Date: Thu, 15 Feb 2024 02:43:29 +0000 Subject: [PATCH 19/21] style: format --- src/app/db/workers/authorLoader.worker.ts | 4 +--- src/app/document/view/[slug]/VersionChooser.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/db/workers/authorLoader.worker.ts b/src/app/db/workers/authorLoader.worker.ts index 99fd243..7753a68 100644 --- a/src/app/db/workers/authorLoader.worker.ts +++ b/src/app/db/workers/authorLoader.worker.ts @@ -12,7 +12,5 @@ onmessage = (e) => { let authors = [] checkIsStringArray(e.data) && (authorIds = e.data as string[]) - authorIds.forEach(id => { - - }) + authorIds.forEach((id) => {}) } diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index 70f532e..f2d92fe 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -18,7 +18,7 @@ const VersionChooser = ({ }, }) if (error) throw error - + useEffect(() => { console.log(data) }, [data]) From d894dfb2e0242a3f3c0c7a2c384197c937e0064c Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 14 Feb 2024 19:22:48 -0800 Subject: [PATCH 20/21] fix EVERYTHING --- src/app/db/loaders.ts | 14 ++++----- src/app/db/workers/authorLoader.worker.ts | 20 +++++++++--- .../document/view/[slug]/DocumentViewer.tsx | 14 ++++++++- .../document/view/[slug]/VersionChooser.tsx | 6 ++-- .../document/view/[slug]/loading.module.css | 31 +++++++++++++++++++ 5 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 src/app/document/view/[slug]/loading.module.css diff --git a/src/app/db/loaders.ts b/src/app/db/loaders.ts index 563e4ea..759c783 100644 --- a/src/app/db/loaders.ts +++ b/src/app/db/loaders.ts @@ -88,7 +88,9 @@ export const loadAllAuthors = (): Promise<{ [key: string]: Author }> => { }) } -export const loadAuthors = (authorIds: string[]): Promise => { +export const loadAuthors = ( + authorIds: string[] +): Promise<{ [key: string]: Author }> => { return new Promise((resolve, reject) => { if (typeof Worker !== 'undefined') { const worker = new Worker( @@ -97,12 +99,10 @@ export const loadAuthors = (authorIds: string[]): Promise => { ) worker.onmessage = (e: MessageEvent<{ [key: string]: Author }>) => { - const data = e.data - const author: Author | undefined = data[id] - if (!author) { - return reject(new Error('404')) + if (typeof e.data === 'object' && Object.keys(e.data).length > 0) { + resolve(e.data) } else { - resolve(author) + reject(new Error('404')) } worker.terminate() } @@ -112,7 +112,7 @@ export const loadAuthors = (authorIds: string[]): Promise => { worker.terminate() } - worker.postMessage('LOAD') + worker.postMessage(authorIds) } else { reject( new Error( diff --git a/src/app/db/workers/authorLoader.worker.ts b/src/app/db/workers/authorLoader.worker.ts index 99fd243..0509ee4 100644 --- a/src/app/db/workers/authorLoader.worker.ts +++ b/src/app/db/workers/authorLoader.worker.ts @@ -1,5 +1,19 @@ import { authors, Author } from '../data' +export function getAuthorsById(authorIds: string[]): { [key: string]: Author } { + const result: { [key: string]: Author } = {} + + // Iterate through the array of author IDs + for (const id of authorIds) { + const author = authors[id] // Retrieve the author entry by ID + if (author) { + result[id] = author // If the author exists, add it to the result object + } + } + + return result +} + const checkIsStringArray = (data: unknown): data is string[] => { if (Array.isArray(data)) { return data.every((d) => typeof d === 'string') @@ -9,10 +23,8 @@ const checkIsStringArray = (data: unknown): data is string[] => { onmessage = (e) => { let authorIds: string[] = [] - let authors = [] checkIsStringArray(e.data) && (authorIds = e.data as string[]) + let results = getAuthorsById(authorIds) - authorIds.forEach(id => { - - }) + postMessage(results) } diff --git a/src/app/document/view/[slug]/DocumentViewer.tsx b/src/app/document/view/[slug]/DocumentViewer.tsx index 6066257..e2a1eae 100644 --- a/src/app/document/view/[slug]/DocumentViewer.tsx +++ b/src/app/document/view/[slug]/DocumentViewer.tsx @@ -12,6 +12,8 @@ import { ItemBadge, Status } from '@/app/components/Badges' import { notFound } from 'next/navigation' import VersionChooser from './VersionChooser' import crypto from 'crypto' +import loadingStyles from './loading.module.css' +import { Suspense } from 'react' const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] }) @@ -88,7 +90,17 @@ const DocumentViewer = ({ slug }: Readonly<{ slug: string }>) => { Cite as: {citation ? <>{citation} : <>eeXiv:{hash}}

    - + +
    +
    +
    +
    + } + > + +
    ) } diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index 70f532e..e40e7cc 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react' import { Document } from '@/app/db/data' import Link from 'next/link' -import { loadAllAuthors } from '@/app/db/loaders' +import { loadAuthors } from '@/app/db/loaders' import { useSuspenseQuery } from '@tanstack/react-query' import { epoch2date } from '@/app/utils/epoch2datestring' @@ -13,12 +13,12 @@ const VersionChooser = ({ const { data, error } = useSuspenseQuery({ queryKey: ['authors_all'], queryFn: () => { - const data = loadAllAuthors() + const data = loadAuthors(doc.manifest.authors) return data }, }) if (error) throw error - + useEffect(() => { console.log(data) }, [data]) diff --git a/src/app/document/view/[slug]/loading.module.css b/src/app/document/view/[slug]/loading.module.css new file mode 100644 index 0000000..34cf148 --- /dev/null +++ b/src/app/document/view/[slug]/loading.module.css @@ -0,0 +1,31 @@ +.skeleton-box { + display: inline-block; + height: 1em; + position: relative; + overflow: hidden; + background-color: #dddbdd; + + &::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + transform: translateX(-100%); + background-image: linear-gradient( + 90deg, + rgba(#fff, 0) 0, + rgba(#fff, 0.2) 20%, + rgba(#fff, 0.5) 60%, + rgba(#fff, 0) + ); + animation: shimmer 5s infinite; + content: ''; + } + + @keyframes shimmer { + 100% { + transform: translateX(100%); + } + } +} From 1dbc8de1077353e6a5a80762d935322cc88d6e27 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 14 Feb 2024 19:59:43 -0800 Subject: [PATCH 21/21] fix EVERYTHING for REAL --- src/app/db/loaders.ts | 1 + .../document/view/[slug]/DocumentViewer.tsx | 18 ++++++++++++++---- .../document/view/[slug]/VersionChooser.tsx | 6 +----- src/app/document/view/[slug]/page.tsx | 17 +++++++++++------ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/app/db/loaders.ts b/src/app/db/loaders.ts index 759c783..4e40eec 100644 --- a/src/app/db/loaders.ts +++ b/src/app/db/loaders.ts @@ -91,6 +91,7 @@ export const loadAllAuthors = (): Promise<{ [key: string]: Author }> => { export const loadAuthors = ( authorIds: string[] ): Promise<{ [key: string]: Author }> => { + 'use client' return new Promise((resolve, reject) => { if (typeof Worker !== 'undefined') { const worker = new Worker( diff --git a/src/app/document/view/[slug]/DocumentViewer.tsx b/src/app/document/view/[slug]/DocumentViewer.tsx index e2a1eae..6cc1e09 100644 --- a/src/app/document/view/[slug]/DocumentViewer.tsx +++ b/src/app/document/view/[slug]/DocumentViewer.tsx @@ -1,4 +1,4 @@ -import { documents } from '@/app/db/data' +'use client' import { Zilla_Slab } from 'next/font/google' import { epoch2datestring } from '@/app/utils/epoch2datestring' import { @@ -12,16 +12,26 @@ import { ItemBadge, Status } from '@/app/components/Badges' import { notFound } from 'next/navigation' import VersionChooser from './VersionChooser' import crypto from 'crypto' -import loadingStyles from './loading.module.css' import { Suspense } from 'react' +import { loadDocument } from '@/app/db/loaders' +import { useSuspenseQuery } from '@tanstack/react-query' const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] }) const DocumentViewer = ({ slug }: Readonly<{ slug: string }>) => { - const doc = documents[slug] + const { data, error } = useSuspenseQuery({ + queryKey: [slug], + queryFn: () => { + const data = loadDocument(slug) + return data + }, + }) + if (error) throw error + let doc = data + // const doc = documents[slug] const { manifest, abstract, citation } = doc - if (!manifest) return notFound() + // if (!manifest) return notFound() const { title, authors, diff --git a/src/app/document/view/[slug]/VersionChooser.tsx b/src/app/document/view/[slug]/VersionChooser.tsx index e40e7cc..95d23be 100644 --- a/src/app/document/view/[slug]/VersionChooser.tsx +++ b/src/app/document/view/[slug]/VersionChooser.tsx @@ -1,5 +1,5 @@ 'use client' -import { useState, useEffect } from 'react' +import { useState } from 'react' import { Document } from '@/app/db/data' import Link from 'next/link' import { loadAuthors } from '@/app/db/loaders' @@ -19,10 +19,6 @@ const VersionChooser = ({ }) if (error) throw error - useEffect(() => { - console.log(data) - }, [data]) - const { file } = doc const { authors, latest } = doc.manifest const date = epoch2date(doc.manifest.dates[doc.manifest.dates.length - 1]) diff --git a/src/app/document/view/[slug]/page.tsx b/src/app/document/view/[slug]/page.tsx index 6905223..2307200 100644 --- a/src/app/document/view/[slug]/page.tsx +++ b/src/app/document/view/[slug]/page.tsx @@ -1,13 +1,18 @@ +'use client' import DocumentViewer from './DocumentViewer' -import { documents } from '@/app/db/data' +import ErrorBoundary from '@/app/utils/ErrorBoundary' -export function generateStaticParams() { - const docsList = Object.keys(documents) - return docsList.map((doc) => ({ doc })) -} +// export function generateStaticParams() { +// const docsList = Object.keys(documents) +// return docsList.map((doc) => ({ doc })) +// } export default function Page({ params, }: Readonly<{ params: { slug: string } }>) { - return + return ( + + + + ) }