diff --git a/.env.example b/.env.example index 73342135c..50bced59f 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,8 @@ # DEVELOPMENT TOOLS # Ideally, don't add them to production deployment envs # !STARTERCONF Change to true if you want to log data -NEXT_PUBLIC_SHOW_LOGGER="false" \ No newline at end of file +NEXT_PUBLIC_SHOW_LOGGER="true" + +NEXT_PUBLIC_PINKBOMBS_DATA_URL="https://pinkbombsfkynigjl-pinkbombs-data.functions.fnc.fr-par.scw.cloud/api/v1/secure/graphs" +#NEXT_PUBLIC_PINKBOMBS_DATA_URL="https://pinkbombsfkynigjl-pinkbombs-data.functions.fnc.fr-par.scw.cloud:8080/" +NEXT_PUBLIC_PINKBOMBS_DATA_API_KEY="pinkbombs" diff --git a/.eslintrc.js b/.eslintrc.js index 241cdcbe5..c978ed3a8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,74 +4,74 @@ module.exports = { es2021: true, node: true, }, - plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'], + plugins: ["@typescript-eslint", "simple-import-sort", "unused-imports"], extends: [ - 'eslint:recommended', - 'next', - 'next/core-web-vitals', - 'plugin:@typescript-eslint/recommended', - 'prettier', + "eslint:recommended", + "next", + "next/core-web-vitals", + "plugin:@typescript-eslint/recommended", + "prettier", ], rules: { - 'no-unused-vars': 'off', - 'no-console': 'warn', - '@typescript-eslint/explicit-module-boundary-types': 'off', - 'react/no-unescaped-entities': 'off', + "no-unused-vars": "off", + "no-console": "warn", + "@typescript-eslint/explicit-module-boundary-types": "off", + "react/no-unescaped-entities": "off", - 'react/display-name': 'off', - 'react/jsx-curly-brace-presence': [ - 'warn', - { props: 'never', children: 'never' }, + "react/display-name": "off", + "react/jsx-curly-brace-presence": [ + "warn", + { props: "never", children: "never" }, ], //#region //*=========== Unused Import =========== - '@typescript-eslint/no-unused-vars': 'off', - 'unused-imports/no-unused-imports': 'warn', - 'unused-imports/no-unused-vars': [ - 'warn', + "@typescript-eslint/no-unused-vars": "off", + "unused-imports/no-unused-imports": "warn", + "unused-imports/no-unused-vars": [ + "warn", { - vars: 'all', - varsIgnorePattern: '^_', - args: 'after-used', - argsIgnorePattern: '^_', + vars: "all", + varsIgnorePattern: "^_", + args: "after-used", + argsIgnorePattern: "^_", }, ], //#endregion //*======== Unused Import =========== //#region //*=========== Import Sort =========== - 'simple-import-sort/exports': 'warn', - 'simple-import-sort/imports': [ - 'warn', + "simple-import-sort/exports": "warn", + "simple-import-sort/imports": [ + "warn", { groups: [ // ext library & side effect imports - ['^@?\\w', '^\\u0000'], + ["^@?\\w", "^\\u0000"], // {s}css files - ['^.+\\.s?css$'], + ["^.+\\.s?css$"], // Lib and hooks - ['^@/lib', '^@/hooks'], + ["^@/lib", "^@/hooks"], // static data - ['^@/data'], + ["^@/data"], // components - ['^@/components', '^@/container'], + ["^@/components", "^@/container"], // zustand store - ['^@/store'], + ["^@/store"], // Other imports - ['^@/'], + ["^@/"], // relative paths up until 3 level [ - '^\\./?$', - '^\\.(?!/?$)', - '^\\.\\./?$', - '^\\.\\.(?!/?$)', - '^\\.\\./\\.\\./?$', - '^\\.\\./\\.\\.(?!/?$)', - '^\\.\\./\\.\\./\\.\\./?$', - '^\\.\\./\\.\\./\\.\\.(?!/?$)', + "^\\./?$", + "^\\.(?!/?$)", + "^\\.\\./?$", + "^\\.\\.(?!/?$)", + "^\\.\\./\\.\\./?$", + "^\\.\\./\\.\\.(?!/?$)", + "^\\.\\./\\.\\./\\.\\./?$", + "^\\.\\./\\.\\./\\.\\.(?!/?$)", ], - ['^@/types'], + ["^@/types"], // other that didnt fit in - ['^'], + ["^"], ], }, ], diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index fd592e82e..19da0d3bb 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -11,4 +11,4 @@ liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: ['https://saweria.co/theodorusclarence'] +custom: ["https://saweria.co/theodorusclarence"] diff --git a/.github/issue-branch.yml b/.github/issue-branch.yml index 1626600ad..af56e7d03 100644 --- a/.github/issue-branch.yml +++ b/.github/issue-branch.yml @@ -1,7 +1,7 @@ # https://github.com/robvanderleek/create-issue-branch#option-2-configure-github-action # ex: i4-lower_camel_upper -branchName: 'i${issue.number}-${issue.title,}' +branchName: "i${issue.number}-${issue.title,}" branches: - label: epic skip: true diff --git a/.github/workflows/issue-autolink.yml b/.github/workflows/issue-autolink.yml index 0da8924ea..78912173a 100644 --- a/.github/workflows/issue-autolink.yml +++ b/.github/workflows/issue-autolink.yml @@ -1,4 +1,4 @@ -name: 'Issue Autolink' +name: "Issue Autolink" on: pull_request: types: [opened] @@ -11,6 +11,6 @@ jobs: steps: - uses: tkt-actions/add-issue-links@v1.8.1 with: - repo-token: '${{ secrets.GITHUB_TOKEN }}' - branch-prefix: 'i' - resolve: 'true' + repo-token: "${{ secrets.GITHUB_TOKEN }}" + branch-prefix: "i" + resolve: "true" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index aeede5cc5..5eb498db1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,28 +17,24 @@ jobs: - name: ⬇️ Checkout repo uses: actions/checkout@v2 - - name: 🤌 Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - - name: ⎔ Setup node uses: actions/setup-node@v3 with: - node-version: 20 - cache: 'pnpm' + node-version: 18 - name: 📥 Download deps - run: pnpm install --frozen-lockfile + uses: u0reo/npm-install@fix/restore-failure + with: + useRollingCache: true - name: 🔬 Lint - run: pnpm run lint:strict + run: yarn lint:strict - name: 🔎 Type check - run: pnpm run typecheck + run: yarn typecheck - name: 💅 Prettier check - run: pnpm run format:check + run: yarn format:check - name: 🃏 Run jest - run: pnpm run test + run: yarn test diff --git a/.prettierrc.js b/.prettierrc.js index 5c344645a..850c7eaba 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,5 +1,5 @@ module.exports = { - arrowParens: 'always', + arrowParens: "always", singleQuote: true, jsxSingleQuote: true, tabWidth: 2, diff --git a/.vscode/css.code-snippets b/.vscode/css.code-snippets index 82cc815fe..951943e90 100644 --- a/.vscode/css.code-snippets +++ b/.vscode/css.code-snippets @@ -4,7 +4,7 @@ "body": [ "/* #region /**=========== ${1} =========== */", "$0", - "/* #endregion /**======== ${1} =========== */" - ] - } + "/* #endregion /**======== ${1} =========== */", + ], + }, } diff --git a/.vscode/typescriptreact.code-snippets b/.vscode/typescriptreact.code-snippets index 1fce740a5..70ca9b58b 100644 --- a/.vscode/typescriptreact.code-snippets +++ b/.vscode/typescriptreact.code-snippets @@ -2,29 +2,29 @@ //#region //*=========== React =========== "import React": { "prefix": "ir", - "body": ["import * as React from 'react';"] + "body": ["import * as React from 'react';"], }, "React.useState": { "prefix": "us", "body": [ - "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = React.useState<$3>(${2:initial${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}})$0" - ] + "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = React.useState<$3>(${2:initial${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}})$0", + ], }, "React.useEffect": { "prefix": "uf", - "body": ["React.useEffect(() => {", " $0", "}, []);"] + "body": ["React.useEffect(() => {", " $0", "}, []);"], }, "React.useReducer": { "prefix": "ur", "body": [ "const [state, dispatch] = React.useReducer(${0:someReducer}, {", " ", - "})" - ] + "})", + ], }, "React.useRef": { "prefix": "urf", - "body": ["const ${1:someRef} = React.useRef($0)"] + "body": ["const ${1:someRef} = React.useRef($0)"], }, "React Functional Component": { "prefix": "rc", @@ -36,8 +36,8 @@ " $0", " ", " )", - "}" - ] + "}", + ], }, "React Functional Component with Props": { "prefix": "rcp", @@ -52,8 +52,8 @@ " $0", " ", " )", - "}" - ] + "}", + ], }, //#endregion //*======== React =========== @@ -64,8 +64,8 @@ "body": [ "//#region //*=========== ${1} ===========", "${TM_SELECTED_TEXT}$0", - "//#endregion //*======== ${1} ===========" - ] + "//#endregion //*======== ${1} ===========", + ], }, "Region CSS": { "prefix": "regc", @@ -73,8 +73,8 @@ "body": [ "/* #region /**=========== ${1} =========== */", "${TM_SELECTED_TEXT}$0", - "/* #endregion /**======== ${1} =========== */" - ] + "/* #endregion /**======== ${1} =========== */", + ], }, //#endregion //*======== Commons =========== @@ -98,8 +98,8 @@ " ", " ", " )", - "}" - ] + "}", + ], }, "Next API": { "prefix": "napi", @@ -111,8 +111,8 @@ " } else {", " res.status(405).json({ message: 'Method Not Allowed' });", " }", - "}" - ] + "}", + ], }, "Get Static Props": { "prefix": "gsp", @@ -121,8 +121,8 @@ " return {", " props: {}", " };", - "}" - ] + "}", + ], }, "Get Static Paths": { "prefix": "gspa", @@ -134,8 +134,8 @@ " ],", " fallback: ", " };", - "}" - ] + "}", + ], }, "Get Server Side Props": { "prefix": "gssp", @@ -144,50 +144,50 @@ " return {", " props: {}", " };", - "}" - ] + "}", + ], }, "Infer Get Static Props": { "prefix": "igsp", - "body": "InferGetStaticPropsType" + "body": "InferGetStaticPropsType", }, "Infer Get Server Side Props": { "prefix": "igssp", - "body": "InferGetServerSidePropsType" + "body": "InferGetServerSidePropsType", }, "Import useRouter": { "prefix": "imust", - "body": ["import { useRouter } from 'next/router';"] + "body": ["import { useRouter } from 'next/router';"], }, "Import Next Image": { "prefix": "imimg", - "body": ["import Image from 'next/image';"] + "body": ["import Image from 'next/image';"], }, "Import Next Link": { "prefix": "iml", - "body": ["import Link from 'next/link';"] + "body": ["import Link from 'next/link';"], }, //#endregion //*======== Next.js =========== //#region //*=========== Snippet Wrap =========== "Wrap with Fragment": { "prefix": "ff", - "body": ["<>", "\t${TM_SELECTED_TEXT}", ""] + "body": ["<>", "\t${TM_SELECTED_TEXT}", ""], }, "Wrap with clsx": { "prefix": "cx", - "body": ["{clsx([${TM_SELECTED_TEXT}$0])}"] + "body": ["{clsx([${TM_SELECTED_TEXT}$0])}"], }, "Wrap with clsxm": { "prefix": "cxm", - "body": ["{clsxm([${TM_SELECTED_TEXT}$0, className])}"] + "body": ["{clsxm([${TM_SELECTED_TEXT}$0, className])}"], }, //#endregion //*======== Snippet Wrap =========== "Logger": { "prefix": "lg", "body": [ - "logger({ ${1:${CLIPBOARD}} }, '${TM_FILENAME} line ${TM_LINE_NUMBER}')" - ] - } + "logger({ ${1:${CLIPBOARD}} }, '${TM_FILENAME} line ${TM_LINE_NUMBER}')", + ], + }, } diff --git a/commitlint.config.js b/commitlint.config.js index 3bf488d0b..c60624225 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,23 +1,23 @@ module.exports = { - extends: ['@commitlint/config-conventional'], + extends: ["@commitlint/config-conventional"], rules: { // TODO Add Scope Enum Here // 'scope-enum': [2, 'always', ['yourscope', 'yourscope']], - 'type-enum': [ + "type-enum": [ 2, - 'always', + "always", [ - 'feat', - 'fix', - 'docs', - 'chore', - 'style', - 'refactor', - 'ci', - 'test', - 'perf', - 'revert', - 'vercel', + "feat", + "fix", + "docs", + "chore", + "style", + "refactor", + "ci", + "test", + "perf", + "revert", + "vercel", ], ], }, diff --git a/jest.config.js b/jest.config.js index 10886cb18..aaa191a1a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,28 +1,28 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires -const nextJest = require('next/jest'); +const nextJest = require("next/jest"); const createJestConfig = nextJest({ // Provide the path to your Next.js app to load next.config.js and .env files in your test environment - dir: './', + dir: "./", }); // Add any custom config to be passed to Jest const customJestConfig = { // Add more setup options before each test is run - setupFilesAfterEnv: ['/jest.setup.js'], + setupFilesAfterEnv: ["/jest.setup.js"], // if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work - moduleDirectories: ['node_modules', '/'], + moduleDirectories: ["node_modules", "/"], - testEnvironment: 'jest-environment-jsdom', + testEnvironment: "jest-environment-jsdom", /** * Absolute imports and Module Path Aliases */ moduleNameMapper: { - '^@/(.*)$': '/src/$1', - '^~/(.*)$': '/public/$1', - '^.+\\.(svg)$': '/src/__mocks__/svg.tsx', + "^@/(.*)$": "/src/$1", + "^~/(.*)$": "/public/$1", + "^.+\\.(svg)$": "/src/__mocks__/svg.tsx", }, }; diff --git a/jest.setup.js b/jest.setup.js index 3f1e9e10e..7a9bf91c8 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -1,5 +1,5 @@ -import '@testing-library/jest-dom/extend-expect'; +import "@testing-library/jest-dom/extend-expect"; // Allow router mocks. // eslint-disable-next-line no-undef -jest.mock('next/router', () => require('next-router-mock')); +jest.mock("next/router", () => require("next-router-mock")); diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03dc..fd36f9494 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,5 +1,6 @@ /// /// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next-sitemap.config.js b/next-sitemap.config.js index cb05d3b75..8d9fbddf6 100644 --- a/next-sitemap.config.js +++ b/next-sitemap.config.js @@ -8,6 +8,6 @@ module.exports = { siteUrl: "https://pinkbombs-app.vercel.app", generateRobotsTxt: true, robotsTxtOptions: { - policies: [{ userAgent: '*', allow: '/' }], + policies: [{ userAgent: "*", allow: "/" }], }, }; diff --git a/next.config.js b/next.config.js index caecedc3f..a8a0126f7 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { eslint: { - dirs: ['src'], + dirs: ["src"], }, reactStrictMode: true, @@ -17,7 +17,7 @@ const nextConfig = { webpack(config) { // Grab the existing rule that handles SVG imports const fileLoaderRule = config.module.rules.find((rule) => - rule.test?.test?.('.svg') + rule.test?.test?.(".svg"), ); config.module.rules.push( @@ -32,12 +32,12 @@ const nextConfig = { test: /\.svg$/i, issuer: { not: /\.(css|scss|sass)$/ }, resourceQuery: { not: /url/ }, // exclude if *.svg?url - loader: '@svgr/webpack', + loader: "@svgr/webpack", options: { dimensions: false, titleProp: true, }, - } + }, ); // Modify the file loader rule to ignore *.svg, since we have it handled now. diff --git a/package.json b/package.json index 1117d4874..1c21585b5 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,12 @@ "clsx": "^2.0.0", "lucide-react": "^0.321.0", "next": "^14.0.4", + "plotly.js": "^2.31.1", + "plotly.js-dist-min": "^2.31.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-icons": "^4.12.0", + "react-plotly.js": "^2.6.0", "tailwind-merge": "^2.1.0", "zod": "^3.22.4" }, @@ -33,7 +36,9 @@ "@tailwindcss/forms": "^0.5.7", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", + "@types/plotly.js-dist-min": "^2.3.4", "@types/react": "^18.2.45", + "@types/react-plotly.js": "^2.6.3", "@types/testing-library__jest-dom": "^5.14.9", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", @@ -47,8 +52,9 @@ "lint-staged": "^12.5.0", "next-router-mock": "^0.9.0", "next-sitemap": "^2.5.28", + "pnpm": "^9.0.5", "postcss": "^8.4.32", - "prettier": "^2.8.8", + "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.5.0", "tailwindcss": "^3.3.6", "typescript": "^4.9.5" diff --git a/public/favicon/site.webmanifest b/public/favicon/site.webmanifest index b20abb7cb..fa99de77d 100644 --- a/public/favicon/site.webmanifest +++ b/public/favicon/site.webmanifest @@ -1,19 +1,19 @@ { - "name": "", - "short_name": "", - "icons": [ - { - "src": "/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/android-chrome-512x512.png", - "sizes": "512x512", - "type": "image/png" - } - ], - "theme_color": "#ffffff", - "background_color": "#ffffff", - "display": "standalone" + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" } diff --git a/public/iframes/map-land-plan.html b/public/iframes/map-land-plan.html new file mode 100644 index 000000000..7bcf2c1b8 --- /dev/null +++ b/public/iframes/map-land-plan.html @@ -0,0 +1,42365 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/public/images/bethechange.svg b/public/images/bethechange.svg new file mode 100644 index 000000000..e4631dd85 --- /dev/null +++ b/public/images/bethechange.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/public/images/bombs.svg b/public/images/bombs.svg new file mode 100644 index 000000000..d2a903cde --- /dev/null +++ b/public/images/bombs.svg @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/public/images/bottom.svg b/public/images/bottom.svg new file mode 100644 index 000000000..b64d0c3ac --- /dev/null +++ b/public/images/bottom.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/svg/butterfly.svg b/public/images/butterfly.svg similarity index 100% rename from public/svg/butterfly.svg rename to public/images/butterfly.svg diff --git a/public/svg/climat.svg b/public/images/climat.svg similarity index 100% rename from public/svg/climat.svg rename to public/images/climat.svg diff --git a/public/images/deforestation.webp b/public/images/deforestation.webp new file mode 100644 index 000000000..d1fc29c0e Binary files /dev/null and b/public/images/deforestation.webp differ diff --git a/public/images/dfg-logo.png b/public/images/dfg-logo.png deleted file mode 100644 index 95a9fd3dd..000000000 Binary files a/public/images/dfg-logo.png and /dev/null differ diff --git a/public/images/explose-small.svg b/public/images/explose-small.svg new file mode 100644 index 000000000..fd217aca9 --- /dev/null +++ b/public/images/explose-small.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/public/images/explose.svg b/public/images/explose.svg new file mode 100644 index 000000000..553c58342 --- /dev/null +++ b/public/images/explose.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + diff --git a/public/images/eye-red.svg b/public/images/eye-red.svg new file mode 100644 index 000000000..14e774fcb --- /dev/null +++ b/public/images/eye-red.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/eyes.svg b/public/images/eyes.svg new file mode 100644 index 000000000..fdb41d7e5 --- /dev/null +++ b/public/images/eyes.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/public/svg/globe.svg b/public/images/globe.svg similarity index 100% rename from public/svg/globe.svg rename to public/images/globe.svg diff --git a/public/svg/hearth.svg b/public/images/hearth.svg similarity index 100% rename from public/svg/hearth.svg rename to public/images/hearth.svg diff --git a/public/images/microplastics.webp b/public/images/microplastics.webp new file mode 100644 index 000000000..f9672ee5a Binary files /dev/null and b/public/images/microplastics.webp differ diff --git a/public/images/mosaic-biodiversite.jpg b/public/images/mosaic-biodiversite.jpg deleted file mode 100644 index dda298cc9..000000000 Binary files a/public/images/mosaic-biodiversite.jpg and /dev/null differ diff --git a/public/images/mosaic-climat.jpg b/public/images/mosaic-climat.jpg deleted file mode 100644 index 9bc081715..000000000 Binary files a/public/images/mosaic-climat.jpg and /dev/null differ diff --git a/public/images/mosaic-sante.jpg b/public/images/mosaic-sante.jpg deleted file mode 100644 index 03b3e4942..000000000 Binary files a/public/images/mosaic-sante.jpg and /dev/null differ diff --git a/public/images/mosaic-social.jpg b/public/images/mosaic-social.jpg deleted file mode 100644 index ea128ab97..000000000 Binary files a/public/images/mosaic-social.jpg and /dev/null differ diff --git a/public/images/new-tab.png b/public/images/new-tab.png deleted file mode 100644 index 994948776..000000000 Binary files a/public/images/new-tab.png and /dev/null differ diff --git a/public/images/og.jpg b/public/images/og.jpg new file mode 100644 index 000000000..d925734ba Binary files /dev/null and b/public/images/og.jpg differ diff --git a/public/svg/people.svg b/public/images/people.svg similarity index 100% rename from public/svg/people.svg rename to public/images/people.svg diff --git a/public/images/pinkbombs.svg b/public/images/pinkbombs.svg new file mode 100644 index 000000000..f06133c2f --- /dev/null +++ b/public/images/pinkbombs.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/salmon.svg b/public/images/salmon.svg new file mode 100644 index 000000000..6160d41b7 --- /dev/null +++ b/public/images/salmon.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/seastemik-logo.png b/public/images/seastemik-logo.png deleted file mode 100644 index a16850c56..000000000 Binary files a/public/images/seastemik-logo.png and /dev/null differ diff --git a/public/images/social-carbon.webp b/public/images/social-carbon.webp new file mode 100644 index 000000000..a718ff59b Binary files /dev/null and b/public/images/social-carbon.webp differ diff --git a/public/images/storytelling/animals-1200.jpg b/public/images/storytelling/animals-1200.jpg new file mode 100644 index 000000000..95c41f43e Binary files /dev/null and b/public/images/storytelling/animals-1200.jpg differ diff --git a/public/images/storytelling/animals-400.jpg b/public/images/storytelling/animals-400.jpg new file mode 100644 index 000000000..030578406 Binary files /dev/null and b/public/images/storytelling/animals-400.jpg differ diff --git a/public/images/storytelling/animals-600.jpg b/public/images/storytelling/animals-600.jpg new file mode 100644 index 000000000..9caa6d749 Binary files /dev/null and b/public/images/storytelling/animals-600.jpg differ diff --git a/public/images/storytelling/biodiversity-1200.jpg b/public/images/storytelling/biodiversity-1200.jpg new file mode 100644 index 000000000..60d945195 Binary files /dev/null and b/public/images/storytelling/biodiversity-1200.jpg differ diff --git a/public/images/storytelling/biodiversity-400.jpg b/public/images/storytelling/biodiversity-400.jpg new file mode 100644 index 000000000..6ecc8bd23 Binary files /dev/null and b/public/images/storytelling/biodiversity-400.jpg differ diff --git a/public/images/storytelling/biodiversity-600.jpg b/public/images/storytelling/biodiversity-600.jpg new file mode 100644 index 000000000..d32e6a22c Binary files /dev/null and b/public/images/storytelling/biodiversity-600.jpg differ diff --git a/public/images/storytelling/business-full.jpg b/public/images/storytelling/business-full.jpg new file mode 100644 index 000000000..1b9d5f290 Binary files /dev/null and b/public/images/storytelling/business-full.jpg differ diff --git a/public/images/storytelling/business-small.jpg b/public/images/storytelling/business-small.jpg new file mode 100644 index 000000000..6cec90d83 Binary files /dev/null and b/public/images/storytelling/business-small.jpg differ diff --git a/public/images/storytelling/climat-1200.jpg b/public/images/storytelling/climat-1200.jpg new file mode 100644 index 000000000..42d1ffeac Binary files /dev/null and b/public/images/storytelling/climat-1200.jpg differ diff --git a/public/images/storytelling/climat-400.jpg b/public/images/storytelling/climat-400.jpg new file mode 100644 index 000000000..816b0e78e Binary files /dev/null and b/public/images/storytelling/climat-400.jpg differ diff --git a/public/images/storytelling/climat-600.jpg b/public/images/storytelling/climat-600.jpg new file mode 100644 index 000000000..78ac3e57c Binary files /dev/null and b/public/images/storytelling/climat-600.jpg differ diff --git a/public/images/storytelling/health-1200.jpg b/public/images/storytelling/health-1200.jpg new file mode 100644 index 000000000..71e5803df Binary files /dev/null and b/public/images/storytelling/health-1200.jpg differ diff --git a/public/images/storytelling/health-400.jpg b/public/images/storytelling/health-400.jpg new file mode 100644 index 000000000..d3ce055e3 Binary files /dev/null and b/public/images/storytelling/health-400.jpg differ diff --git a/public/images/storytelling/health-600.jpg b/public/images/storytelling/health-600.jpg new file mode 100644 index 000000000..c39c2fc3c Binary files /dev/null and b/public/images/storytelling/health-600.jpg differ diff --git a/public/images/storytelling/social-1200.jpg b/public/images/storytelling/social-1200.jpg new file mode 100644 index 000000000..8d0464f4c Binary files /dev/null and b/public/images/storytelling/social-1200.jpg differ diff --git a/public/images/storytelling/social-400.jpg b/public/images/storytelling/social-400.jpg new file mode 100644 index 000000000..e4a2cbf5c Binary files /dev/null and b/public/images/storytelling/social-400.jpg differ diff --git a/public/images/storytelling/social-600.jpg b/public/images/storytelling/social-600.jpg new file mode 100644 index 000000000..38278b727 Binary files /dev/null and b/public/images/storytelling/social-600.jpg differ diff --git a/public/images/stress.webp b/public/images/stress.webp new file mode 100644 index 000000000..bb7902406 Binary files /dev/null and b/public/images/stress.webp differ diff --git a/public/images/wave-text-light.svg b/public/images/wave-text-light.svg new file mode 100644 index 000000000..342aec116 --- /dev/null +++ b/public/images/wave-text-light.svg @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/public/images/wave-text.svg b/public/images/wave-text.svg new file mode 100644 index 000000000..42f49a29a --- /dev/null +++ b/public/images/wave-text.svg @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/public/images/wave.svg b/public/images/wave.svg new file mode 100644 index 000000000..dd024cd7c --- /dev/null +++ b/public/images/wave.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/public/svg/bomb.svg b/public/svg/bomb.svg deleted file mode 100644 index d9239771a..000000000 --- a/public/svg/bomb.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/public/svg/explose-small.svg b/public/svg/explose-small.svg deleted file mode 100644 index 607c90038..000000000 --- a/public/svg/explose-small.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/public/svg/explose.svg b/public/svg/explose.svg deleted file mode 100644 index 49faa166c..000000000 --- a/public/svg/explose.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - diff --git a/public/svg/fish.svg b/public/svg/fish.svg deleted file mode 100644 index 47c9c41bf..000000000 --- a/public/svg/fish.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/svg/fish_eye.svg b/public/svg/fish_eye.svg deleted file mode 100755 index 213efaab6..000000000 --- a/public/svg/fish_eye.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/public/svg/linkedin-logo.svg b/public/svg/linkedin-logo.svg deleted file mode 100644 index 17413af28..000000000 --- a/public/svg/linkedin-logo.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/svg/new-tab.svg b/public/svg/new-tab.svg deleted file mode 100644 index 0042df1bf..000000000 --- a/public/svg/new-tab.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/svg/pinkbombs-logo.svg b/public/svg/pinkbombs-logo.svg deleted file mode 100644 index f797e97d3..000000000 --- a/public/svg/pinkbombs-logo.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/public/svg/wave.svg b/public/svg/wave.svg deleted file mode 100644 index 9cc915c79..000000000 --- a/public/svg/wave.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/svg/x-logo.svg b/public/svg/x-logo.svg deleted file mode 100644 index f4291e59f..000000000 --- a/public/svg/x-logo.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/__mocks__/svg.tsx b/src/__mocks__/svg.tsx index f973aa328..0c49901b3 100644 --- a/src/__mocks__/svg.tsx +++ b/src/__mocks__/svg.tsx @@ -1,7 +1,7 @@ -import React, { SVGProps } from 'react'; +import React, { SVGProps } from "react"; const SvgrMock = React.forwardRef>( - (props, ref) => + (props, ref) => , ); export const ReactComponent = SvgrMock; diff --git a/src/__tests__/pages/HomePage.test.tsx b/src/__tests__/pages/HomePage.test.tsx deleted file mode 100644 index f2fb81df3..000000000 --- a/src/__tests__/pages/HomePage.test.tsx +++ /dev/null @@ -1,15 +0,0 @@ -// !STARTERCONF You should delete this page - -import { render, screen } from '@testing-library/react'; - -import HomePage from '@/app/page'; - -describe('Homepage', () => { - it('renders the Components', () => { - render(); - - const heading = screen.getByText(/A starter for Next.js/i); - - expect(heading).toBeInTheDocument(); - }); -}); diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index 38c93eacd..f4b7cce12 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -1,26 +1,16 @@ -'use client'; +"use client"; -import * as React from 'react'; -import '@/lib/env'; +import * as React from "react"; +import "@/lib/env"; + +import IntroBlock from "@/components/IntroBlock"; const AboutPage = () => { return ( <> - + ); -} +}; export default AboutPage; - -const IntroSection = () => { - return ( -
-
-

