diff --git a/.gitignore b/.gitignore index f8c4f656..afd5249e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,7 @@ yarn-error.log* public/rounds/ __pycache__/ + +.next +next-env.d.ts +dist diff --git a/.vercelignore b/.vercelignore new file mode 100644 index 00000000..da6ba7ec --- /dev/null +++ b/.vercelignore @@ -0,0 +1,2 @@ +.github +automation diff --git a/src/app/BetFunctions.jsx b/app/BetFunctions.jsx similarity index 100% rename from src/app/BetFunctions.jsx rename to app/BetFunctions.jsx diff --git a/src/app/DropZone.jsx b/app/DropZone.jsx similarity index 100% rename from src/app/DropZone.jsx rename to app/DropZone.jsx diff --git a/app/FaviconGenerator.jsx b/app/FaviconGenerator.jsx new file mode 100644 index 00000000..f4418d96 --- /dev/null +++ b/app/FaviconGenerator.jsx @@ -0,0 +1,40 @@ +import { useEffect } from "react"; + +const faviconTemplate = (icon) => { + return `${icon}`; +}; + +function FaviconGenerator() { + useEffect(() => { + const emojis = [ + "🍗", + "🍔", + "🍞", + "🥪", + "🥨", + "🍕", + "🌭", + "🌮", + "🌯", + "🍖", + "🥩", + "🥧", + "🥓", + "🦀", + ]; + + const linkForFavicon = document.querySelector(`head > link[rel='icon']`); + + if (linkForFavicon) { + const favicon = faviconTemplate( + emojis[Math.floor(Math.random() * emojis.length)] + ); + + linkForFavicon.setAttribute("href", `data:image/svg+xml,${favicon}`); + } + }, []); // Empty dependency array ensures this runs only once + + return null; +} + +export default FaviconGenerator; diff --git a/src/app/Footer.jsx b/app/Footer.jsx similarity index 96% rename from src/app/Footer.jsx rename to app/Footer.jsx index 2dfd4a30..5c5b2dad 100644 --- a/src/app/Footer.jsx +++ b/app/Footer.jsx @@ -12,13 +12,13 @@ import { Flex, } from "@chakra-ui/react"; import * as React from "react"; -import NeopointIcon from "./images/np-icon.svg"; +import NeopointIcon from "../public/images/np-icon.svg"; import { VercelCredit } from "./components/VercelCredit"; function Logo() { return ( - + NeoFoodClub diff --git a/src/app/Header.jsx b/app/Header.jsx similarity index 98% rename from src/app/Header.jsx rename to app/Header.jsx index fc4984b4..c9567691 100644 --- a/src/app/Header.jsx +++ b/app/Header.jsx @@ -28,7 +28,7 @@ import Cookies from "universal-cookie"; import Moment from "react-moment"; import React, { useContext, useEffect, useState, useMemo } from "react"; import moment from "moment"; -import NeopointIcon from "./images/np-icon.svg"; +import NeopointIcon from "../public/images/np-icon.svg"; import { calculateBaseMaxBet, @@ -211,14 +211,14 @@ function MaxBetInput() { ); } -function TitleHeading(props) { +function TitleHeading() { return ( <>
{ + const initialState = parseBetUrl(global?.window?.location.hash.slice(1)); -const initialViewMode = - Object.values(initialState.bets).filter((x) => x.some((val) => val > 0)) - .length > 0; + const initialViewMode = + Object.values(initialState.bets).filter((x) => x.some((val) => val > 0)) + .length > 0; -const StateProvider = ({ children }) => { const [roundState, setRoundState] = useReducer(reducer, { roundData: null, currentRound: null, @@ -79,7 +78,7 @@ const StateProvider = ({ children }) => { }; return ( - { }} > {children} - + ); }; diff --git a/src/app/components/BetAmountInput.jsx b/app/components/BetAmountInput.jsx similarity index 100% rename from src/app/components/BetAmountInput.jsx rename to app/components/BetAmountInput.jsx diff --git a/src/app/components/BetAmountsButtons.jsx b/app/components/BetAmountsButtons.jsx similarity index 100% rename from src/app/components/BetAmountsButtons.jsx rename to app/components/BetAmountsButtons.jsx diff --git a/src/app/components/BetAmountsSettings.jsx b/app/components/BetAmountsSettings.jsx similarity index 100% rename from src/app/components/BetAmountsSettings.jsx rename to app/components/BetAmountsSettings.jsx diff --git a/src/app/components/BigBrainElement.jsx b/app/components/BigBrainElement.jsx similarity index 100% rename from src/app/components/BigBrainElement.jsx rename to app/components/BigBrainElement.jsx diff --git a/src/app/components/ClearBetsButton.jsx b/app/components/ClearBetsButton.jsx similarity index 100% rename from src/app/components/ClearBetsButton.jsx rename to app/components/ClearBetsButton.jsx diff --git a/src/app/components/CustomOddsElement.jsx b/app/components/CustomOddsElement.jsx similarity index 100% rename from src/app/components/CustomOddsElement.jsx rename to app/components/CustomOddsElement.jsx diff --git a/src/app/components/CustomOddsInput.jsx b/app/components/CustomOddsInput.jsx similarity index 100% rename from src/app/components/CustomOddsInput.jsx rename to app/components/CustomOddsInput.jsx diff --git a/src/app/components/CustomProbsInput.jsx b/app/components/CustomProbsInput.jsx similarity index 100% rename from src/app/components/CustomProbsInput.jsx rename to app/components/CustomProbsInput.jsx diff --git a/src/app/components/EditBets.jsx b/app/components/EditBets.jsx similarity index 100% rename from src/app/components/EditBets.jsx rename to app/components/EditBets.jsx diff --git a/src/app/components/ExtraBox.jsx b/app/components/ExtraBox.jsx similarity index 100% rename from src/app/components/ExtraBox.jsx rename to app/components/ExtraBox.jsx diff --git a/src/app/components/FaDetailsElement.jsx b/app/components/FaDetailsElement.jsx similarity index 100% rename from src/app/components/FaDetailsElement.jsx rename to app/components/FaDetailsElement.jsx diff --git a/src/app/components/HorizontalScrollingBox.jsx b/app/components/HorizontalScrollingBox.jsx similarity index 100% rename from src/app/components/HorizontalScrollingBox.jsx rename to app/components/HorizontalScrollingBox.jsx diff --git a/src/app/components/PayoutCharts.jsx b/app/components/PayoutCharts.jsx similarity index 100% rename from src/app/components/PayoutCharts.jsx rename to app/components/PayoutCharts.jsx diff --git a/src/app/components/PayoutTable.jsx b/app/components/PayoutTable.jsx similarity index 100% rename from src/app/components/PayoutTable.jsx rename to app/components/PayoutTable.jsx diff --git a/src/app/components/Pd.jsx b/app/components/Pd.jsx similarity index 100% rename from src/app/components/Pd.jsx rename to app/components/Pd.jsx diff --git a/src/app/components/PirateSelect.jsx b/app/components/PirateSelect.jsx similarity index 100% rename from src/app/components/PirateSelect.jsx rename to app/components/PirateSelect.jsx diff --git a/src/app/components/PlaceThisBetButton.jsx b/app/components/PlaceThisBetButton.jsx similarity index 100% rename from src/app/components/PlaceThisBetButton.jsx rename to app/components/PlaceThisBetButton.jsx diff --git a/src/app/components/RoundInput.jsx b/app/components/RoundInput.jsx similarity index 100% rename from src/app/components/RoundInput.jsx rename to app/components/RoundInput.jsx diff --git a/src/app/components/SettingsBox.jsx b/app/components/SettingsBox.jsx similarity index 100% rename from src/app/components/SettingsBox.jsx rename to app/components/SettingsBox.jsx diff --git a/src/app/components/TableSettings.jsx b/app/components/TableSettings.jsx similarity index 99% rename from src/app/components/TableSettings.jsx rename to app/components/TableSettings.jsx index 55da5ab7..e76eebcb 100644 --- a/src/app/components/TableSettings.jsx +++ b/app/components/TableSettings.jsx @@ -253,7 +253,7 @@ const CopyWithDomain = () => { return (