From c029ed416d37d30141e2b692e34e8d06c1721382 Mon Sep 17 00:00:00 2001 From: datalore Date: Fri, 16 Feb 2024 19:52:06 +0100 Subject: [PATCH 1/6] fix: Fixed buzzwords nullable issue --- package-lock.json | 2 +- src/app/components/bingocontroller.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ddbd1e3..54cba2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "buzzword-bingo", - "version": "0.3.1", + "version": "0.3.2", "dependencies": { "next": "14.0.1", "react": "^18", diff --git a/src/app/components/bingocontroller.tsx b/src/app/components/bingocontroller.tsx index 18969e1..eca3663 100644 --- a/src/app/components/bingocontroller.tsx +++ b/src/app/components/bingocontroller.tsx @@ -14,7 +14,7 @@ function FisherYatesShuffle(array:string[]):string[]{ return array; } -export default function BingoController({buzzwords} : {buzzwords: string[]}){ +export default function BingoController({buzzwords} : {buzzwords?: string[]}){ const [size, setSize] = React.useState(5); if(buzzwords == undefined || buzzwords.length < 1) buzzwords = ["Cloud", "Cyber-[Something]", "Distrupt[ive]", "AI", "Meta [Something]", "Gamification", "Web 2.0/3.0", "Industry 4.0", "Internet of Things", "Multiexperience", "Big Data", "Crypto", "[Something] as a service", "Emerging [Something]", "Streamline", "Ecosystem", "Leverage", "Outside the Box", "Pivot", "Strategic", "Agile", "Smart Tech", "Data Warehouse", "Actionable Insights", "Holistic Approach", "Digital Transformation", "Growth Hacking"]; const [items, setItems] = React.useState(buzzwords); @@ -30,7 +30,7 @@ export default function BingoController({buzzwords} : {buzzwords: string[]}){ 4x4 5x5 - setItems(FisherYatesShuffle(buzzwords))}>Regenerate + setItems(FisherYatesShuffle(buzzwords!))}>Regenerate {sizeError &&
Warning: Mismatch between item count and size
} From a79ebaf044b512194702e20b01800768c44de4ef Mon Sep 17 00:00:00 2001 From: datalore Date: Sat, 17 Feb 2024 19:04:31 +0100 Subject: [PATCH 2/6] feat: Improved layout on mobile devices --- src/app/components/bingo.tsx | 2 +- src/app/components/bingocontroller.tsx | 2 +- src/app/components/bingoitem.tsx | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/components/bingo.tsx b/src/app/components/bingo.tsx index a952d80..4040892 100644 --- a/src/app/components/bingo.tsx +++ b/src/app/components/bingo.tsx @@ -13,7 +13,7 @@ export default function Bingo({size, items}: Props){ rows[i] = activeItems.slice(i * size, (i + 1) * size); } return( - +
{rows.map((item, index) => )} diff --git a/src/app/components/bingocontroller.tsx b/src/app/components/bingocontroller.tsx index eca3663..059c788 100644 --- a/src/app/components/bingocontroller.tsx +++ b/src/app/components/bingocontroller.tsx @@ -21,7 +21,7 @@ export default function BingoController({buzzwords} : {buzzwords?: string[]}){ const sizeError = (items.length < size); return( <> -
+
setSize(+s)}/> diff --git a/src/app/components/bingoitem.tsx b/src/app/components/bingoitem.tsx index e72c404..cca8e48 100644 --- a/src/app/components/bingoitem.tsx +++ b/src/app/components/bingoitem.tsx @@ -9,6 +9,10 @@ export default function BingoItem({text}: Props){ const [clicked, setClicked] = React.useState(false); return( +<<<<<<< HEAD
+======= + +>>>>>>> c0e15bc (feat: Improved layout on mobile devices) ); } From 75fad798beebb7af5af4b04d2b6dd327534df5ca Mon Sep 17 00:00:00 2001 From: datalore Date: Sun, 18 Feb 2024 09:08:48 +0100 Subject: [PATCH 3/6] fix: Fixed merge conflict in cherry-pick --- src/app/components/bingoitem.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/components/bingoitem.tsx b/src/app/components/bingoitem.tsx index cca8e48..5eb4eda 100644 --- a/src/app/components/bingoitem.tsx +++ b/src/app/components/bingoitem.tsx @@ -9,10 +9,6 @@ export default function BingoItem({text}: Props){ const [clicked, setClicked] = React.useState(false); return( -<<<<<<< HEAD - -======= ->>>>>>> c0e15bc (feat: Improved layout on mobile devices) ); } From 3b63a4ce00b872191e7485574e01207a6fb0a24d Mon Sep 17 00:00:00 2001 From: datalore Date: Sun, 18 Feb 2024 09:53:52 +0100 Subject: [PATCH 4/6] feat: Improved navbar for mobile devices --- src/app/components/themeswitcher.tsx | 2 +- src/app/layout.tsx | 37 ++++++++++++++++------------ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/app/components/themeswitcher.tsx b/src/app/components/themeswitcher.tsx index 4c7c467..deee393 100644 --- a/src/app/components/themeswitcher.tsx +++ b/src/app/components/themeswitcher.tsx @@ -9,7 +9,7 @@ export default function ThemeSwitcher(){ React.useEffect(() => {document.body.setAttribute("data-theme", theme)}); return( -
    +
    • setTheme("light")}>Light
    • setTheme("cyberpunk")}>Cyberpunk
    • setTheme("valentine")}>Valentine
    • diff --git a/src/app/layout.tsx b/src/app/layout.tsx index c0d80b7..4649028 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -16,22 +16,27 @@ export default function RootLayout({
      -
      - Buzzword Bingov{process.env.npm_package_version} -
      -
      - -
      +
      +
      +
      + +
      + +
      + Buzzword Bingov{process.env.npm_package_version} +
      +
      + +
      {children} From e1be96557aa8aa6ba2a56c3fdd78ed6f2fc07e7d Mon Sep 17 00:00:00 2001 From: datalore Date: Sun, 18 Feb 2024 10:15:34 +0100 Subject: [PATCH 5/6] feat: Added orientation warning --- src/app/components/bingocontroller.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/app/components/bingocontroller.tsx b/src/app/components/bingocontroller.tsx index 059c788..04ab6bf 100644 --- a/src/app/components/bingocontroller.tsx +++ b/src/app/components/bingocontroller.tsx @@ -15,6 +15,24 @@ function FisherYatesShuffle(array:string[]):string[]{ } export default function BingoController({buzzwords} : {buzzwords?: string[]}){ + const [orientation, setOrientation] = React.useState(""); + React.useEffect(()=>{ + function updateOrientation() + { + setOrientation(window.screen.orientation.type); + } + + // init + updateOrientation(); + + window.addEventListener("orientationchange", updateOrientation); + + // destructor + return () => { + window.removeEventListener("orientationchange", updateOrientation); + } + }); + const [size, setSize] = React.useState(5); if(buzzwords == undefined || buzzwords.length < 1) buzzwords = ["Cloud", "Cyber-[Something]", "Distrupt[ive]", "AI", "Meta [Something]", "Gamification", "Web 2.0/3.0", "Industry 4.0", "Internet of Things", "Multiexperience", "Big Data", "Crypto", "[Something] as a service", "Emerging [Something]", "Streamline", "Ecosystem", "Leverage", "Outside the Box", "Pivot", "Strategic", "Agile", "Smart Tech", "Data Warehouse", "Actionable Insights", "Holistic Approach", "Digital Transformation", "Growth Hacking"]; const [items, setItems] = React.useState(buzzwords); @@ -22,6 +40,10 @@ export default function BingoController({buzzwords} : {buzzwords?: string[]}){ return( <>
      + {orientation != "landscape-primary" &&
      + + Please rotate your device +
      } setSize(+s)}/> From 405e634e59602ddf733632011eda18810d3e1a61 Mon Sep 17 00:00:00 2001 From: datalore Date: Sun, 18 Feb 2024 10:16:46 +0100 Subject: [PATCH 6/6] change: version number 0.4 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 54cba2f..a8ce3cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "buzzword-bingo", - "version": "0.3.2", + "version": "0.4", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index bb27581..dfc346b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "buzzword-bingo", - "version": "0.3.2", + "version": "0.4", "private": true, "scripts": { "dev": "next dev",
setClicked(!clicked)}>{text} setClicked(!clicked)}>{text} setClicked(!clicked)}>{text} setClicked(!clicked)}>{text}