About

-

Pinkbombs

-
- -
- ) -}; diff --git a/src/app/api/hello/route.ts b/src/app/api/hello/route.ts index 95ab33201..f9d4ae549 100644 --- a/src/app/api/hello/route.ts +++ b/src/app/api/hello/route.ts @@ -1,5 +1,5 @@ -import { NextResponse } from 'next/server'; +import { NextResponse } from "next/server"; export async function GET() { - return NextResponse.json({ hello: 'Next.js' }); + return NextResponse.json({ hello: "Next.js" }); } diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 46f735bde..c0a50d716 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,25 +1,500 @@ -'use client'; +"use client"; -import * as React from 'react'; -import '@/lib/env'; -import clsx from 'clsx'; +import dynamic from "next/dynamic"; +import React, { useEffect, useState } from "react"; +import "@/lib/env"; + +import CustomDashboardSection from "@/components/CustomDashboardSection"; +import DashboardSection from "@/components/DashboardSection"; +import IntroBlock from "@/components/IntroBlock"; +import JoinBlock from "@/components/JoinBlock"; +import Summary, { SummaryLinksProps } from "@/components/Summary"; +import TitleBlock from "@/components/TitleBlock"; + +import { fetchData } from "@/pages/api/chart"; + +const DashboardChart = dynamic(() => import("@/components/DashboardChart"), { + ssr: false, +}); + +const summary: SummaryLinksProps = [ + { + title: "Intro", + sublinks: [ + { + label: "Effondrement du saumon sauvage de l'Atlantique", + targetId: "salmon-collapse", + }, + { + label: "Hyper-croissance de l’élevage du saumon", + targetId: "hyper-growth", + }, + { + label: "Principaux pays producteurs de saumon d'élevage", + targetId: "top-10", + }, + { + label: "Consommation", + targetId: "intro-consumption", + }, + ], + }, + { + title: "Entreprises", + sublinks: [ + { + label: "Principaux producteurs de saumon en filet ouvert", + targetId: "top-comp", + }, + { + label: "La nouvelle menace: sur fermes aquacoles terrestres", + targetId: "top-land", + }, + { + label: "Le futur des fermes aquacoles terrestres", + targetId: "future-land-based", + }, + { + label: "Consommation", + targetId: "companies-consumption", + }, + ], + }, + { + title: "Biodiversité", + sublinks: [ + { + label: "Deforestation", + targetId: "deforestation", + }, + { + label: "Les évasions", + targetId: "escapes-rates", + }, + ], + }, + { + title: "Human health", + sublinks: [ + { + label: "Consommation d'antibiotiques", + targetId: "antibiotic-conso", + }, + { + label: "Microplastique", + targetId: "microplastics", + }, + ], + }, + { + title: "Bien être animal", + sublinks: [ + { + label: "Densité / stress dans usine à terre", + targetId: "stress-onshore", + }, + { + label: "Taux de mortalité", + targetId: "mortality-rates", + }, + ], + }, + { + title: "Climat", + sublinks: [ + { + label: "Carbon", + targetId: "carbon-bomb", + }, + ], + }, + { + title: "Social", + sublinks: [ + { + label: "Carbon", + targetId: "social-carbon", + }, + ], + }, + { + title: "Alternatives", + sublinks: [ + { + label: "Matrice de nutrition", + targetId: "alternatives", + }, + ], + }, +]; const DashboardPage = () => { return ( <> - + + +
+ + + + + +
+ +
+ + + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + ); -} +}; export default DashboardPage; -const IntroSection = () => { +const SalmonCollapseSection = () => { + return ( + + ); +}; + +const SalmonFarmingSection = () => { + return ( + + ); +}; + +const TopCountriesSection = () => { + const [mapData, setMapData] = useState({ + data: [], + layout: {}, + }); + const fetchGraphData = async () => { + const mapResponse = await fetchData("graphs", "evolution-map"); + setMapData(mapResponse); + }; + useEffect(() => { + fetchGraphData(); + }, []); + + if (!mapData) { + return <>; + } + return ( -
-

- The numbers behind the story -

-
- ) + <> + + +
+

+ Evolution de l'élevage du saumon par pays +

+ + +
+ + ); +}; + +const SalmonConsumptionSection = () => { + return ( + + ); +}; + +const MainProductionSection = () => { + return ( + + ); +}; + +const LandPlantsSection = () => { + const [mapData, setMapData] = useState(""); + const fetchGraphData = async () => { + const mapResponse = await fetchData("maps", "ras-map", false); + setMapData(mapResponse); + }; + useEffect(() => { + fetchGraphData(); + }, []); + + if (!mapData) { + return <>; + } + return ( + <> + +
+
+

+ Le futur des fermes aquacoles terrestres +

+

+ Une ferme terrestre produisant 10 000 tonnes de saumon par an - si + elle était construite - nécessiterait autant d'électricité qu'une + ville de 39 215 habitant·e·s. Il existe actuellement plusieurs + projets en Europe, dont des méga-fermes visant à produire 100 000 + tonnes ou plus par an. +

+

+ Malgré les défis technologiques et de rentabilité, l'industrie + investit massivement dans les fermes terrestres, avec un grand + nombre de projets annoncés au cours des 5 dernières années. De + nombreuses fermes envisagent d'être construites ou sont déjà en + cours de construction en Europe, en Asie, au Moyen-Orient et aux + États-Unis pour approvisionner leurs marchés locaux. +

+
+
+
+

+91.1%

+

+ Les projets combinés de fermes terrestres (RAS) pourraient + représenter une augmentation de plus de 91 % de la production + mondiale de saumon. +

+
+
+

291 Milliards

+

+ Plus de 290 milliards de poissons sauvages, appelés poissons + fourrage, seront pêchés pour produire la farine nécessaire chaque + année à nourrir ces nouveaux saumons. +

+
+
+

1.4 Millions

+

+ Ces mêmes farines contiennent du soja. 975 000 hectares seront + nécessaires à la production de ce soja, l'équivalent d'environ 1,4 + millions de terrains de football. +

+
+
+

15.8 Millions

+

+ La consommation électrique nécessaire pour filtrer, refroidir et + faire circuler l'eau des fermes RAS représente l'équivalent de la + consommation annuelle de 15,8 millions d'européens. +

+
+
+