From 7c0aec11bc184a77ef23b79b8aaf98f9198d838d Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sun, 10 Nov 2024 18:57:13 +0100 Subject: [PATCH] Use NextJS for less JavaScript --- .eslintrc.cjs | 14 - .gitignore | 2 +- {src => app}/index.css | 4 + app/layout.tsx | 22 + src/App.tsx => app/page.tsx | 45 +- next-env.d.ts | 5 + next.config.mjs | 7 + package.json | 36 +- pnpm-lock.yaml | 1429 +++++++++++------ src/assets/img/brand.svg | 2 +- src/components/ContributePathToWiki.tsx | 4 + src/components/CookieBanner.tsx | 21 +- src/components/Footer.tsx | 3 +- src/components/MobileDrawer.tsx | 8 +- src/components/RealTimeCollaborationLink.tsx | 4 + src/components/SelectVersionModal.tsx | 16 +- src/components/ThemeToggler.tsx | 3 +- src/main.tsx | 21 - src/pages/GetInTouchContact.tsx | 35 - .../AddFunctionalities.tsx | 2 +- src/{pages => pagesToDisplay}/Contribute.tsx | 11 +- .../CustomizeAppearance.tsx | 3 +- .../DownloadLatestVersion.tsx | 4 +- src/pagesToDisplay/GetInTouchContact.tsx | 30 + src/{pages => pagesToDisplay}/Header.tsx | 11 +- .../LinksToRelevantResources.tsx | 0 .../MainHeadline.tsx | 2 +- .../PluginViewer.tsx | 1 + .../RealTimeCollaboration.tsx | 11 +- src/{pages => pagesToDisplay}/Thanking.tsx | 0 src/store/store.ts | 3 +- tailwind.config.js | 18 - tailwind.config.ts | 24 + tsconfig.json | 34 +- tsconfig.node.json | 10 - 35 files changed, 1151 insertions(+), 694 deletions(-) delete mode 100644 .eslintrc.cjs rename {src => app}/index.css (99%) create mode 100644 app/layout.tsx rename src/App.tsx => app/page.tsx (58%) create mode 100644 next-env.d.ts create mode 100644 next.config.mjs create mode 100644 src/components/ContributePathToWiki.tsx create mode 100644 src/components/RealTimeCollaborationLink.tsx delete mode 100644 src/main.tsx delete mode 100644 src/pages/GetInTouchContact.tsx rename src/{pages => pagesToDisplay}/AddFunctionalities.tsx (80%) rename src/{pages => pagesToDisplay}/Contribute.tsx (86%) rename src/{pages => pagesToDisplay}/CustomizeAppearance.tsx (84%) rename src/{pages => pagesToDisplay}/DownloadLatestVersion.tsx (99%) create mode 100644 src/pagesToDisplay/GetInTouchContact.tsx rename src/{pages => pagesToDisplay}/Header.tsx (89%) rename src/{pages => pagesToDisplay}/LinksToRelevantResources.tsx (100%) rename src/{pages => pagesToDisplay}/MainHeadline.tsx (92%) rename src/{pages => pagesToDisplay}/PluginViewer.tsx (99%) rename src/{pages => pagesToDisplay}/RealTimeCollaboration.tsx (83%) rename src/{pages => pagesToDisplay}/Thanking.tsx (100%) delete mode 100644 tailwind.config.js create mode 100644 tailwind.config.ts delete mode 100644 tsconfig.node.json diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 4020bcb..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - env: { browser: true, es2020: true }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', - ], - parser: '@typescript-eslint/parser', - parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, - plugins: ['react-refresh'], - rules: { - 'react-refresh/only-export-components': 'warn', - }, -} diff --git a/.gitignore b/.gitignore index 99adfa3..42d4b72 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,5 @@ node_modules/ dist/ .idea/ package-lock.json - +.next/ .idea/ diff --git a/src/index.css b/app/index.css similarity index 99% rename from src/index.css rename to app/index.css index 9a56c80..a033c8b 100644 --- a/src/index.css +++ b/app/index.css @@ -256,6 +256,10 @@ div#footer a { color: white; } +.image-logo { + width: auto; +} + div#footer img.logo { background-color: rgba(255, 255, 255, 0.4); border-radius: 50%; diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..15f281f --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,22 @@ +import './index.css' + + +export default function RootLayout({ + children, + }: { + children: React.ReactNode +}) { + return ( + + + Etherpad + + + + + +
{children}
+ + + ); +} diff --git a/src/App.tsx b/app/page.tsx similarity index 58% rename from src/App.tsx rename to app/page.tsx index 864f1d9..b5be5cc 100644 --- a/src/App.tsx +++ b/app/page.tsx @@ -1,22 +1,20 @@ -import {Header} from "./pages/Header.tsx"; -import {MainHeadline} from "./pages/MainHeadline.tsx"; -import {RealTimeCollaboration} from "./pages/RealTimeCollaboration.tsx"; -import {DownloadLatestVersion} from "./pages/DownloadLatestVersion.tsx"; -import {Contribute} from "./pages/Contribute.tsx"; -import {LinksToRelevantResources} from "./pages/LinksToRelevantResources.tsx"; -import {GetInTouchContact} from "./pages/GetInTouchContact.tsx"; -import {Thanking} from "./pages/Thanking.tsx"; -import {Footer} from "./components/Footer.tsx"; -import {AddFunctionalities} from "./pages/AddFunctionalities.tsx"; -import {CustomizeAppearance} from "./pages/CustomizeAppearance.tsx"; +import {SelectVersionModal} from "../src/components/SelectVersionModal.tsx"; +import {CookieBanner} from "../src/components/CookieBanner.tsx"; +import {Header} from "../src/pagesToDisplay/Header.tsx"; +import {MainHeadline} from "../src/pagesToDisplay/MainHeadline.tsx"; +import {RealTimeCollaboration} from "../src/pagesToDisplay/RealTimeCollaboration.tsx"; +import {AddFunctionalities} from "../src/pagesToDisplay/AddFunctionalities.tsx"; +import {CustomizeAppearance} from "../src/pagesToDisplay/CustomizeAppearance.tsx"; +import {DownloadLatestVersion} from "../src/pagesToDisplay/DownloadLatestVersion.tsx"; +import {Contribute} from "../src/pagesToDisplay/Contribute.tsx"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {faExternalLink} from "@fortawesome/free-solid-svg-icons"; -import {CookieBanner} from "./components/CookieBanner.tsx"; -import {SelectVersionModal} from "./components/SelectVersionModal.tsx"; -import {Outlet} from "react-router-dom"; +import {LinksToRelevantResources} from "../src/pagesToDisplay/LinksToRelevantResources.tsx"; +import {GetInTouchContact} from "../src/pagesToDisplay/GetInTouchContact.tsx"; +import {Thanking} from "../src/pagesToDisplay/Thanking.tsx"; +import {Footer} from "../src/components/Footer.tsx"; - -export const RootElement = ()=>{ +export default function Page() { return
@@ -26,15 +24,6 @@ export const RootElement = ()=>{
- -
- -} - -export const App = ()=> { - - return ( - <> @@ -55,8 +44,6 @@ export const App = ()=> {