From 9f189a9a446cf6d341342aef0aa03fd8dff64f8d Mon Sep 17 00:00:00 2001 From: datalore Date: Thu, 16 Nov 2023 02:21:52 +0100 Subject: [PATCH 1/5] Patched shuffle function to copy array The inline implementation of shuffle caused React not to detect changes, because the reference didn't change. Copying the array with slice(), thus changing the reference, fixed the issue. --- src/app/components/bingocontroller.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/components/bingocontroller.tsx b/src/app/components/bingocontroller.tsx index d3857a4..5461e46 100644 --- a/src/app/components/bingocontroller.tsx +++ b/src/app/components/bingocontroller.tsx @@ -4,6 +4,7 @@ import React from 'react' import Bingo from './bingo' function FisherYatesShuffle(array:string[]):string[]{ + array = array.slice(); for(let i = array.length - 1; i > 0; i--){ const j = Math.floor(Math.random() * (i + 1)); const temp = array[i]; From 487f5f854e447d3935fbcb3989877ffe6d8a64e5 Mon Sep 17 00:00:00 2001 From: datalore Date: Thu, 16 Nov 2023 02:42:04 +0100 Subject: [PATCH 2/5] Updated version to 0.3.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18cd3b3..6ee0aa3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "buzzword-bingo", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "buzzword-bingo", - "version": "0.3.0", + "version": "0.3.1", "dependencies": { "next": "14.0.1", "react": "^18", diff --git a/package.json b/package.json index db92b76..2269bde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "buzzword-bingo", - "version": "0.3.0", + "version": "0.3.1", "private": true, "scripts": { "dev": "next dev", From 2abc635d4f156a3a3d761a23c14cd282f1738285 Mon Sep 17 00:00:00 2001 From: datalore Date: Thu, 16 Nov 2023 02:45:55 +0100 Subject: [PATCH 3/5] Updated daisyui 3.9.4 -> 4.0.8 --- package-lock.json | 30 ++++++++++++++++-------------- package.json | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ee0aa3..f42ce91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@types/react-dom": "^18", "autoprefixer": "^10.4.16", "clsx": "^2.0.0", - "daisyui": "^3.9.4", + "daisyui": "^4.0.8", "postcss": "^8.4.31", "tailwindcss": "^3.3.5", "typescript": "^5" @@ -531,12 +531,6 @@ "node": ">=6" } }, - "node_modules/colord": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", - "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", - "dev": true - }, "node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -580,17 +574,25 @@ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", "dev": true }, + "node_modules/culori": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/culori/-/culori-3.2.0.tgz", + "integrity": "sha512-HIEbTSP7vs1mPq/2P9In6QyFE0Tkpevh0k9a+FkjhD+cwsYm9WRSbn4uMdW9O0yXlNYC3ppxL3gWWPOcvEl57w==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/daisyui": { - "version": "3.9.4", - "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-3.9.4.tgz", - "integrity": "sha512-fvi2RGH4YV617/6DntOVGcOugOPym9jTGWW2XySb5ZpvdWO4L7bEG77VHirrnbRUEWvIEVXkBpxUz2KFj0rVnA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.0.8.tgz", + "integrity": "sha512-kz+UNSsQx5vEKtrzOKwVvUYVt87Qro94SjGBnQs/D5/UfVaAZwPy2SPJTKRdfNF+zlGUocGKkX1sHdAAGX4J5A==", "dev": true, "dependencies": { - "colord": "^2.9", "css-selector-tokenizer": "^0.8", - "postcss": "^8", - "postcss-js": "^4", - "tailwindcss": "^3.1" + "culori": "^3", + "picocolors": "^1", + "postcss-js": "^4" }, "engines": { "node": ">=16.9.0" diff --git a/package.json b/package.json index 2269bde..42beef3 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@types/react-dom": "^18", "autoprefixer": "^10.4.16", "clsx": "^2.0.0", - "daisyui": "^3.9.4", + "daisyui": "^4.0.8", "postcss": "^8.4.31", "tailwindcss": "^3.3.5", "typescript": "^5" From 6a9b3e2af96ee55c77bc56b91633e39526d6811f Mon Sep 17 00:00:00 2001 From: datalore Date: Thu, 16 Nov 2023 02:46:22 +0100 Subject: [PATCH 4/5] Added themes coffee and dim --- src/app/components/themeswitcher.tsx | 2 ++ tailwind.config.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/themeswitcher.tsx b/src/app/components/themeswitcher.tsx index 3896566..df12b99 100644 --- a/src/app/components/themeswitcher.tsx +++ b/src/app/components/themeswitcher.tsx @@ -16,6 +16,8 @@ export default function ThemeSwitcher(){
  • setTheme("valentine")}>Valentine
  • setTheme("pastel")}>Pastel
  • setTheme("aqua")}>Aqua
  • +
  • setTheme("coffee")}>Coffee
  • +
  • setTheme("dim")}>Dim
  • ); } diff --git a/tailwind.config.ts b/tailwind.config.ts index 75e5a7d..55bffe2 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -7,7 +7,7 @@ const config: Config = { }, plugins: [require("daisyui")], daisyui: { - themes: ["light", "dark", "synthwave", "cyberpunk", "valentine", "pastel", "aqua"] + themes: ["light", "dark", "synthwave", "cyberpunk", "valentine", "pastel", "aqua", "coffee", "dim"] } }; From f100d1afa9a4779d5aac671db20605c647ece3d2 Mon Sep 17 00:00:00 2001 From: datalore Date: Thu, 16 Nov 2023 02:59:51 +0100 Subject: [PATCH 5/5] Resorted themes and added icon for dark themes --- README.md | 1 + src/app/components/darkicon.tsx | 5 +++++ src/app/components/themeswitcher.tsx | 11 ++++++----- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 src/app/components/darkicon.tsx diff --git a/README.md b/README.md index f98044d..e2a0799 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ This is a Buzzword Bingo generator for IT buzzwords, based on [Next.js](https://nextjs.org/), [TailwindCSS](https://tailwindcss.com/) and [DaisyUI](https://daisyui.com/). +Icons: [Iconify](https://icon-sets.iconify.design/ic/) ## Getting Started diff --git a/src/app/components/darkicon.tsx b/src/app/components/darkicon.tsx new file mode 100644 index 0000000..76cb0d1 --- /dev/null +++ b/src/app/components/darkicon.tsx @@ -0,0 +1,5 @@ +export default function DarkIcon(){ + return( + + ); +} diff --git a/src/app/components/themeswitcher.tsx b/src/app/components/themeswitcher.tsx index df12b99..4c7c467 100644 --- a/src/app/components/themeswitcher.tsx +++ b/src/app/components/themeswitcher.tsx @@ -1,6 +1,7 @@ "use client"; -import React from 'react'; +import React from "react"; +import DarkIcon from "./darkicon"; export default function ThemeSwitcher(){ const [theme, setTheme] = React.useState("dark"); @@ -10,14 +11,14 @@ export default function ThemeSwitcher(){ return( ); }