From 8e427c4896ef15e2b2409d57f3590faf93a9651f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6ssner?= Date: Sun, 20 Oct 2024 14:57:03 +1100 Subject: [PATCH] fix(style): made headers unified - added the tailwindcss prettier plugin for better and more optimized bundling and to make it easier to work with tailwind - some other small changes --- .prettierrc | 1 - app/leaderboard/page.tsx | 6 +++--- app/maps/page.tsx | 16 ++++++++-------- app/maps/review/page.tsx | 6 +++--- app/play/[level]/page.tsx | 29 +++++++++++++---------------- app/play/page.tsx | 18 +++++++++--------- app/playground/page.tsx | 12 ++++++------ package.json | 2 ++ prettier.config.js | 6 ++++++ 9 files changed, 50 insertions(+), 46 deletions(-) delete mode 100644 .prettierrc create mode 100644 prettier.config.js diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0967ef4..0000000 --- a/.prettierrc +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/app/leaderboard/page.tsx b/app/leaderboard/page.tsx index 2d6521b..d8a4c10 100644 --- a/app/leaderboard/page.tsx +++ b/app/leaderboard/page.tsx @@ -65,10 +65,10 @@ const LeaderBoard = () => { ); return ( -
-

Leaderboard

+
+

Leaderboard

- + Global Rankings Map based Rankings diff --git a/app/maps/page.tsx b/app/maps/page.tsx index 57ff0b5..215fd4b 100644 --- a/app/maps/page.tsx +++ b/app/maps/page.tsx @@ -64,12 +64,12 @@ export default function AddMapPage() { setMap(newMap); }; return ( -
-

Submit Map

+
+

Submit Map

{isSubmitted ? (
-
+
-
+
{map.map((row, y) => (
{row.map((cell, x) => (
-

Night #{level}

+

Night #{level}

Loading...

@@ -153,9 +153,9 @@ export default function PlayLevelPage({ }; return ( -
-
-
-

Night #{level}

+

Night #{level}

{mode === "play" ? ( <> @@ -193,7 +193,7 @@ export default function PlayLevelPage({
-

+

{isSimulating ? "Simulation Result" : "Place Your Player"}

{isSimulating ? ( @@ -226,10 +226,7 @@ export default function PlayLevelPage({ row.map((cell, x) => (
handleCellClick(x, y)} /> )), @@ -280,12 +277,12 @@ export default function PlayLevelPage({ {tries && tries.attempts && tries.attempts.length > 0 && ( <> -
Tries
-
+
Tries
+
{tries.attempts.map((attempt) => (
{attempt?.grid && }
-

Choose a Night

+
+

Choose a Night

-
+
{Array.from({ length: 6 }).map((_, index) => ( ))} @@ -97,8 +97,8 @@ export default function PlayPage() { } return ( -
-

Choose a Night

+
+

Choose a Night

-
+
{filteredMaps.map((map) => ( - + Night #{map.level} - + diff --git a/app/playground/page.tsx b/app/playground/page.tsx index 8cdabdb..6e1efca 100644 --- a/app/playground/page.tsx +++ b/app/playground/page.tsx @@ -157,11 +157,11 @@ export default function PlaygroundPage() { const visualizing = solution !== null || visualizingUserSolution; return ( -
-

Playground

+
+

Playground

-
+
@@ -171,7 +171,7 @@ export default function PlaygroundPage() {

-
-
+
+
{isAdmin && ( <>

Model (~$0.002)

diff --git a/package.json b/package.json index 64ff3ef..91eebdc 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "survive-the-night-sim", "version": "0.1.0", "private": true, + "type": "module", "scripts": { "dev": "npm-run-all dev:init --parallel dev:frontend dev:backend", "dev:frontend": "next dev", @@ -53,6 +54,7 @@ "npm-run-all": "^4.1.5", "postcss": "^8", "prettier": "3.3.2", + "prettier-plugin-tailwindcss": "^0.6.8", "tailwindcss": "^3.4.1", "typescript": "^5", "vitest": "^2.1.3" diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..b2d59b4 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,6 @@ +/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */ +const config = { + plugins: ["prettier-plugin-tailwindcss"], +}; + +export default config;