From 47c6c0742141f5b78c6a76136828ff61be017fc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mateusz=20Miko=C5=82ajczak?= <Mateusz@appunitesmac251.home>
Date: Thu, 21 Sep 2023 14:01:09 +0200
Subject: [PATCH] style(tailwind): move font config to MinervaSPA component

---
 next-env.d.ts                               |  1 +
 package-lock.json                           | 45 +++++----------------
 package.json                                |  1 +
 src/app/page.tsx => pages/index.tsx         |  1 +
 src/app/layout.tsx                          | 24 -----------
 src/components/SPA/MinervaSPA.component.tsx | 11 ++++-
 6 files changed, 23 insertions(+), 60 deletions(-)
 rename src/app/page.tsx => pages/index.tsx (72%)
 delete mode 100644 src/app/layout.tsx

diff --git a/next-env.d.ts b/next-env.d.ts
index 4f11a03d..fd36f949 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,5 +1,6 @@
 /// <reference types="next" />
 /// <reference types="next/image-types/global" />
+/// <reference types="next/navigation-types/compat/navigation" />
 
 // NOTE: This file should not be edited
 // see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/package-lock.json b/package-lock.json
index fe395e82..32205168 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -19,12 +19,12 @@
         "postcss": "8.4.29",
         "react": "18.2.0",
         "react-dom": "18.2.0",
+        "tailwind-merge": "^1.14.0",
         "tailwindcss": "3.3.3"
       },
       "devDependencies": {
         "@commitlint/cli": "^17.7.1",
         "@commitlint/config-conventional": "^17.7.0",
-        "@tailwindcss/typography": "^0.5.10",
         "@testing-library/jest-dom": "^6.1.3",
         "@testing-library/react": "^14.0.0",
         "@typescript-eslint/eslint-plugin": "^6.7.0",
@@ -2166,34 +2166,6 @@
         "tslib": "^2.4.0"
       }
     },
-    "node_modules/@tailwindcss/typography": {
-      "version": "0.5.10",
-      "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.10.tgz",
-      "integrity": "sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==",
-      "dev": true,
-      "dependencies": {
-        "lodash.castarray": "^4.4.0",
-        "lodash.isplainobject": "^4.0.6",
-        "lodash.merge": "^4.6.2",
-        "postcss-selector-parser": "6.0.10"
-      },
-      "peerDependencies": {
-        "tailwindcss": ">=3.0.0 || insiders"
-      }
-    },
-    "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": {
-      "version": "6.0.10",
-      "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
-      "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",
-      "dev": true,
-      "dependencies": {
-        "cssesc": "^3.0.0",
-        "util-deprecate": "^1.0.2"
-      },
-      "engines": {
-        "node": ">=4"
-      }
-    },
     "node_modules/@testing-library/dom": {
       "version": "9.3.3",
       "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz",
@@ -9195,12 +9167,6 @@
       "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",
       "dev": true
     },
-    "node_modules/lodash.castarray": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz",
-      "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==",
-      "dev": true
-    },
     "node_modules/lodash.isfunction": {
       "version": "3.0.9",
       "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz",
@@ -11664,6 +11630,15 @@
       "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
       "dev": true
     },
+    "node_modules/tailwind-merge": {
+      "version": "1.14.0",
+      "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-1.14.0.tgz",
+      "integrity": "sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==",
+      "funding": {
+        "type": "github",
+        "url": "https://github.com/sponsors/dcastil"
+      }
+    },
     "node_modules/tailwindcss": {
       "version": "3.3.3",
       "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz",
diff --git a/package.json b/package.json
index b7152afb..b4864fbb 100644
--- a/package.json
+++ b/package.json
@@ -37,6 +37,7 @@
     "postcss": "8.4.29",
     "react": "18.2.0",
     "react-dom": "18.2.0",
+    "tailwind-merge": "^1.14.0",
     "tailwindcss": "3.3.3"
   },
   "devDependencies": {
diff --git a/src/app/page.tsx b/pages/index.tsx
similarity index 72%
rename from src/app/page.tsx
rename to pages/index.tsx
index 0c103a3f..929f1328 100644
--- a/src/app/page.tsx
+++ b/pages/index.tsx
@@ -1,3 +1,4 @@
 import { MinervaSPA } from '@/components/SPA';
+import '@/styles/index.css';
 
 export default MinervaSPA;
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
deleted file mode 100644
index 63c2adad..00000000
--- a/src/app/layout.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Manrope } from '@next/font/google';
-
-import type { ReactNode } from 'react';
-
-import '@/styles/index.css';
-
-interface LayoutProps {
-  children: ReactNode;
-}
-
-const manrope = Manrope({
-  variable: '--font-manrope',
-  display: 'swap',
-  weight: ['400', '700'],
-  subsets: ['latin'],
-});
-
-const Layout = ({ children }: LayoutProps) => (
-  <div className={manrope.className}>
-    <div>{children}</div>
-  </div>
-);
-
-export default Layout;
diff --git a/src/components/SPA/MinervaSPA.component.tsx b/src/components/SPA/MinervaSPA.component.tsx
index 72989e4f..c4b61c47 100644
--- a/src/components/SPA/MinervaSPA.component.tsx
+++ b/src/components/SPA/MinervaSPA.component.tsx
@@ -1,8 +1,17 @@
+import { Manrope } from '@next/font/google';
+import { twMerge } from 'tailwind-merge';
 import { Map } from '@/components/Map';
 import { FunctionalArea } from '@/components/FunctionalArea';
 
+const manrope = Manrope({
+  variable: '--font-manrope',
+  display: 'swap',
+  weight: ['400', '700'],
+  subsets: ['latin'],
+});
+
 export const MinervaSPA = (): JSX.Element => (
-  <div className="relative">
+  <div className={twMerge('relative', manrope.variable)}>
     <FunctionalArea />
     <Map />
   </div>
-- 
GitLab