From 8ca78892fdc98109c5fd61bdcf417040b5be6ea3 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 22 Jun 2022 12:14:35 -0300 Subject: [PATCH 01/62] Adding links to leaderboard on games page --- src/pages/GameEditorPage.tsx | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index 0ca5c13..7eba2da 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -1,5 +1,6 @@ import { FormikHelpers, useFormik } from "formik"; import { useEffect, useState } from "react"; +import { Link } from "react-router-dom"; import { useParams, useNavigate } from "react-router-dom"; import { SyncLoader } from "react-spinners"; import * as Yup from "yup"; @@ -30,6 +31,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { const [isUpdatingGameName, setIsUpdatingGameName] = useState(false); const [errorMessage, setErrorMessage] = useState(null); const navigate = useNavigate(); + // let history = useHistory(); const { gameTypeId } = useParams<{ gameTypeId: string }>(); @@ -196,13 +198,11 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { Leaderboards
- + + +
@@ -219,13 +219,13 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { {currentGameType?._leaderboards?.map( (leaderboard: ILeaderboard) => ( - - + +
{leaderboard.id}{leaderboard.name}{leaderboard.id}{leaderboard.name} - {leaderboard.scoreStrategy} + {leaderboard.scoreStrategy} - {leaderboard.resetStrategy} + {leaderboard.resetStrategy} + From fcfc99ae726c96e35a8ee7f058c8222e36369aa0 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 22 Jun 2022 19:46:42 -0300 Subject: [PATCH 02/62] Adding leaderboard and achievement initial pages ready to fetch values --- src/App.tsx | 22 +++++++++++++++++++++ src/pages/AchievementsPage.tsx | 33 +++++++++++++++++++++++++++++++ src/pages/GameEditorPage.tsx | 36 +++++++++++++++------------------- src/pages/LeaderboardsPage.tsx | 33 +++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 20 deletions(-) create mode 100644 src/pages/AchievementsPage.tsx create mode 100644 src/pages/LeaderboardsPage.tsx diff --git a/src/App.tsx b/src/App.tsx index 844a665..1ef1af5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,6 +22,8 @@ import HomePage from "./pages/HomePage"; // import { UnauthorizedPage } from "./pages/UnauthorizedPage"; import { ProtectedRoute } from "./ProtectedRoute"; import { AppMenu } from "./AppMenu"; +import AchievementsPage from "./pages/AchievementsPage"; +import LeaderboardsPage from "./pages/LeaderboardsPage"; export const App = () => { // if (isDoingInitialLoading) { @@ -66,6 +68,26 @@ export const App = () => { } /> + + + + + + } + /> + + + + + + } + /> { + const achievement = useState(); + useEffect(() => { + async function fetchAchievement() { + const achievement = await getAchievement(1,2); // TODO GET FROM PARAM + } + + fetchAchievement(); + }, []); + + return ( +
+

+ ACHIEVEMENTS +

+ + {achievement ? ( + <> +
+ +
+ + ) : ( +

Loading

+ )} + + ); +}; + +export default AchievementsPage; diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index 7eba2da..506aae2 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -31,7 +31,6 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { const [isUpdatingGameName, setIsUpdatingGameName] = useState(false); const [errorMessage, setErrorMessage] = useState(null); const navigate = useNavigate(); - // let history = useHistory(); const { gameTypeId } = useParams<{ gameTypeId: string }>(); @@ -157,7 +156,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
- {isUpdatingGameName ? + {isUpdatingGameName || !editMode ? (
-
+ +
Client Secret - {currentGameType?.clientSecret} + {currentGameType?.clientSecret}
-
+
Signing Secret - {currentGameType?.signingSecret} + {currentGameType?.signingSecret}
@@ -193,16 +193,14 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
-
+

Leaderboards

- - - +
@@ -230,7 +228,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
-
+

Achievements

- - - +
@@ -284,7 +280,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
-
+ setShowModal(false)} /> + ); }; diff --git a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx new file mode 100644 index 0000000..3477a89 --- /dev/null +++ b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx @@ -0,0 +1,85 @@ +import { useFormik } from "formik"; +import { useEffect, useState } from "react"; +import Button from "../Button"; +import Checkbox from "../Checkbox"; +import Modal from "../Modal"; +import TextInput from "../TextInput"; + +interface IProps { + show: boolean; + onClose: () => void; +} + +const AddOrEditAchievementModal = ({ + show, + onClose, +}: IProps) => { + + // useEffect + // const { + // getFieldProps, + // getFieldMeta, + // handleSubmit, + // isValid, + // setValues, + // } = useFormik({ + // // initialValues: {}, + // // onSubmit, + // // validationSchema, + // }); + + return ( +
+ +

+ Edit Achievement +

+
+
+
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+
+ ); +}; + +export default AddOrEditAchievementModal; diff --git a/src/ui/AddOrEditAchievementModal/index.tsx b/src/ui/AddOrEditAchievementModal/index.tsx new file mode 100644 index 0000000..10356e0 --- /dev/null +++ b/src/ui/AddOrEditAchievementModal/index.tsx @@ -0,0 +1,3 @@ +import AddOrEditAchievementModal from "./AddOrEditAchievementModal"; + +export default AddOrEditAchievementModal; From a611fa697c236c9abcab9f45ec0e2e7d9cf2c4cd Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 16:04:40 -0300 Subject: [PATCH 08/62] Updating types to match updated Achievement interface --- src/types.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/types.d.ts b/src/types.d.ts index cbacded..2210ae7 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -22,20 +22,20 @@ interface IGameType { } interface ILeaderboard { - id: number; + id?: number; name: string; scoreStrategy: string; resetStrategy: string; } -interface IAchievement extends SignInOut { - id: number; +interface IAchievement { + id?: number; _gameTypeId: number; description: string; - gameType: IGameType; + gameType?: IGameType; isEnabled: boolean; targetValue: number; - createdAt: string; + createdAt?: string; updatedAt: string; } From 8baf9e1b71e93cc35b473fac2d8a11409ab49892 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 16:05:01 -0300 Subject: [PATCH 09/62] Achievements modal logic on game editor page --- src/pages/GameEditorPage.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index b9eda78..d2633cb 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -30,6 +30,8 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { ); const [achievements, setAchievements] = useState([]); const [isUpdatingGameName, setIsUpdatingGameName] = useState(false); + const [selectedAchievement, setSelectedAchievement] = useState(); + const [selectedLeaderboard, setSelectedLeaderboard] = useState(); const [showModal, setShowModal] = useState(false); const [errorMessage, setErrorMessage] = useState(null); @@ -145,14 +147,15 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { const handleEditButtonClick = () => { if(isUpdatingGameName && isValid) { - handleSubmit() + handleSubmit(); } else { - setIsUpdatingGameName(true) + setIsUpdatingGameName(true); } } const openAchievementModal = (achievement: IAchievement) => { - setShowModal(true) + setSelectedAchievement(achievement); + setShowModal(true); } return ( @@ -300,7 +303,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
- setShowModal(false)} /> + setShowModal(false)} selectedAchievement={selectedAchievement}/> ); }; From 7775cf42e4d4a84eb76cfc0387b29142ed9b4b93 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 16:05:21 -0300 Subject: [PATCH 10/62] Achievements modal logic to handle form --- .../AddOrEditAchievementModal.tsx | 91 ++++++++++++++----- 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx index 3477a89..1e01192 100644 --- a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx +++ b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx @@ -1,5 +1,9 @@ import { useFormik } from "formik"; import { useEffect, useState } from "react"; +import * as Yup from "yup"; +import { useParams } from "react-router-dom"; + +import { upsertAchievement } from "../../api/achievements"; import Button from "../Button"; import Checkbox from "../Checkbox"; import Modal from "../Modal"; @@ -8,25 +12,68 @@ import TextInput from "../TextInput"; interface IProps { show: boolean; onClose: () => void; + selectedAchievement?: IAchievement; +} + +interface IAchievementForm { + id?: number; + description: string; + targetValue: number; + isEnabled: boolean; } const AddOrEditAchievementModal = ({ show, onClose, + selectedAchievement, }: IProps) => { + const { gameTypeId } = useParams<{ gameTypeId: string }>(); + + const onSubmit = async (values: IAchievementForm) => { + console.log("SUBMIT!",values); + console.log("OBJECT!",selectedAchievement); + await upsertAchievement({ + ...(selectedAchievement?.id && { id: selectedAchievement?.id }), + _gameTypeId: selectedAchievement?._gameTypeId || parseInt(gameTypeId || ""), + ...(selectedAchievement?.createdAt && { createdAt: selectedAchievement?.createdAt }), + description: values.description, + targetValue: values.targetValue, + isEnabled: values.isEnabled, + updatedAt: new Date().toString(), + }); + onClose(); + } + + const validationSchema = Yup.object({ + description: Yup.string().required().label("Desctiption"), + targetValue: Yup.number().min(1).required().label("Target Value"), + }); + + const initialForm: IAchievementForm = { + description: "", + targetValue: 0, + isEnabled: true, + }; + + const { + getFieldProps, + getFieldMeta, + handleSubmit, + isValid, + setValues, + } = useFormik({ + initialValues: initialForm, + onSubmit, + validationSchema, + }); - // useEffect - // const { - // getFieldProps, - // getFieldMeta, - // handleSubmit, - // isValid, - // setValues, - // } = useFormik({ - // // initialValues: {}, - // // onSubmit, - // // validationSchema, - // }); + useEffect(() => { + setValues({ + description: selectedAchievement?.description || "", + targetValue: selectedAchievement?.targetValue || 0, + isEnabled: selectedAchievement?.isEnabled || true, + }); + }, [selectedAchievement, setValues]) return (
@@ -34,23 +81,21 @@ const AddOrEditAchievementModal = ({

Edit Achievement

-
+
@@ -60,11 +105,7 @@ const AddOrEditAchievementModal = ({ htmlFor="isEnabled" > console.log("TEST")} - value={"1"} - // label="Is Enabled" + {...getFieldProps("isEnabled")} > isEnabled @@ -72,7 +113,7 @@ const AddOrEditAchievementModal = ({
-
From 6a9e17838f1d1833d197eb0512f54d078606b0ff Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 16:05:40 -0300 Subject: [PATCH 11/62] Fixing upsert achievement endpoint --- src/api/achievements.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/achievements.ts b/src/api/achievements.ts index 27722e6..1b713f1 100644 --- a/src/api/achievements.ts +++ b/src/api/achievements.ts @@ -23,7 +23,7 @@ export const getAchievement = async (gameTypeId: number, achievementId: number) export const upsertAchievement = async (data: IAchievement) => { const axios = await getAxiosInstance(); - const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${data._gameTypeId}/achievements/${data.id}`; + const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${data._gameTypeId}/achievements`; await axios.post(endpoint, data); }; From 728d910dc84f574fc10a9ce830900d8a4488ec82 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 16:50:09 -0300 Subject: [PATCH 12/62] Removing console logs and disabling save when invalid form on achievement modal --- .../AddOrEditAchievementModal.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx index 1e01192..09a885b 100644 --- a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx +++ b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx @@ -1,5 +1,5 @@ import { useFormik } from "formik"; -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import * as Yup from "yup"; import { useParams } from "react-router-dom"; @@ -30,8 +30,6 @@ const AddOrEditAchievementModal = ({ const { gameTypeId } = useParams<{ gameTypeId: string }>(); const onSubmit = async (values: IAchievementForm) => { - console.log("SUBMIT!",values); - console.log("OBJECT!",selectedAchievement); await upsertAchievement({ ...(selectedAchievement?.id && { id: selectedAchievement?.id }), _gameTypeId: selectedAchievement?._gameTypeId || parseInt(gameTypeId || ""), @@ -78,7 +76,7 @@ const AddOrEditAchievementModal = ({ return (
-

+

Edit Achievement

@@ -112,7 +110,7 @@ const AddOrEditAchievementModal = ({ -
+
From 73823043a28b8fa1d21ec118ad32e5bf1b683ffb Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 16:50:47 -0300 Subject: [PATCH 13/62] Adding keys to lists tr tags to avoid react warnings --- src/pages/GameEditorPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index d2633cb..fd652b3 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -227,7 +227,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { {currentGameType?._leaderboards?.map( (leaderboard: ILeaderboard) => ( - + {leaderboard.id} {leaderboard.name} @@ -281,7 +281,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { Edit {achievements?.map((achievement => - + {achievement.id} {achievement.description || "-"} {achievement.isEnabled ? "✅" : "❌"} From 5cf9b19c9dc201bb1225281dcc2c50e0eea5b19d Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 17:26:37 -0300 Subject: [PATCH 14/62] Reloading achievements after updating or adding --- src/pages/GameEditorPage.tsx | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index fd652b3..cc6c23b 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -30,6 +30,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { ); const [achievements, setAchievements] = useState([]); const [isUpdatingGameName, setIsUpdatingGameName] = useState(false); + const [shouldLoadAchievements, setShouldLoadAchievements] = useState(true); const [selectedAchievement, setSelectedAchievement] = useState(); const [selectedLeaderboard, setSelectedLeaderboard] = useState(); const [showModal, setShowModal] = useState(false); @@ -95,6 +96,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { if (!gameTypeId) { return; } + console.log('WILL RELOAD!!!') const gameType = await getGameType(Number(gameTypeId)); setValues({ id: gameType.id, @@ -121,11 +123,12 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { useEffect(() => { async function fetchAchievementsData() { try { - if (!gameTypeId) { + if (!gameTypeId || !shouldLoadAchievements) { return; } const achievements = await getAchievements(Number(gameTypeId)); - setAchievements(achievements) + setAchievements(achievements); + setShouldLoadAchievements(false); return achievements; } catch (error: any) { console.log({ error }); @@ -135,7 +138,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { } fetchAchievementsData(); - }, [gameTypeId]); + }, [gameTypeId, shouldLoadAchievements]); if (errorMessage) { return
{errorMessage}
; @@ -153,11 +156,22 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { } } - const openAchievementModal = (achievement: IAchievement) => { + const openAchievementModal = (achievement?: IAchievement) => { setSelectedAchievement(achievement); setShowModal(true); } + const handleCloseAchievementModal = () => { + setSelectedAchievement(undefined); + setShowModal(false); + } + + const handlePostSubmitAchievement = () => { + setSelectedAchievement(undefined); + setShowModal(false); + setShouldLoadAchievements(true) + } + return ( <>

@@ -256,7 +270,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { Achievements

-
@@ -303,7 +317,8 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
- setShowModal(false)} selectedAchievement={selectedAchievement}/> + + {/* */} ); }; From 6e95dfd2b9523af69ed0a72e3a71c621f735c8c1 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 18:07:45 -0300 Subject: [PATCH 15/62] Updating types for Leaderboard --- src/types.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types.d.ts b/src/types.d.ts index 2210ae7..80b039f 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -23,6 +23,7 @@ interface IGameType { interface ILeaderboard { id?: number; + _gameTypeId: number; name: string; scoreStrategy: string; resetStrategy: string; From db9b049b792974ed92c1f56b4b72c59b18047043 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 18:07:58 -0300 Subject: [PATCH 16/62] Fixing leaderboard api endpoint --- src/api/leaderboards.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/leaderboards.ts b/src/api/leaderboards.ts index 5a690f6..cc51e7a 100644 --- a/src/api/leaderboards.ts +++ b/src/api/leaderboards.ts @@ -20,10 +20,10 @@ export const getLeaderboard = async (gameTypeId: number, leaderboardId: number) return game; }; -export const upsertLeaderboard = async (gameTypeId: number, data: ILeaderboard) => { +export const upsertLeaderboard = async (data: ILeaderboard) => { const axios = await getAxiosInstance(); - const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${gameTypeId}/leaderboards/${data.id}`; + const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${data._gameTypeId}/leaderboards`; await axios.post(endpoint, data); }; From 6c9e12db2e8f48c129f7f8ea58fab03171131af5 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 18:08:13 -0300 Subject: [PATCH 17/62] Creating leaderboard modal --- .../AddOrEditLeaderboardModal.tsx | 118 ++++++++++++++++++ src/ui/AddOrEditLeaderboardModal/index.tsx | 3 + 2 files changed, 121 insertions(+) create mode 100644 src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx create mode 100644 src/ui/AddOrEditLeaderboardModal/index.tsx diff --git a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx new file mode 100644 index 0000000..662fb79 --- /dev/null +++ b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx @@ -0,0 +1,118 @@ +import { useFormik } from "formik"; +import { useEffect } from "react"; +import * as Yup from "yup"; +import { useParams } from "react-router-dom"; + +import { upsertLeaderboard } from "../../api/leaderboards"; +import Button from "../Button"; +import Checkbox from "../Checkbox"; +import Modal from "../Modal"; +import TextInput from "../TextInput"; + +interface IProps { + show: boolean; + onClose: () => void; + selectedLeaderboard?: ILeaderboard; +} + +interface ILeaderboardForm { + id?: number; + name: string; + scoreStrategy: string; + resetStrategy: string; +} + +const AddOrEditLeaderboardModal = ({ + show, + onClose, + selectedLeaderboard, +}: IProps) => { + const { gameTypeId } = useParams<{ gameTypeId: string }>(); + + const onSubmit = async (values: ILeaderboardForm) => { + await upsertLeaderboard({ + ...(selectedLeaderboard?.id && { id: selectedLeaderboard?.id }), + _gameTypeId: selectedLeaderboard?._gameTypeId || parseInt(gameTypeId || ""), + name: values.name, + scoreStrategy: values.scoreStrategy, + resetStrategy: values.resetStrategy, + }); + onClose(); + } + + const validationSchema = Yup.object({ + name: Yup.string().required().label("Desctiption"), + scoreStrategy: Yup.string().required().label("Score Strategy"), + resetStrategy: Yup.string().required().label("Reset Strategy"), + }); + + const initialForm: ILeaderboardForm = { + name: "", + scoreStrategy: "reset", + resetStrategy: "weekly", + }; + + const { + getFieldProps, + getFieldMeta, + handleSubmit, + isValid, + setValues, + } = useFormik({ + initialValues: initialForm, + onSubmit, + validationSchema, + }); + + useEffect(() => { + setValues({ + name: selectedLeaderboard?.name || "", + scoreStrategy: selectedLeaderboard?.scoreStrategy || "", + resetStrategy: selectedLeaderboard?.scoreStrategy || "", + }); + }, [selectedLeaderboard, setValues]) + + return ( +
+ +

+ Edit Leaderboard +

+ +
+
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+ ); +}; + +export default AddOrEditLeaderboardModal; diff --git a/src/ui/AddOrEditLeaderboardModal/index.tsx b/src/ui/AddOrEditLeaderboardModal/index.tsx new file mode 100644 index 0000000..933943c --- /dev/null +++ b/src/ui/AddOrEditLeaderboardModal/index.tsx @@ -0,0 +1,3 @@ +import AddOrEditLeaderboardModal from "./AddOrEditLeaderboardModal"; + +export default AddOrEditLeaderboardModal; From 838611ed527aa6f634e053801627f16f4a06ed91 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 18:08:30 -0300 Subject: [PATCH 18/62] Updating game editor page to leaderboard modal logic --- src/pages/GameEditorPage.tsx | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index cc6c23b..eeb8338 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -7,6 +7,7 @@ import * as Yup from "yup"; import { getAchievements } from "../api/achievements"; import { getGameType, upsertGameType } from "../api/gamedev"; import AddOrEditAchievementModal from "../ui/AddOrEditAchievementModal"; +import AddOrEditLeaderboardModal from "../ui/AddOrEditLeaderboardModal"; import Button from "../ui/Button"; import TextInput from "../ui/TextInput"; @@ -31,9 +32,11 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { const [achievements, setAchievements] = useState([]); const [isUpdatingGameName, setIsUpdatingGameName] = useState(false); const [shouldLoadAchievements, setShouldLoadAchievements] = useState(true); + const [shouldLoadGameType, setShouldGameType] = useState(true); const [selectedAchievement, setSelectedAchievement] = useState(); const [selectedLeaderboard, setSelectedLeaderboard] = useState(); const [showModal, setShowModal] = useState(false); + const [showLeaderboardModal, setShowLeaderboardModal] = useState(false); const [errorMessage, setErrorMessage] = useState(null); const navigate = useNavigate(); @@ -93,10 +96,9 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { useEffect(() => { async function fetchGameTypeData() { try { - if (!gameTypeId) { + if (!gameTypeId || !shouldLoadGameType) { return; } - console.log('WILL RELOAD!!!') const gameType = await getGameType(Number(gameTypeId)); setValues({ id: gameType.id, @@ -109,6 +111,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { setGameType(gameType); setIsLoading(false); + setShouldGameType(false); return gameType; } catch (error: any) { console.log({ error }); @@ -118,7 +121,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { } fetchGameTypeData(); - }, [gameTypeId, setValues]); + }, [gameTypeId, setValues, shouldLoadGameType]); useEffect(() => { async function fetchAchievementsData() { @@ -161,9 +164,9 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { setShowModal(true); } - const handleCloseAchievementModal = () => { - setSelectedAchievement(undefined); - setShowModal(false); + const openLeaderboardModal = (leaderboard?: ILeaderboard) => { + setSelectedLeaderboard(leaderboard); + setShowLeaderboardModal(true); } const handlePostSubmitAchievement = () => { @@ -172,6 +175,12 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { setShouldLoadAchievements(true) } + const handlePostSubmitLeaderboard = () => { + setSelectedLeaderboard(undefined); + setShowLeaderboardModal(false); + setShouldGameType(true) + } + return ( <>

@@ -223,7 +232,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { Leaderboards

-
@@ -253,7 +262,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { - -
-
From 6cdd5218b12716aff6afd1bcb418673fbc1efa3e Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 24 Jun 2022 18:27:15 -0300 Subject: [PATCH 20/62] Updating layout for edit or add achievement modal --- .../AddOrEditAchievementModal.tsx | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx index 09a885b..d7a4df1 100644 --- a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx +++ b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx @@ -80,40 +80,40 @@ const AddOrEditAchievementModal = ({ Edit Achievement
-
-
- -
+
+
+ +
-
- -
+
+ +
-
- -
-
-
- +
+ +
+
+ +
From 8e0744fff0fb4009fb58f6c1fbc2e893ecbdf3ee Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Mon, 27 Jun 2022 09:19:04 -0300 Subject: [PATCH 21/62] Formatting leaderboard modal file with two spaces and creating an array of strategies to fill out --- .../AddOrEditLeaderboardModal.tsx | 190 +++++++++--------- src/utils/leaderboardStrategies.ts | 4 + 2 files changed, 104 insertions(+), 90 deletions(-) create mode 100644 src/utils/leaderboardStrategies.ts diff --git a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx index 8af3851..0c16557 100644 --- a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx +++ b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx @@ -8,113 +8,123 @@ import Button from "../Button"; import Modal from "../Modal"; import TextInput from "../TextInput"; import Dropdown from "../Dropdown"; +import { + resetStrategies, + scoreStrategies, +} from "../../utils/leaderboardStrategies"; interface IProps { - show: boolean; - onClose: () => void; - selectedLeaderboard?: ILeaderboard; + show: boolean; + onClose: () => void; + selectedLeaderboard?: ILeaderboard; } interface ILeaderboardForm { - id?: number; - name: string; - scoreStrategy: string; - resetStrategy: string; + id?: number; + name: string; + scoreStrategy: string; + resetStrategy: string; } const AddOrEditLeaderboardModal = ({ - show, - onClose, - selectedLeaderboard, + show, + onClose, + selectedLeaderboard, }: IProps) => { - const { gameTypeId } = useParams<{ gameTypeId: string }>(); + const { gameTypeId } = useParams<{ gameTypeId: string }>(); - const onSubmit = async (values: ILeaderboardForm) => { - await upsertLeaderboard({ - ...(selectedLeaderboard?.id && { id: selectedLeaderboard?.id }), - _gameTypeId: selectedLeaderboard?._gameTypeId || parseInt(gameTypeId || ""), - name: values.name, - scoreStrategy: values.scoreStrategy, - resetStrategy: values.resetStrategy, - }); - onClose(); - } + const onSubmit = async (values: ILeaderboardForm) => { + await upsertLeaderboard({ + ...(selectedLeaderboard?.id && { id: selectedLeaderboard?.id }), + _gameTypeId: + selectedLeaderboard?._gameTypeId || parseInt(gameTypeId || ""), + name: values.name, + scoreStrategy: values.scoreStrategy, + resetStrategy: values.resetStrategy, + }); + onClose(); + }; - const validationSchema = Yup.object({ - name: Yup.string().required().label("Desctiption"), - scoreStrategy: Yup.string().required().label("Score Strategy"), - resetStrategy: Yup.string().required().label("Reset Strategy"), - }); + const validationSchema = Yup.object({ + name: Yup.string().required().label("Desctiption"), + scoreStrategy: Yup.string().required().label("Score Strategy"), + resetStrategy: Yup.string().required().label("Reset Strategy"), + }); - const initialForm: ILeaderboardForm = { - name: "", - scoreStrategy: "highest", - resetStrategy: "weekly", - }; + const initialForm: ILeaderboardForm = { + name: "", + scoreStrategy: "highest", + resetStrategy: "weekly", + }; - const { - getFieldProps, - getFieldMeta, - handleSubmit, - isValid, - setValues, - } = useFormik({ - initialValues: initialForm, - onSubmit, - validationSchema, - }); + const { getFieldProps, getFieldMeta, handleSubmit, isValid, setValues } = + useFormik({ + initialValues: initialForm, + onSubmit, + validationSchema, + }); - useEffect(() => { - setValues({ - name: selectedLeaderboard?.name || "", - scoreStrategy: selectedLeaderboard?.scoreStrategy || "", - resetStrategy: selectedLeaderboard?.scoreStrategy || "", - }); - }, [selectedLeaderboard, setValues]) + useEffect(() => { + setValues({ + name: selectedLeaderboard?.name || "", + scoreStrategy: selectedLeaderboard?.scoreStrategy || "", + resetStrategy: selectedLeaderboard?.scoreStrategy || "", + }); + }, [selectedLeaderboard, setValues]); - return ( -
- -

- Edit Leaderboard -

-
-
-
- -
+ return ( +
+ +

+ Edit Leaderboard +

+ +
+
+ +
-
- - -
+
+ + {scoreStrategies.map((scoreStrategy) => ( + +
-
- - -
-
- -
-
- -
-
- ); +
+ + {resetStrategies.map((resetStrategy) => ( + +
+
+ +
+
+ +
+
+ ); }; export default AddOrEditLeaderboardModal; diff --git a/src/utils/leaderboardStrategies.ts b/src/utils/leaderboardStrategies.ts new file mode 100644 index 0000000..12a99e4 --- /dev/null +++ b/src/utils/leaderboardStrategies.ts @@ -0,0 +1,4 @@ + +export const scoreStrategies = ["Highest", "Lowest", "Sum", "Latest"]; + +export const resetStrategies = ["Daily", "Weekly", "Monthly", "Never" ]; \ No newline at end of file From 383a286eb487ebbb1c5dd8192e36ee823348e333 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 15:22:06 -0300 Subject: [PATCH 22/62] Updating types with leaderboard results and achievement rank --- src/types.d.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/types.d.ts b/src/types.d.ts index 80b039f..9037afe 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -27,6 +27,17 @@ interface ILeaderboard { name: string; scoreStrategy: string; resetStrategy: string; + createdAt?: string; + updatedAt?: string; +} + +interface ILeaderboardResult { + id?: number; + _leaderboardId: number; + _userId: number; + score: number; + createdAt?: string; + updatedAt?: string; } interface IAchievement { @@ -40,6 +51,16 @@ interface IAchievement { updatedAt: string; } +interface IAchievementRank { + id?: number; + _achievementId: number; + _userId: number; + rank: number; + description?: string; + createdAt?: string; + updatedAt?: string; +} + interface ITeam { id?: number; name: string; From 6413e4a037af26acf11c804d01472888fb9ae211 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 15:22:50 -0300 Subject: [PATCH 23/62] Updating leaderboard and achievements on api call to map with the correct interface --- src/api/achievements.ts | 10 ++++++++++ src/api/leaderboards.ts | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/api/achievements.ts b/src/api/achievements.ts index 1b713f1..7b17415 100644 --- a/src/api/achievements.ts +++ b/src/api/achievements.ts @@ -10,6 +10,16 @@ export const getAchievements = async (gameTypeId: number) => { return achievements; }; +export const getAchievementsProgress = async (gameTypeId: number , achievementId: number) => { + const axios = await getAxiosInstance(); + + const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${gameTypeId}/achievements/${achievementId}/progress`; + const response = await axios.get(endpoint); + const achievements = response.data as IAchievementRank[]; + + return achievements; +}; + export const getAchievement = async (gameTypeId: number, achievementId: number) => { const axios = await getAxiosInstance(); diff --git a/src/api/leaderboards.ts b/src/api/leaderboards.ts index cc51e7a..3eb72ac 100644 --- a/src/api/leaderboards.ts +++ b/src/api/leaderboards.ts @@ -15,7 +15,17 @@ export const getLeaderboard = async (gameTypeId: number, leaderboardId: number) const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${gameTypeId}/leaderboards/${leaderboardId}`; const response = await axios.get(endpoint); - const game = response.data.game as IGameType; + const game = response.data.game as ILeaderboard; + + return game; +}; + +export const getLeaderboardResults = async (gameTypeId: number, leaderboardId: number) => { + const axios = await getAxiosInstance(); + + const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${gameTypeId}/leaderboards/${leaderboardId}/results`; + const response = await axios.get(endpoint); + const game = response.data.game as ILeaderboardResult[]; return game; }; From a502c7beebb967e7a1dad1365dd5e8c585e9b4ca Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 15:23:10 -0300 Subject: [PATCH 24/62] Updating and renaming achievement results page --- src/pages/AchievementResultsPage.tsx | 73 ++++++++++++++++++++++++++++ src/pages/AchievementsPage.tsx | 33 ------------- 2 files changed, 73 insertions(+), 33 deletions(-) create mode 100644 src/pages/AchievementResultsPage.tsx delete mode 100644 src/pages/AchievementsPage.tsx diff --git a/src/pages/AchievementResultsPage.tsx b/src/pages/AchievementResultsPage.tsx new file mode 100644 index 0000000..f40f0cc --- /dev/null +++ b/src/pages/AchievementResultsPage.tsx @@ -0,0 +1,73 @@ +import { useEffect, useState } from "react"; +import { useParams } from "react-router-dom"; +import { getAchievementsProgress } from "../api/achievements"; +import Button from "../ui/Button"; + + +const AchievementResultsPage = () => { + const [achievementResults, setAchievementResults] = useState(); + const { gameTypeId, achievementId } = useParams<{ + gameTypeId: string; + achievementId: string; + }>(); + + useEffect(() => { + async function fetchAchievementProgress() { + if (!gameTypeId || !achievementId) { + return; + } + + const achievementsRes = await getAchievementsProgress( + Number(gameTypeId), + Number(achievementId) + ); + + setAchievementResults(achievementsRes); + return achievementsRes; + } + + fetchAchievementProgress(); + }, [gameTypeId, achievementId]); + + return ( +
+

ACHIEVEMENT RANK

+ + + + + + + + + + + + {achievementResults && + achievementResults?.map((achievementRank: IAchievementRank) => ( + + + + + + + ))} + +
IdDescription + Rank + Edit
{achievementRank.id}{achievementRank.description} + {achievementRank?.rank} + + +
+
+ ); +}; + +export default AchievementResultsPage; diff --git a/src/pages/AchievementsPage.tsx b/src/pages/AchievementsPage.tsx deleted file mode 100644 index c0a4b6e..0000000 --- a/src/pages/AchievementsPage.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useEffect, useState } from "react"; -import { getAchievement } from "../api/achievements"; - -const AchievementsPage =() => { - const achievement = useState(); - useEffect(() => { - async function fetchAchievement() { - const achievement = await getAchievement(1,2); // TODO GET FROM PARAM - } - - fetchAchievement(); - }, []); - - return ( -
-

- ACHIEVEMENTS -

- - {achievement ? ( - <> - - -
- - ) : ( -

Loading

- )} -
- ); -}; - -export default AchievementsPage; From 387a7faf8a6cd4d7eea1c3428e145626f5b95756 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 15:24:27 -0300 Subject: [PATCH 25/62] Updating and renaming achievement results page --- src/pages/LeaderboardRanksPage.tsx | 73 ++++++++++++++++++++++++++++++ src/pages/LeaderboardsPage.tsx | 62 ------------------------- 2 files changed, 73 insertions(+), 62 deletions(-) create mode 100644 src/pages/LeaderboardRanksPage.tsx delete mode 100644 src/pages/LeaderboardsPage.tsx diff --git a/src/pages/LeaderboardRanksPage.tsx b/src/pages/LeaderboardRanksPage.tsx new file mode 100644 index 0000000..df35eb4 --- /dev/null +++ b/src/pages/LeaderboardRanksPage.tsx @@ -0,0 +1,73 @@ +import { useEffect, useState } from "react"; +import { useParams } from "react-router-dom"; +import { + getLeaderboardResults, +} from "../api/leaderboards"; +import Button from "../ui/Button"; + +const LeaderboardsPage = () => { + const [leaderboardResults, setLeaderboardResults] = useState(); + const { gameTypeId, leaderboardId } = useParams<{ + gameTypeId: string; + leaderboardId: string; + }>(); + + useEffect(() => { + async function fetchLeaderboardResults() { + if (!gameTypeId || !leaderboardId) { + return; + } + const leaderboardsRes = await getLeaderboardResults( + Number(gameTypeId), + Number(leaderboardId) + ); // TODO GET FROM PARAM + + setLeaderboardResults(leaderboardsRes); + return leaderboardsRes; + } + + fetchLeaderboardResults(); + }, [gameTypeId, leaderboardId]); + + return ( +
+

LEADERBOARD RESULTS

+ + + + + + + + + + + + {leaderboardResults && + leaderboardResults?.map((ldr: ILeaderboardResult) => ( + + + + + + + ))} + +
idscore + User ID + Edit
{ldr.id}{ldr.score} + {ldr._userId} + + +
+
+ ); +}; + +export default LeaderboardsPage; diff --git a/src/pages/LeaderboardsPage.tsx b/src/pages/LeaderboardsPage.tsx deleted file mode 100644 index cadda0f..0000000 --- a/src/pages/LeaderboardsPage.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { useEffect, useState } from "react"; -import { getGameTypeLeaderboards } from "../api/leaderboards"; -import Button from "../ui/Button"; - -const LeaderboardsPage =() => { - const [leaderboards, setLeaderboards] = useState(); - useEffect(() => { - async function fetchLeaderboard() { - const leaderboardsRes = await getGameTypeLeaderboards(4); // TODO GET FROM PARAM - setLeaderboards(leaderboardsRes); - return leaderboardsRes; - } - - fetchLeaderboard(); - }, []); - - return ( -
-

- LEADERBOARDS -

- - - - - - - - - - {leaderboards && leaderboards?.map( - (leaderboard: ILeaderboard) => ( - - - - - - - - ))} -
idname - scoreStrategy - - resetStrategy - Edit
{leaderboard.id}{leaderboard.name} - {leaderboard.scoreStrategy} - - {leaderboard.resetStrategy} - - -
-
- ); -}; - -export default LeaderboardsPage; From 3a7109499f9e8e21f8cecd2e4d0b5840c49bacad Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 15:24:56 -0300 Subject: [PATCH 26/62] Updating app.tsx after renaming leaderboard results and achievement scores page --- src/App.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 5af3756..3bfc6b7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,6 +15,8 @@ import TowerGamePage from "./pages/TowerGamePage"; import FloorsEditorPage from "./pages/FloorsEditorPage"; import SignInPage from "./pages/SignInPage"; import HomePage from "./pages/HomePage"; +import AchievementResultsPage from "./pages/AchievementResultsPage"; +import LeaderboardRanksPage from "./pages/LeaderboardRanksPage"; // import useCurrentUser from "./hooks/useCurrentUser"; // import { SyncLoader } from "react-spinners"; @@ -22,8 +24,6 @@ import HomePage from "./pages/HomePage"; // import { UnauthorizedPage } from "./pages/UnauthorizedPage"; import { ProtectedRoute } from "./ProtectedRoute"; import { AppMenu } from "./AppMenu"; -import AchievementsPage from "./pages/AchievementsPage"; -import LeaderboardsPage from "./pages/LeaderboardsPage"; export const App = () => { // if (isDoingInitialLoading) { @@ -69,21 +69,21 @@ export const App = () => { } /> - + } /> - + } From 5de6b0ca31dcc6ebe0e5cf0e061c03cb2e38fce0 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 15:30:17 -0300 Subject: [PATCH 27/62] Updates gameEditorPage table links for achievements and leaderboard pages --- src/pages/GameEditorPage.tsx | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index eeb8338..4642f42 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -251,13 +251,17 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { {currentGameType?._leaderboards?.map( (leaderboard: ILeaderboard) => ( - {leaderboard.id} - {leaderboard.name} + + {leaderboard.id} + + + {leaderboard.name} + - {leaderboard.scoreStrategy} + {leaderboard.scoreStrategy} - {leaderboard.resetStrategy} + {leaderboard.resetStrategy}
- - - - - - - - {currentGameType?._leaderboards?.map( - (leaderboard: ILeaderboard) => ( - - - - - - - - ) - )} + + + + + + + + + + + {currentGameType && currentGameType?._leaderboards?.map( + (leaderboard: ILeaderboard) => ( + + + + + + + + ) + )} +
idname - scoreStrategy - - resetStrategy - Edit
- {leaderboard.id} - - {leaderboard.name} - - {leaderboard.scoreStrategy} - - {leaderboard.resetStrategy} - - -
idname + scoreStrategy + + resetStrategy + Edit
+ {leaderboard.id} + + {leaderboard.name} + + {leaderboard.scoreStrategy} + + {leaderboard.resetStrategy} + + +
@@ -288,27 +292,30 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { - - - - - - - - - - {achievements?.map((achievement => - + + + + + + + + + + + + + {achievements && achievements?.map((achievement => + @@ -336,14 +343,14 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { Edit - ))} +
id - Description - - isEnabled - - targetValue - - createdAt - - updatedAt - Edit
id + Description + + isEnabled + + targetValue + + createdAt + + updatedAt + Edit
{achievement.id}
- - + {showModal && } + {showLeaderboardModal && } ); }; From 1f9603e15469834ceb97c0eef55b6543a7f8fd37 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 20:40:33 -0300 Subject: [PATCH 29/62] Layout improvements on ListGamesPage --- src/pages/ListGamesPage.tsx | 39 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/pages/ListGamesPage.tsx b/src/pages/ListGamesPage.tsx index edb1766..6ff98f6 100644 --- a/src/pages/ListGamesPage.tsx +++ b/src/pages/ListGamesPage.tsx @@ -65,44 +65,35 @@ const ListGamesPage = function ListGamesPage(props: any) { {isLoading ? ( ) : ( -
+
{games.map((game: IGameType, index: number) => ( - <> -
- +
+
-
+
{game.name}
- - - - - - - + - - - - - - -
+
+
CLIENT SECRET -
+ +
{game.clientSecret.substring(0, maxKeyDisplayLength)} ... -
+
SIGNING SECRET -
+ +
{game.signingSecret.substring(0, maxKeyDisplayLength)} ... -
+
+
-
- ))}
)} From e4519e80798d83c7b37d97409d874f3b6b58add6 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 20:41:29 -0300 Subject: [PATCH 30/62] Layout and behavior improvements and warning fixes on achievements and leaderboard modals --- .../AddOrEditAchievementModal.tsx | 6 ++-- .../AddOrEditLeaderboardModal.tsx | 32 ++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx index d7a4df1..557fcea 100644 --- a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx +++ b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx @@ -77,7 +77,7 @@ const AddOrEditAchievementModal = ({

- Edit Achievement + {selectedAchievement?.id ? 'Edit' : 'New'} Achievement

@@ -86,6 +86,7 @@ const AddOrEditAchievementModal = ({ label="Description" {...getFieldProps("description")} {...getFieldMeta("description")} + fullWidth />
@@ -94,6 +95,7 @@ const AddOrEditAchievementModal = ({ label="Target Value" {...getFieldProps("targetValue")} {...getFieldMeta("targetValue")} + fullWidth />
@@ -110,7 +112,7 @@ const AddOrEditAchievementModal = ({
-
diff --git a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx index 0c16557..e71d74d 100644 --- a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx +++ b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx @@ -39,8 +39,8 @@ const AddOrEditLeaderboardModal = ({ _gameTypeId: selectedLeaderboard?._gameTypeId || parseInt(gameTypeId || ""), name: values.name, - scoreStrategy: values.scoreStrategy, - resetStrategy: values.resetStrategy, + scoreStrategy: values.scoreStrategy.toLowerCase(), + resetStrategy: values.resetStrategy.toLowerCase(), }); onClose(); }; @@ -53,8 +53,8 @@ const AddOrEditLeaderboardModal = ({ const initialForm: ILeaderboardForm = { name: "", - scoreStrategy: "highest", - resetStrategy: "weekly", + scoreStrategy: "Highest", + resetStrategy: "Daily", }; const { getFieldProps, getFieldMeta, handleSubmit, isValid, setValues } = @@ -67,8 +67,8 @@ const AddOrEditLeaderboardModal = ({ useEffect(() => { setValues({ name: selectedLeaderboard?.name || "", - scoreStrategy: selectedLeaderboard?.scoreStrategy || "", - resetStrategy: selectedLeaderboard?.scoreStrategy || "", + scoreStrategy: selectedLeaderboard?.scoreStrategy || "Highest", + resetStrategy: selectedLeaderboard?.resetStrategy || "Daily", }); }, [selectedLeaderboard, setValues]); @@ -76,11 +76,10 @@ const AddOrEditLeaderboardModal = ({

- Edit Leaderboard + { selectedLeaderboard?.id ? 'Edit' : 'New'} Leaderboard

- -
-
+ +
-
+
{scoreStrategies.map((scoreStrategy) => (
-
+
{resetStrategies.map((resetStrategy) => (
-
-
-
From aa45ea2af03133cc134c8efaaae71319e3ddaec2 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 29 Jun 2022 20:41:49 -0300 Subject: [PATCH 31/62] Adding w-full prop to base ui components --- src/ui/Button/Button.tsx | 5 +++-- src/ui/Dropdown/Dropdown.tsx | 5 ++++- src/ui/TextInput/TextInput.tsx | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ui/Button/Button.tsx b/src/ui/Button/Button.tsx index c9bd463..e9ff503 100644 --- a/src/ui/Button/Button.tsx +++ b/src/ui/Button/Button.tsx @@ -3,14 +3,15 @@ interface IProps { disabled?: boolean; onClick?: () => void; type?: "button" | "submit" | "reset" | undefined; + fullWidth?: boolean; } const calculateClasses = (props: IProps) => { if (props.disabled) { - return "bg-gray-100 text-sm text-gray-400 py-1.5 px-5 rounded-sm cursor-not-allowed"; + return `bg-gray-100 text-sm text-gray-400 py-1.5 px-5 rounded-sm cursor-not-allowed ${props.fullWidth ? "w-full" : ""}`; } - return "bg-xteamaccent text-sm text-white py-1.5 px-5 rounded-sm"; + return `bg-xteamaccent text-sm text-white py-1.5 px-5 rounded-sm ${props.fullWidth ? "w-full" : ""}`; }; export default function Button(props: IProps) { diff --git a/src/ui/Dropdown/Dropdown.tsx b/src/ui/Dropdown/Dropdown.tsx index a1dc15e..15e0210 100644 --- a/src/ui/Dropdown/Dropdown.tsx +++ b/src/ui/Dropdown/Dropdown.tsx @@ -5,6 +5,7 @@ interface IProps { label: string; hasErrors?: boolean; touched?: boolean; + fullWidth?: boolean; children?: React.ReactNode; } @@ -13,6 +14,7 @@ function TextInput({ fieldProps, label, children, + fullWidth, hasErrors, touched, }: IProps) { @@ -26,7 +28,8 @@ function TextInput({ diff --git a/src/ui/TextInput/TextInput.tsx b/src/ui/TextInput/TextInput.tsx index 86038ac..ee598d0 100644 --- a/src/ui/TextInput/TextInput.tsx +++ b/src/ui/TextInput/TextInput.tsx @@ -6,6 +6,7 @@ interface IProps { type?: "text" | "number" | "password"; extraClass?: string; helperText?: string; + fullWidth?: boolean; } const renderInputError = (error?: string, touched?: boolean) => { @@ -23,7 +24,7 @@ function TextInput({ type, label, extraClass, - + fullWidth, ...props }: IProps) { const calculateColors = () => { @@ -54,7 +55,7 @@ function TextInput({ From 24717256fba4aa0acaeab6382c9f4a245409b8c3 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 13:39:04 -0300 Subject: [PATCH 32/62] Removing outdated comment and removing edit column from leaderboardranks and achievementresults page --- src/pages/AchievementResultsPage.tsx | 10 ---------- src/pages/LeaderboardRanksPage.tsx | 8 ++++---- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/pages/AchievementResultsPage.tsx b/src/pages/AchievementResultsPage.tsx index f40f0cc..3285bce 100644 --- a/src/pages/AchievementResultsPage.tsx +++ b/src/pages/AchievementResultsPage.tsx @@ -41,7 +41,6 @@ const AchievementResultsPage = () => { Rank - Edit @@ -53,15 +52,6 @@ const AchievementResultsPage = () => { {achievementRank?.rank} - - - ))} diff --git a/src/pages/LeaderboardRanksPage.tsx b/src/pages/LeaderboardRanksPage.tsx index df35eb4..08a5e16 100644 --- a/src/pages/LeaderboardRanksPage.tsx +++ b/src/pages/LeaderboardRanksPage.tsx @@ -20,7 +20,7 @@ const LeaderboardsPage = () => { const leaderboardsRes = await getLeaderboardResults( Number(gameTypeId), Number(leaderboardId) - ); // TODO GET FROM PARAM + ); setLeaderboardResults(leaderboardsRes); return leaderboardsRes; @@ -41,7 +41,7 @@ const LeaderboardsPage = () => { User ID - Edit + Meta @@ -56,10 +56,10 @@ const LeaderboardsPage = () => { From da34f4f15c29f5a3ac7ec4df335a1470ca4a7cbf Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 15:30:14 -0300 Subject: [PATCH 33/62] Updating and fixing types with achievementUnlocked and LeaderboardResult --- src/types.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/types.d.ts b/src/types.d.ts index 9037afe..d6ff566 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -34,7 +34,8 @@ interface ILeaderboard { interface ILeaderboardResult { id?: number; _leaderboardId: number; - _userId: number; + _userId?: number; + _user?: IUser; score: number; createdAt?: string; updatedAt?: string; @@ -51,12 +52,11 @@ interface IAchievement { updatedAt: string; } -interface IAchievementRank { - id?: number; +interface IAchievementUnlocked { _achievementId: number; _userId: number; - rank: number; - description?: string; + _user?: IUser; + progress: number; createdAt?: string; updatedAt?: string; } From e04ad62f6587d17e9f368f23fcb784995dc37beb Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 15:30:48 -0300 Subject: [PATCH 34/62] Tweaks on API calls for achievements and leaderboards --- src/api/achievements.ts | 4 ++-- src/api/leaderboards.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/achievements.ts b/src/api/achievements.ts index 7b17415..48f4e7d 100644 --- a/src/api/achievements.ts +++ b/src/api/achievements.ts @@ -15,7 +15,7 @@ export const getAchievementsProgress = async (gameTypeId: number , achievementId const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${gameTypeId}/achievements/${achievementId}/progress`; const response = await axios.get(endpoint); - const achievements = response.data as IAchievementRank[]; + const achievements = response.data as IAchievementUnlocked[]; return achievements; }; @@ -25,7 +25,7 @@ export const getAchievement = async (gameTypeId: number, achievementId: number) const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${gameTypeId}/achievements/${achievementId}`; const response = await axios.get(endpoint); - const acheivement = response.data.game as IGameType; + const acheivement = response.data as IAchievementUnlocked[]; return acheivement; }; diff --git a/src/api/leaderboards.ts b/src/api/leaderboards.ts index 3eb72ac..6c157e1 100644 --- a/src/api/leaderboards.ts +++ b/src/api/leaderboards.ts @@ -25,7 +25,7 @@ export const getLeaderboardResults = async (gameTypeId: number, leaderboardId: n const endpoint = gamesHqUrl + `/dashboard/game-dev/games/${gameTypeId}/leaderboards/${leaderboardId}/results`; const response = await axios.get(endpoint); - const game = response.data.game as ILeaderboardResult[]; + const game = response.data as ILeaderboardResult[]; return game; }; From 2d8d64b60817a9045ce5ee9d03c7af916448a765 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 15:31:22 -0300 Subject: [PATCH 35/62] Tweaks on achievements and leaderboards drilldown pages, fixing types and columns --- src/pages/AchievementResultsPage.tsx | 17 ++++++++--------- src/pages/LeaderboardRanksPage.tsx | 5 +++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/AchievementResultsPage.tsx b/src/pages/AchievementResultsPage.tsx index 3285bce..ccf22c3 100644 --- a/src/pages/AchievementResultsPage.tsx +++ b/src/pages/AchievementResultsPage.tsx @@ -1,11 +1,10 @@ import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { getAchievementsProgress } from "../api/achievements"; -import Button from "../ui/Button"; const AchievementResultsPage = () => { - const [achievementResults, setAchievementResults] = useState(); + const [achievementResults, setAchievementResults] = useState(); const { gameTypeId, achievementId } = useParams<{ gameTypeId: string; achievementId: string; @@ -36,8 +35,7 @@ const AchievementResultsPage = () => { - - + @@ -45,12 +43,13 @@ const AchievementResultsPage = () => { {achievementResults && - achievementResults?.map((achievementRank: IAchievementRank) => ( - - - + achievementResults?.map((achievementRank: IAchievementUnlocked, index) => ( + // Despite it's not a good practice using index as a key, it's the only way + // to certify key is unique for every row, since AchievementUnlocked table won't have an id. + + ))} diff --git a/src/pages/LeaderboardRanksPage.tsx b/src/pages/LeaderboardRanksPage.tsx index 08a5e16..90bf6bd 100644 --- a/src/pages/LeaderboardRanksPage.tsx +++ b/src/pages/LeaderboardRanksPage.tsx @@ -17,6 +17,7 @@ const LeaderboardsPage = () => { if (!gameTypeId || !leaderboardId) { return; } + const leaderboardsRes = await getLeaderboardResults( Number(gameTypeId), Number(leaderboardId) @@ -39,7 +40,7 @@ const LeaderboardsPage = () => { @@ -51,7 +52,7 @@ const LeaderboardsPage = () => { {currentGameType && currentGameType?._leaderboards?.map( (leaderboard: ILeaderboard) => ( - + @@ -315,7 +315,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { {achievements && achievements?.map((achievement => - + From 466eb32b7e822eee487d790d3cca47f1adcdbfdc Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 16:14:56 -0300 Subject: [PATCH 37/62] Adding a back button to achievement results page --- src/pages/AchievementResultsPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/AchievementResultsPage.tsx b/src/pages/AchievementResultsPage.tsx index ccf22c3..e8ce980 100644 --- a/src/pages/AchievementResultsPage.tsx +++ b/src/pages/AchievementResultsPage.tsx @@ -1,10 +1,12 @@ import { useEffect, useState } from "react"; -import { useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import { getAchievementsProgress } from "../api/achievements"; +import Button from "../ui/Button"; const AchievementResultsPage = () => { const [achievementResults, setAchievementResults] = useState(); + const navigate = useNavigate(); const { gameTypeId, achievementId } = useParams<{ gameTypeId: string; achievementId: string; @@ -32,7 +34,7 @@ const AchievementResultsPage = () => {

ACHIEVEMENT RANK

-
IdDescriptionUser Rank
{achievementRank.id}{achievementRank.description}
{achievementRank._user?.email} - {achievementRank?.rank} + {achievementRank?.progress}
id score - User ID + User Meta
{ldr.id} {ldr.score} - {ldr._userId} + {ldr._user?.email}
{leaderboard.id}
{achievement.id}
+
@@ -55,6 +57,7 @@ const AchievementResultsPage = () => { ))}
User
+
); }; From 19c922610a2b29c2d2314b65abdb2258e364a6f4 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 16:15:25 -0300 Subject: [PATCH 38/62] Improving style from tables and ux on selecting a row to drill down --- src/pages/GameEditorPage.tsx | 47 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index b1cb128..e9e63ee 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -1,6 +1,5 @@ import { FormikHelpers, useFormik } from "formik"; import { useEffect, useState } from "react"; -import { Link } from "react-router-dom"; import { useParams, useNavigate } from "react-router-dom"; import { SyncLoader } from "react-spinners"; import * as Yup from "yup"; @@ -253,20 +252,20 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { {currentGameType && currentGameType?._leaderboards?.map( (leaderboard: ILeaderboard) => ( - - - {leaderboard.id} + + navigate(`/games/${gameTypeId}/leaderboards/${leaderboard.id}`)}> + {leaderboard.id} - - {leaderboard.name} + navigate(`/games/${gameTypeId}/leaderboards/${leaderboard.id}`)}> + {leaderboard.name} - - {leaderboard.scoreStrategy} + navigate(`/games/${gameTypeId}/leaderboards/${leaderboard.id}`)}> + {leaderboard.scoreStrategy} - - {leaderboard.resetStrategy} + navigate(`/games/${gameTypeId}/leaderboards/${leaderboard.id}`)}> + {leaderboard.resetStrategy} - + navigate(`/games/${gameTypeId}/leaderboards/${leaderboard.id}`)}> ); }; From 0126289a4cbd99df40717245603421451fd92a84 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 16:53:07 -0300 Subject: [PATCH 40/62] Adding meta type on leaderboardranks --- src/types.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/types.d.ts b/src/types.d.ts index d6ff566..3535b63 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -37,10 +37,16 @@ interface ILeaderboardResult { _userId?: number; _user?: IUser; score: number; + _leaderboardResultsMeta?: ILeaderboardResultMeta[] createdAt?: string; updatedAt?: string; } +interface ILeaderboardResultMeta { + attribute?: string; + value?: string; +} + interface IAchievement { id?: number; _gameTypeId: number; From c2d0018c73eea0e17d2cbd8db86aa1aaf45579f9 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 30 Jun 2022 17:31:45 -0300 Subject: [PATCH 41/62] Small tweaks and adjustments on leaderboard page and click event --- src/pages/GameEditorPage.tsx | 2 +- src/pages/LeaderboardRanksPage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index e9e63ee..f31403e 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -265,7 +265,7 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { navigate(`/games/${gameTypeId}/leaderboards/${leaderboard.id}`)}> {leaderboard.resetStrategy} - navigate(`/games/${gameTypeId}/leaderboards/${leaderboard.id}`)}> + - +
+ +
+
+
diff --git a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx index e71d74d..e9c7e6b 100644 --- a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx +++ b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx @@ -78,12 +78,13 @@ const AddOrEditLeaderboardModal = ({

{ selectedLeaderboard?.id ? 'Edit' : 'New'} Leaderboard

-
+
From 441a14b5011c78d6856dc22ae32529ab746577ed Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 1 Jul 2022 15:54:47 -0300 Subject: [PATCH 44/62] Adding copy to clipboard button to secrets on edit game page --- src/pages/GameEditorPage.tsx | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index f5e9096..f0760d9 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -3,6 +3,8 @@ import { useEffect, useState } from "react"; import { useParams, useNavigate } from "react-router-dom"; import { SyncLoader } from "react-spinners"; import * as Yup from "yup"; +import { AiOutlineCheck, AiOutlineClose, AiOutlineCopy } from "react-icons/ai"; + import { getAchievements } from "../api/achievements"; import { getGameType, upsertGameType } from "../api/gamedev"; import AddOrEditAchievementModal from "../ui/AddOrEditAchievementModal"; @@ -36,6 +38,8 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { const [selectedLeaderboard, setSelectedLeaderboard] = useState(); const [showModal, setShowModal] = useState(false); const [showLeaderboardModal, setShowLeaderboardModal] = useState(false); + const [hasCopiedSigninSecret, setHasCopiedSigninSecret] = useState(false); + const [hasCopiedClientSecret, setHasCopiedClientSecret] = useState(false); const [errorMessage, setErrorMessage] = useState(null); const navigate = useNavigate(); @@ -180,6 +184,16 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { setShouldGameType(true) } + const handleCopyBtnClickSigningSecret = (value?: string) => { + navigator.clipboard.writeText(value ?? ""); + setHasCopiedSigninSecret(true); + } + + const handleCopyBtnClickClientSecret = (value?: string) => { + navigator.clipboard.writeText(value ?? ""); + setHasCopiedClientSecret(true); + } + return ( <>

@@ -209,13 +223,20 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
Client Secret - {currentGameType?.clientSecret} + {/* {currentGameType?.clientSecret} */} +
+ {currentGameType?.clientSecret} + handleCopyBtnClickClientSecret(currentGameType?.clientSecret)}>{hasCopiedClientSecret ? : } +
Signing Secret - {currentGameType?.signingSecret} +
+ {currentGameType?.signingSecret} + handleCopyBtnClickSigningSecret(currentGameType?.signingSecret)}>{hasCopiedSigninSecret ? : } +
@@ -321,8 +342,8 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { navigate(`/games/${gameTypeId}/achievements/${achievement.id}`)}> {achievement.description || "-"} - navigate(`/games/${gameTypeId}/achievements/${achievement.id}`)}> - {achievement.isEnabled ? "✅" : "❌"} + navigate(`/games/${gameTypeId}/achievements/${achievement.id}`)}> + {achievement.isEnabled ? : } navigate(`/games/${gameTypeId}/achievements/${achievement.id}`)}> {achievement.targetValue || "-"} From b1baf3968697d2c7da30e2b8a871518c05b5f600 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 1 Jul 2022 15:55:05 -0300 Subject: [PATCH 45/62] Adding rect-icons to the project --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c195213..59ab7cc 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "react": "17.0.2", "react-dom": "17.0.2", "react-firebaseui": "6.0.0", + "react-icons": "^4.4.0", "react-router-dom": "6.3.0", "react-scripts": "5.0.1", "react-spinners": "0.12.0", From f1dd0ca5a668f5327bde62a2ca5c8d38bcc4f910 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 1 Jul 2022 15:55:20 -0300 Subject: [PATCH 46/62] Package lock --- package-lock.json | 607 +++++++++++++++++++++++++--------------------- 1 file changed, 325 insertions(+), 282 deletions(-) diff --git a/package-lock.json b/package-lock.json index f63493c..4889917 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "react": "17.0.2", "react-dom": "17.0.2", "react-firebaseui": "6.0.0", + "react-icons": "^4.4.0", "react-router-dom": "6.3.0", "react-scripts": "5.0.1", "react-spinners": "0.12.0", @@ -2390,6 +2391,21 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -2420,6 +2436,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -4880,13 +4901,13 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "dependencies": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" }, "funding": { @@ -4910,34 +4931,6 @@ } } }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -5339,6 +5332,34 @@ "webpack": ">=2" } }, + "node_modules/babel-loader/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/babel-loader/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/babel-loader/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/babel-loader/node_modules/schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -6416,21 +6437,6 @@ } } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/css-minimizer-webpack-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -6442,11 +6448,6 @@ "ajv": "^8.8.2" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/css-minimizer-webpack-plugin/node_modules/schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -7858,6 +7859,21 @@ "webpack": "^5.0.0" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/eslint/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -7903,6 +7919,11 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -8459,6 +8480,29 @@ } } }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -8511,6 +8555,11 @@ "node": ">=10" } }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/schema-utils": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", @@ -10927,9 +10976,9 @@ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -11362,21 +11411,6 @@ "webpack": "^5.0.0" } }, - "node_modules/mini-css-extract-plugin/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/mini-css-extract-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -11388,11 +11422,6 @@ "ajv": "^8.8.2" } }, - "node_modules/mini-css-extract-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -13683,6 +13712,14 @@ "react": ">=15 <=17" } }, + "node_modules/react-icons": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.4.0.tgz", + "integrity": "sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -14430,6 +14467,34 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -15955,21 +16020,6 @@ "webpack": "^4.0.0 || ^5.0.0" } }, - "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -15986,11 +16036,6 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" }, - "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -16059,21 +16104,6 @@ } } }, - "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/webpack-dev-server/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -16090,11 +16120,6 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" }, - "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/webpack-dev-server/node_modules/schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -16366,21 +16391,6 @@ "node": ">=10.0.0" } }, - "node_modules/workbox-build/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/workbox-build/node_modules/fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -16395,11 +16405,6 @@ "node": ">=10" } }, - "node_modules/workbox-build/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/workbox-build/node_modules/source-map": { "version": "0.8.0-beta.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", @@ -18172,12 +18177,14 @@ "@csstools/postcss-unset-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@csstools/postcss-unset-value/-/postcss-unset-value-1.0.1.tgz", - "integrity": "sha512-f1G1WGDXEU/RN1TWAxBPQgQudtLnLQPyiWdtypkPC+mVYNKFKH/HYXSxH4MVNqwF8M0eDsoiU7HumJHCg/L/jg==" + "integrity": "sha512-f1G1WGDXEU/RN1TWAxBPQgQudtLnLQPyiWdtypkPC+mVYNKFKH/HYXSxH4MVNqwF8M0eDsoiU7HumJHCg/L/jg==", + "requires": {} }, "@csstools/selector-specificity": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-2.0.1.tgz", - "integrity": "sha512-aG20vknL4/YjQF9BSV7ts4EWm/yrjagAN7OWBNmlbEOUiu0llj4OGrFoOKK3g2vey4/p2omKCoHrWtPxSwV3HA==" + "integrity": "sha512-aG20vknL4/YjQF9BSV7ts4EWm/yrjagAN7OWBNmlbEOUiu0llj4OGrFoOKK3g2vey4/p2omKCoHrWtPxSwV3HA==", + "requires": {} }, "@emotion/babel-plugin": { "version": "11.9.2", @@ -18311,6 +18318,17 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -18332,6 +18350,11 @@ "argparse": "^2.0.1" } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -18461,12 +18484,14 @@ "@firebase/auth-interop-types": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.1.6.tgz", - "integrity": "sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==" + "integrity": "sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==", + "requires": {} }, "@firebase/auth-types": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.11.0.tgz", - "integrity": "sha512-q7Bt6cx+ySj9elQHTsKulwk3+qDezhzRBFC9zlQ1BjgMueUOnGMcvqmU0zuKlQ4RhLSH7MNAdBV2znVaoN3Vxw==" + "integrity": "sha512-q7Bt6cx+ySj9elQHTsKulwk3+qDezhzRBFC9zlQ1BjgMueUOnGMcvqmU0zuKlQ4RhLSH7MNAdBV2znVaoN3Vxw==", + "requires": {} }, "@firebase/component": { "version": "0.5.15", @@ -18542,7 +18567,8 @@ "@firebase/firestore-types": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-2.5.0.tgz", - "integrity": "sha512-I6c2m1zUhZ5SH0cWPmINabDyH5w0PPFHk2UHsjBpKdZllzJZ2TwTkXbDtpHUZNmnc/zAa0WNMNMvcvbb/xJLKA==" + "integrity": "sha512-I6c2m1zUhZ5SH0cWPmINabDyH5w0PPFHk2UHsjBpKdZllzJZ2TwTkXbDtpHUZNmnc/zAa0WNMNMvcvbb/xJLKA==", + "requires": {} }, "@firebase/functions": { "version": "0.8.2", @@ -18719,7 +18745,8 @@ "@firebase/storage-types": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.6.0.tgz", - "integrity": "sha512-1LpWhcCb1ftpkP/akhzjzeFxgVefs6eMD2QeKiJJUGH1qOiows2w5o0sKCUSQrvrRQS1lz3SFGvNR1Ck/gqxeA==" + "integrity": "sha512-1LpWhcCb1ftpkP/akhzjzeFxgVefs6eMD2QeKiJJUGH1qOiows2w5o0sKCUSQrvrRQS1lz3SFGvNR1Ck/gqxeA==", + "requires": {} }, "@firebase/util": { "version": "1.6.1", @@ -19517,7 +19544,8 @@ "@testing-library/user-event": { "version": "14.2.0", "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.2.0.tgz", - "integrity": "sha512-+hIlG4nJS6ivZrKnOP7OGsDu9Fxmryj9vCl8x0ZINtTJcCHs2zLsYif5GzuRiBF2ck5GZG2aQr7Msg+EHlnYVQ==" + "integrity": "sha512-+hIlG4nJS6ivZrKnOP7OGsDu9Fxmryj9vCl8x0ZINtTJcCHs2zLsYif5GzuRiBF2ck5GZG2aQr7Msg+EHlnYVQ==", + "requires": {} }, "@tootallnate/once": { "version": "1.1.2", @@ -20204,12 +20232,14 @@ "acorn-import-assertions": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==" + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "requires": {} }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==" + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "requires": {} }, "acorn-node": { "version": "1.8.2", @@ -20256,13 +20286,13 @@ } }, "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "requires": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" } }, @@ -20272,31 +20302,8 @@ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "requires": { "ajv": "^8.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - } } }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==" - }, "ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -20587,6 +20594,28 @@ "schema-utils": "^2.6.5" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "requires": {} + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -20643,7 +20672,8 @@ "babel-plugin-named-asset-import": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.8.tgz", - "integrity": "sha512-WXiAc++qo7XcJ1ZnTYGtLxmBCVbddAml3CEXgWaBzNzLNoxtQ8AiGEFDMOhot9XjTCQbvP5E77Fj9Gk924f00Q==" + "integrity": "sha512-WXiAc++qo7XcJ1ZnTYGtLxmBCVbddAml3CEXgWaBzNzLNoxtQ8AiGEFDMOhot9XjTCQbvP5E77Fj9Gk924f00Q==", + "requires": {} }, "babel-plugin-polyfill-corejs2": { "version": "0.3.1", @@ -21338,7 +21368,8 @@ "css-declaration-sorter": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.3.0.tgz", - "integrity": "sha512-OGT677UGHJTAVMRhPO+HJ4oKln3wkBTwtDFH0ojbqm+MJm6xuDMHp2nkhh/ThaBqq20IbraBQSWKfSLNHQO9Og==" + "integrity": "sha512-OGT677UGHJTAVMRhPO+HJ4oKln3wkBTwtDFH0ojbqm+MJm6xuDMHp2nkhh/ThaBqq20IbraBQSWKfSLNHQO9Og==", + "requires": {} }, "css-has-pseudo": { "version": "3.0.4", @@ -21376,17 +21407,6 @@ "source-map": "^0.6.1" }, "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -21395,11 +21415,6 @@ "fast-deep-equal": "^3.1.3" } }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -21416,7 +21431,8 @@ "css-prefers-color-scheme": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-6.0.3.tgz", - "integrity": "sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==" + "integrity": "sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==", + "requires": {} }, "css-select": { "version": "4.3.0", @@ -21518,7 +21534,8 @@ "cssnano-utils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz", - "integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==" + "integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==", + "requires": {} }, "csso": { "version": "4.2.0", @@ -22174,6 +22191,17 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -22204,6 +22232,11 @@ "argparse": "^2.0.1" } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -22451,7 +22484,8 @@ "eslint-plugin-react-hooks": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", - "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==" + "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", + "requires": {} }, "eslint-plugin-testing-library": { "version": "5.5.1", @@ -22914,6 +22948,23 @@ "tapable": "^1.0.0" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "requires": {} + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -22951,6 +23002,11 @@ "universalify": "^2.0.0" } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "schema-utils": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz", @@ -23415,7 +23471,8 @@ "icss-utils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", - "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==" + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "requires": {} }, "idb": { "version": "7.0.1", @@ -24127,7 +24184,8 @@ "jest-pnp-resolver": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==" + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "requires": {} }, "jest-regex-util": { "version": "27.5.1", @@ -24703,9 +24761,9 @@ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -25032,17 +25090,6 @@ "schema-utils": "^4.0.0" }, "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -25051,11 +25098,6 @@ "fast-deep-equal": "^3.1.3" } }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -25595,7 +25637,8 @@ "postcss-browser-comments": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-browser-comments/-/postcss-browser-comments-4.0.0.tgz", - "integrity": "sha512-X9X9/WN3KIvY9+hNERUqX9gncsgBA25XaeR+jshHz2j8+sYyHktHw1JdKuMjeLpGktXidqDhA7b/qm1mrBDmgg==" + "integrity": "sha512-X9X9/WN3KIvY9+hNERUqX9gncsgBA25XaeR+jshHz2j8+sYyHktHw1JdKuMjeLpGktXidqDhA7b/qm1mrBDmgg==", + "requires": {} }, "postcss-calc": { "version": "8.2.4", @@ -25693,22 +25736,26 @@ "postcss-discard-comments": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz", - "integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==" + "integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==", + "requires": {} }, "postcss-discard-duplicates": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz", - "integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==" + "integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==", + "requires": {} }, "postcss-discard-empty": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz", - "integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==" + "integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==", + "requires": {} }, "postcss-discard-overridden": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz", - "integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==" + "integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==", + "requires": {} }, "postcss-double-position-gradients": { "version": "3.1.1", @@ -25730,7 +25777,8 @@ "postcss-flexbugs-fixes": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-5.0.2.tgz", - "integrity": "sha512-18f9voByak7bTktR2QgDveglpn9DTbBWPUzSOe9g0N4WR/2eSt6Vrcbf0hmspvMI6YWGywz6B9f7jzpFNJJgnQ==" + "integrity": "sha512-18f9voByak7bTktR2QgDveglpn9DTbBWPUzSOe9g0N4WR/2eSt6Vrcbf0hmspvMI6YWGywz6B9f7jzpFNJJgnQ==", + "requires": {} }, "postcss-focus-visible": { "version": "6.0.4", @@ -25751,12 +25799,14 @@ "postcss-font-variant": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-5.0.0.tgz", - "integrity": "sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==" + "integrity": "sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==", + "requires": {} }, "postcss-gap-properties": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/postcss-gap-properties/-/postcss-gap-properties-3.0.3.tgz", - "integrity": "sha512-rPPZRLPmEKgLk/KlXMqRaNkYTUpE7YC+bOIQFN5xcu1Vp11Y4faIXv6/Jpft6FMnl6YRxZqDZG0qQOW80stzxQ==" + "integrity": "sha512-rPPZRLPmEKgLk/KlXMqRaNkYTUpE7YC+bOIQFN5xcu1Vp11Y4faIXv6/Jpft6FMnl6YRxZqDZG0qQOW80stzxQ==", + "requires": {} }, "postcss-image-set-function": { "version": "4.0.6", @@ -25779,7 +25829,8 @@ "postcss-initial": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-4.0.1.tgz", - "integrity": "sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==" + "integrity": "sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==", + "requires": {} }, "postcss-js": { "version": "4.0.0", @@ -25821,12 +25872,14 @@ "postcss-logical": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/postcss-logical/-/postcss-logical-5.0.4.tgz", - "integrity": "sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g==" + "integrity": "sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g==", + "requires": {} }, "postcss-media-minmax": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/postcss-media-minmax/-/postcss-media-minmax-5.0.0.tgz", - "integrity": "sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==" + "integrity": "sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==", + "requires": {} }, "postcss-merge-longhand": { "version": "5.1.5", @@ -25887,7 +25940,8 @@ "postcss-modules-extract-imports": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", - "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==" + "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", + "requires": {} }, "postcss-modules-local-by-default": { "version": "4.0.0", @@ -25945,7 +25999,8 @@ "postcss-normalize-charset": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz", - "integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==" + "integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==", + "requires": {} }, "postcss-normalize-display-values": { "version": "5.1.0", @@ -26030,12 +26085,14 @@ "postcss-overflow-shorthand": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/postcss-overflow-shorthand/-/postcss-overflow-shorthand-3.0.3.tgz", - "integrity": "sha512-CxZwoWup9KXzQeeIxtgOciQ00tDtnylYIlJBBODqkgS/PU2jISuWOL/mYLHmZb9ZhZiCaNKsCRiLp22dZUtNsg==" + "integrity": "sha512-CxZwoWup9KXzQeeIxtgOciQ00tDtnylYIlJBBODqkgS/PU2jISuWOL/mYLHmZb9ZhZiCaNKsCRiLp22dZUtNsg==", + "requires": {} }, "postcss-page-break": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/postcss-page-break/-/postcss-page-break-3.0.4.tgz", - "integrity": "sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==" + "integrity": "sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==", + "requires": {} }, "postcss-place": { "version": "7.0.4", @@ -26142,7 +26199,8 @@ "postcss-replace-overflow-wrap": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-4.0.0.tgz", - "integrity": "sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==" + "integrity": "sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==", + "requires": {} }, "postcss-selector-not": { "version": "6.0.0", @@ -26526,6 +26584,12 @@ "firebaseui": "^6.0.0" } }, + "react-icons": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.4.0.tgz", + "integrity": "sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg==", + "requires": {} + }, "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -27061,6 +27125,30 @@ "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "requires": {} + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + } } }, "select-hose": { @@ -27521,7 +27609,8 @@ "style-loader": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.1.tgz", - "integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==" + "integrity": "sha512-GPcQ+LDJbrcxHORTRes6Jy2sfvK2kS6hpSfI/fXhPt+spVzxF6LJ1dHLN9zIGmVaaP044YKaIatFaufENRiDoQ==", + "requires": {} }, "stylehacks": { "version": "5.1.0", @@ -28243,17 +28332,6 @@ "schema-utils": "^4.0.0" }, "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -28267,11 +28345,6 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -28321,17 +28394,6 @@ "ws": "^8.4.2" }, "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -28345,11 +28407,6 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "schema-utils": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", @@ -28364,7 +28421,8 @@ "ws": { "version": "8.8.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.8.0.tgz", - "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==" + "integrity": "sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==", + "requires": {} } } }, @@ -28553,17 +28611,6 @@ "workbox-window": "6.5.3" }, "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "fs-extra": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", @@ -28575,11 +28622,6 @@ "universalify": "^2.0.0" } }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "source-map": { "version": "0.8.0-beta.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", @@ -28783,7 +28825,8 @@ "ws": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz", - "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==" + "integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==", + "requires": {} }, "xml-name-validator": { "version": "3.0.0", From 073c2282e351f359f3c72e9a63b9f2ca81e3c55a Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Mon, 4 Jul 2022 09:32:58 -0300 Subject: [PATCH 47/62] Adding key props to maps on enemy modal --- src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx index aa2fae9..d273681 100644 --- a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx +++ b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx @@ -69,6 +69,7 @@ const AddEnemyToFloorModal = ({ {emojiToImageTag( enemy.emoji, @@ -92,6 +93,7 @@ const AddEnemyToFloorModal = ({ onClick={handleOnRemoveEnemyClick( enemy )} + key={enemy.id} > {emojiToImageTag( enemy.emoji, From 06b0a8e6ab23d83366c1c678f26ff65f42c03758 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Mon, 4 Jul 2022 09:33:15 -0300 Subject: [PATCH 48/62] Removing comment from game editor page --- src/pages/GameEditorPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index f0760d9..165709a 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -223,7 +223,6 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) {
Client Secret - {/* {currentGameType?.clientSecret} */}
{currentGameType?.clientSecret} handleCopyBtnClickClientSecret(currentGameType?.clientSecret)}>{hasCopiedClientSecret ? : } From 640df6c1c720e6d9c86ae1c67a8610bcdc4c6774 Mon Sep 17 00:00:00 2001 From: marcelomilera Date: Tue, 5 Jul 2022 17:18:58 -0500 Subject: [PATCH 49/62] Updating build commands in buildspec.yml --- buildspec.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 270277f..8ff0d9d 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -18,16 +18,15 @@ phases: - aws --version - node -v - yarn -v - - yarn install --frozen-lockfile --production=false - wget https://github.com/Droplr/aws-env/raw/master/bin/aws-env-linux-amd64 -O aws-env - chmod +x aws-env build: commands: - eval $(./aws-env --recursive) - - yarn install --frozen-lockfile --production=false + - yarn install - NODE_ENV=production yarn build post_build: commands: - - aws s3 sync build/. s3://$FRONTEND_BUCKET \ No newline at end of file + - aws s3 sync build/. s3://$FRONTEND_BUCKET From b989665713232be58005194c049459ac1b51d08b Mon Sep 17 00:00:00 2001 From: marcelomilera Date: Wed, 6 Jul 2022 11:44:00 -0500 Subject: [PATCH 50/62] Update buildspec.yml --- buildspec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 8ff0d9d..1127b30 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -24,8 +24,8 @@ phases: build: commands: - eval $(./aws-env --recursive) - - yarn install - - NODE_ENV=production yarn build + - npm i --legacy-peer-deps + - NODE_ENV=production npm run build post_build: commands: From 99c5906d4eb34467a7f77d60451a4ea85dadf54d Mon Sep 17 00:00:00 2001 From: marcelomilera Date: Wed, 6 Jul 2022 15:44:56 -0500 Subject: [PATCH 51/62] Update buildspec.yml --- buildspec.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 1127b30..96b6c8e 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -14,18 +14,16 @@ phases: commands: - n 16 - npm update -g npm - - npm install -g yarn - aws --version - node -v - - yarn -v - wget https://github.com/Droplr/aws-env/raw/master/bin/aws-env-linux-amd64 -O aws-env - chmod +x aws-env + - ls -la build: commands: - - eval $(./aws-env --recursive) - npm i --legacy-peer-deps - - NODE_ENV=production npm run build + - eval $(./aws-env --recursive) && npm run build post_build: commands: From 3a082ec68700a089b75485e3b285bd3ea60f892c Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 6 Jul 2022 20:50:07 -0300 Subject: [PATCH 52/62] Adding quantity to emojiHelper method --- src/helpers/emojiHelper.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/helpers/emojiHelper.tsx b/src/helpers/emojiHelper.tsx index c7a8baa..1e9775d 100644 --- a/src/helpers/emojiHelper.tsx +++ b/src/helpers/emojiHelper.tsx @@ -64,13 +64,17 @@ export const emojiToImageSrc = (emoji: string, allEmoji: IAllEmoji) => { export const emojiToImageTag = ( emoji: string, allEmoji: IAllEmoji, - className?: string + className?: string, + qty?: number, ) => { return ( - {emoji +
+ {emoji + {qty && x{qty}} +
); }; From 2af6385c7301533a1e79102bcac1c7a00172da2c Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 6 Jul 2022 20:50:48 -0300 Subject: [PATCH 53/62] Refactor of floors editor page to show bigger enemies emojis and organizing them as grid --- src/pages/FloorsEditorPage.tsx | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/pages/FloorsEditorPage.tsx b/src/pages/FloorsEditorPage.tsx index 241f0d0..9488488 100644 --- a/src/pages/FloorsEditorPage.tsx +++ b/src/pages/FloorsEditorPage.tsx @@ -14,18 +14,22 @@ import PanelBox from "../ui/PanelBox"; const FloorsEditorPage = () => { const [allEmoji, setAllEmoji] = useState({}); const [, setIsLoading] = useState(false); + const [shouldReload, setShouldReload] = useState(true); const [towerGame, setTowerGame] = useState(null); const [enemies, setEnemies] = useState([]); useEffect(() => { const fetchTowerAndEnemiesData = async () => { setIsLoading(true); + if(!shouldReload) { + return; + } const [enemies, game, allEmoji] = await Promise.all([ getEnemies(), getCurrentTowerGameStatus(), getAllEmoji(), ]); - + setShouldReload(false); setEnemies(enemies); setTowerGame(game); setAllEmoji(allEmoji); @@ -33,7 +37,7 @@ const FloorsEditorPage = () => { }; fetchTowerAndEnemiesData(); - }, [setTowerGame, setEnemies]); + }, [setTowerGame, setEnemies, shouldReload]); if (!towerGame) { return ( @@ -69,6 +73,7 @@ const FloorsEditorPage = () => { allEmoji={allEmoji} enemies={enemies} towerGame={towerGame} + setShouldReload={setShouldReload} />
); @@ -78,9 +83,10 @@ interface IFloorEditorProps { enemies: IEnemy[]; towerGame: IGameWithTower; allEmoji: IAllEmoji; + setShouldReload: (reload: boolean) => void; } -const FloorsEditor = ({ enemies, towerGame, allEmoji }: IFloorEditorProps) => { +const FloorsEditor = ({ enemies, towerGame, allEmoji, setShouldReload }: IFloorEditorProps) => { const [showAddEnemyModal, setShowAddEnemyModal] = useState(false); const [editingFloor, setEditingFloor] = useState(null); @@ -105,18 +111,19 @@ const FloorsEditor = ({ enemies, towerGame, allEmoji }: IFloorEditorProps) => {
-
+
{Object.keys(groupedByEnemies).map((enemyKey) => ( -
- {groupedByEnemies[enemyKey].length}x{" "} +
{emojiToImageTag( groupedByEnemies[enemyKey][0].emoji, - allEmoji + allEmoji, + "h-12 w-12", + groupedByEnemies[enemyKey].length, )}
))} @@ -125,14 +132,20 @@ const FloorsEditor = ({ enemies, towerGame, allEmoji }: IFloorEditorProps) => { ); }; - return ( + + const handleCloseEditFloorModalAction = (reload: boolean) => { + setShowAddEnemyModal(false); + setShouldReload(reload); + } + + return (
setShowAddEnemyModal(false)} + onClose={handleCloseEditFloorModalAction} />
{towerGame._tower._floors From 7d1807ac7a8ca282028e782979b709268fd28ca0 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Wed, 6 Jul 2022 20:51:14 -0300 Subject: [PATCH 54/62] Add enemy to modal modal layout and behavior improvements --- .../AddEnemyToFloorModal.tsx | 69 +++++++++++-------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx index d273681..bdd04de 100644 --- a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx +++ b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx @@ -1,4 +1,5 @@ -import { useState } from "react"; +import { groupBy } from "lodash"; +import { useEffect, useState } from "react"; import { updateFloor } from "../../api/admin"; import { emojiToImageTag } from "../../helpers/emojiHelper"; import Button from "../Button"; @@ -6,7 +7,7 @@ import Modal from "../Modal"; interface IProps { show: boolean; - onClose: () => void; + onClose: (reload:boolean) => void; floor: ITowerFloor | null; allEnemies: IEnemy[]; allEmoji: IAllEmoji; @@ -21,12 +22,8 @@ const AddEnemyToFloorModal = ({ }: IProps) => { const [floorEnemies, setFloorEnemies] = useState([]); - if (!floor) { - return null; - } - const handleOnSaveButtonClick = () => { - const floorId = floor.id; + const floorId = floor?.id; const enemyIds = floorEnemies.map((enemy) => enemy.id) as number[]; if (!floorId || !enemyIds) { @@ -35,6 +32,8 @@ const AddEnemyToFloorModal = ({ updateFloor(floorId, { enemyIds, }); + onClose(true); + setFloorEnemies([]); }; const handleOnAddEnemyClick = @@ -51,11 +50,28 @@ const AddEnemyToFloorModal = ({ setFloorEnemies(newFloorEnemiesArray); }; + const handleCloseModal = () => { + onClose(false); + setFloorEnemies([]); + } + + useEffect(() => { + if(floor?._floorEnemies) { + const floorEnemies = floor._floorEnemies?.map( + (floorEnemy) => floorEnemy._enemy + ); + setFloorEnemies(floorEnemies); + + } + }, [floor?._floorEnemies]); + + const groupedByEnemies = groupBy(floorEnemies, "name"); + return (
- +

- Add Enemy to Floor {floor.number} + Edit Enemies on Floor {floor?.number}

@@ -63,7 +79,7 @@ const AddEnemyToFloorModal = ({

All enemies

-
+
{allEnemies.map((enemy) => { return ( Floor Enemies

-
- {floorEnemies.map((enemy) => { - return ( - - {emojiToImageTag( - enemy.emoji, - allEmoji, - "h-12 w-12" - )} - - ); - })} +
+ {Object.keys(groupedByEnemies).map((enemyKey) => ( + + {emojiToImageTag( + groupedByEnemies[enemyKey][0].emoji, + allEmoji, + "h-12 w-12", + groupedByEnemies[enemyKey].length, + )} + + ))}
From 914979dd32813b154d39b05a1032cbb7ac6be604 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Thu, 7 Jul 2022 10:50:17 -0300 Subject: [PATCH 55/62] Adding async to the api submit call to avoid losing the refreshed data, adding delete all button --- src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx index bdd04de..0cec3b6 100644 --- a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx +++ b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx @@ -1,5 +1,6 @@ import { groupBy } from "lodash"; import { useEffect, useState } from "react"; +import { AiOutlineDelete } from "react-icons/ai"; import { updateFloor } from "../../api/admin"; import { emojiToImageTag } from "../../helpers/emojiHelper"; import Button from "../Button"; @@ -22,14 +23,14 @@ const AddEnemyToFloorModal = ({ }: IProps) => { const [floorEnemies, setFloorEnemies] = useState([]); - const handleOnSaveButtonClick = () => { + const handleOnSaveButtonClick = async () => { const floorId = floor?.id; const enemyIds = floorEnemies.map((enemy) => enemy.id) as number[]; if (!floorId || !enemyIds) { return; } - updateFloor(floorId, { + await updateFloor(floorId, { enemyIds, }); onClose(true); @@ -97,7 +98,7 @@ const AddEnemyToFloorModal = ({ })}
-
+

Floor Enemies

@@ -117,6 +118,7 @@ const AddEnemyToFloorModal = ({ ))}
+ setFloorEnemies([])}>
From 4701f8bb6488a13f15f4de695ac5101b2f2804ac Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 8 Jul 2022 14:20:27 -0300 Subject: [PATCH 56/62] Adding react-toastify dependency --- package-lock.json | 34 ++++++++++++++++++++++++++++++++++ package.json | 1 + src/App.tsx | 3 +++ 3 files changed, 38 insertions(+) diff --git a/package-lock.json b/package-lock.json index 4889917..5415f0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "react-router-dom": "6.3.0", "react-scripts": "5.0.1", "react-spinners": "0.12.0", + "react-toastify": "^9.0.5", "recharts": "2.1.10", "sweetalert2": "11.4.17", "typescript": "4.7.3", @@ -5942,6 +5943,14 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -13896,6 +13905,18 @@ "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/react-toastify": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.0.5.tgz", + "integrity": "sha512-dszPCeQINY+Nm6HmsiAXT/7wsazPqv0S/RuhIYLAW+fTKcd3T1iRjZG0XqrN9nvAzqaE5J6uxMaiBrOevxjY8g==", + "dependencies": { + "clsx": "^1.1.1" + }, + "peerDependencies": { + "react": ">=16", + "react-dom": ">=16" + } + }, "node_modules/react-transition-group": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.9.0.tgz", @@ -21062,6 +21083,11 @@ "wrap-ansi": "^7.0.0" } }, + "clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==" + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -26717,6 +26743,14 @@ "@emotion/react": "^11.4.1" } }, + "react-toastify": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.0.5.tgz", + "integrity": "sha512-dszPCeQINY+Nm6HmsiAXT/7wsazPqv0S/RuhIYLAW+fTKcd3T1iRjZG0XqrN9nvAzqaE5J6uxMaiBrOevxjY8g==", + "requires": { + "clsx": "^1.1.1" + } + }, "react-transition-group": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.9.0.tgz", diff --git a/package.json b/package.json index 59ab7cc..43d3718 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "react-router-dom": "6.3.0", "react-scripts": "5.0.1", "react-spinners": "0.12.0", + "react-toastify": "^9.0.5", "recharts": "2.1.10", "sweetalert2": "11.4.17", "typescript": "4.7.3", diff --git a/src/App.tsx b/src/App.tsx index 3bfc6b7..97d54fb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -24,6 +24,8 @@ import LeaderboardRanksPage from "./pages/LeaderboardRanksPage"; // import { UnauthorizedPage } from "./pages/UnauthorizedPage"; import { ProtectedRoute } from "./ProtectedRoute"; import { AppMenu } from "./AppMenu"; +import { ToastContainer } from 'react-toastify'; + import 'react-toastify/dist/ReactToastify.css'; export const App = () => { // if (isDoingInitialLoading) { @@ -36,6 +38,7 @@ export const App = () => { return ( + Date: Fri, 8 Jul 2022 14:21:25 -0300 Subject: [PATCH 57/62] Setting editingFloor to null when the modal closes to prevent not loading when editing same floor twice --- src/pages/FloorsEditorPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/FloorsEditorPage.tsx b/src/pages/FloorsEditorPage.tsx index 9488488..0104883 100644 --- a/src/pages/FloorsEditorPage.tsx +++ b/src/pages/FloorsEditorPage.tsx @@ -136,6 +136,7 @@ const FloorsEditor = ({ enemies, towerGame, allEmoji, setShouldReload }: IFloorE const handleCloseEditFloorModalAction = (reload: boolean) => { setShowAddEnemyModal(false); setShouldReload(reload); + setEditingFloor(null); } return ( From 1f6447a15ff40c8422c35df7b74877ed7ef92b15 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 8 Jul 2022 14:21:46 -0300 Subject: [PATCH 58/62] Adding toast messages on operations, small layout changes --- .../AddEnemyToFloorModal.tsx | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx index 0cec3b6..62bbdf8 100644 --- a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx +++ b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx @@ -1,6 +1,7 @@ import { groupBy } from "lodash"; import { useEffect, useState } from "react"; import { AiOutlineDelete } from "react-icons/ai"; +import { toast } from "react-toastify"; import { updateFloor } from "../../api/admin"; import { emojiToImageTag } from "../../helpers/emojiHelper"; import Button from "../Button"; @@ -24,17 +25,26 @@ const AddEnemyToFloorModal = ({ const [floorEnemies, setFloorEnemies] = useState([]); const handleOnSaveButtonClick = async () => { - const floorId = floor?.id; - const enemyIds = floorEnemies.map((enemy) => enemy.id) as number[]; - - if (!floorId || !enemyIds) { - return; + try{ + const floorId = floor?.id; + const enemyIds = floorEnemies.map((enemy) => enemy.id) as number[]; + + if (!floorId || !enemyIds) { + return; + } + await updateFloor(floorId, { + enemyIds, + }); + onClose(true); + setFloorEnemies([]); + toast('Floor edited successfuly.', { + type: 'success', + }); + } catch(err: any) { + toast(`Error adding enemies to floor. ${err?.message} `, { + type: 'error', + }) } - await updateFloor(floorId, { - enemyIds, - }); - onClose(true); - setFloorEnemies([]); }; const handleOnAddEnemyClick = @@ -62,7 +72,7 @@ const AddEnemyToFloorModal = ({ (floorEnemy) => floorEnemy._enemy ); setFloorEnemies(floorEnemies); - + console.log("🚀 ~ file: AddEnemyToFloorModal.tsx ~ line 65 ~ useEffect ~ floorEnemies", floorEnemies) } }, [floor?._floorEnemies]); @@ -75,8 +85,8 @@ const AddEnemyToFloorModal = ({ Edit Enemies on Floor {floor?.number}

-
-
+
+

All enemies

@@ -98,7 +108,7 @@ const AddEnemyToFloorModal = ({ })}
-
+

Floor Enemies

@@ -118,7 +128,7 @@ const AddEnemyToFloorModal = ({ ))}
- setFloorEnemies([])}> + { floorEnemies && floorEnemies.length > 0 && setFloorEnemies([])}> }
From c10689ca52f5204d416ee1255a87dcf113d94162 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 8 Jul 2022 14:45:02 -0300 Subject: [PATCH 59/62] Removing console call --- src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx index 62bbdf8..84e0473 100644 --- a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx +++ b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx @@ -72,7 +72,6 @@ const AddEnemyToFloorModal = ({ (floorEnemy) => floorEnemy._enemy ); setFloorEnemies(floorEnemies); - console.log("🚀 ~ file: AddEnemyToFloorModal.tsx ~ line 65 ~ useEffect ~ floorEnemies", floorEnemies) } }, [floor?._floorEnemies]); From 51c1c2e0b63c7601b9f146acc84e7f2dabab4443 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 8 Jul 2022 16:12:28 -0300 Subject: [PATCH 60/62] Better look to enemies count :) --- src/helpers/emojiHelper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/emojiHelper.tsx b/src/helpers/emojiHelper.tsx index 1e9775d..95452a7 100644 --- a/src/helpers/emojiHelper.tsx +++ b/src/helpers/emojiHelper.tsx @@ -74,7 +74,7 @@ export const emojiToImageTag = ( src={emojiToImageSrc(emoji, allEmoji)} alt={emoji + " emoji"} /> - {qty && x{qty}} + {qty &&
{qty}
}
); }; From 9d8c0ca1b96e26437d84e8ea992fbb22081e6c3a Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 8 Jul 2022 16:16:38 -0300 Subject: [PATCH 61/62] Changing trash icon color --- src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx index 84e0473..ec31041 100644 --- a/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx +++ b/src/ui/AddEnemyToFloorModal/AddEnemyToFloorModal.tsx @@ -127,7 +127,7 @@ const AddEnemyToFloorModal = ({ ))} - { floorEnemies && floorEnemies.length > 0 && setFloorEnemies([])}> } + {floorEnemies && floorEnemies.length > 0 && setFloorEnemies([])}>} From cabe7cd2625fcaa1d479038e9c3770904c7186e6 Mon Sep 17 00:00:00 2001 From: Ramir Mesquita Date: Fri, 8 Jul 2022 19:16:17 -0300 Subject: [PATCH 62/62] Adding toast messages to games pages and leaderboard/achievement modals --- src/pages/GameEditorPage.tsx | 10 +++++++ .../AddOrEditAchievementModal.tsx | 30 ++++++++++++------- .../AddOrEditLeaderboardModal.tsx | 29 ++++++++++++------ 3 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/pages/GameEditorPage.tsx b/src/pages/GameEditorPage.tsx index 165709a..9a5cd22 100644 --- a/src/pages/GameEditorPage.tsx +++ b/src/pages/GameEditorPage.tsx @@ -4,6 +4,7 @@ import { useParams, useNavigate } from "react-router-dom"; import { SyncLoader } from "react-spinners"; import * as Yup from "yup"; import { AiOutlineCheck, AiOutlineClose, AiOutlineCopy } from "react-icons/ai"; +import { toast } from "react-toastify"; import { getAchievements } from "../api/achievements"; import { getGameType, upsertGameType } from "../api/gamedev"; @@ -66,7 +67,13 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { try { await upsertGameType(upserGameTypeParams); navigate("/games"); + toast('Game successfully saved.',{ + type: 'success', + }); } catch (error: any) { + toast(`Error saving game : ${error?.message}`, { + type: "error", + }); console.log({ error }); setIsLoading(false); setErrorMessage(error.message); @@ -118,6 +125,9 @@ const GameEditorPage = function GameEditorPage({ editMode }: IProps) { return gameType; } catch (error: any) { console.log({ error }); + toast(`Error : ${error?.message}`, { + type: "error", + }); setIsLoading(false); setErrorMessage(error.message); } diff --git a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx index 73de78d..c5427b3 100644 --- a/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx +++ b/src/ui/AddOrEditAchievementModal/AddOrEditAchievementModal.tsx @@ -2,6 +2,7 @@ import { useFormik } from "formik"; import { useEffect } from "react"; import * as Yup from "yup"; import { useParams } from "react-router-dom"; +import { toast } from "react-toastify"; import { upsertAchievement } from "../../api/achievements"; import Button from "../Button"; @@ -30,16 +31,25 @@ const AddOrEditAchievementModal = ({ const { gameTypeId } = useParams<{ gameTypeId: string }>(); const onSubmit = async (values: IAchievementForm) => { - await upsertAchievement({ - ...(selectedAchievement?.id && { id: selectedAchievement?.id }), - _gameTypeId: selectedAchievement?._gameTypeId || parseInt(gameTypeId || ""), - ...(selectedAchievement?.createdAt && { createdAt: selectedAchievement?.createdAt }), - description: values.description, - targetValue: values.targetValue, - isEnabled: values.isEnabled, - updatedAt: new Date().toString(), - }); - onClose(); + try{ + await upsertAchievement({ + ...(selectedAchievement?.id && { id: selectedAchievement?.id }), + _gameTypeId: selectedAchievement?._gameTypeId || parseInt(gameTypeId || ""), + ...(selectedAchievement?.createdAt && { createdAt: selectedAchievement?.createdAt }), + description: values.description, + targetValue: values.targetValue, + isEnabled: values.isEnabled, + updatedAt: new Date().toString(), + }); + onClose(); + toast('Achievement successfully saved.',{ + type: 'success', + }); + } catch (err: any) { + toast(`Error : ${err.message}`, { + type: "error", + }); + } } const validationSchema = Yup.object({ diff --git a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx index e9c7e6b..0268adb 100644 --- a/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx +++ b/src/ui/AddOrEditLeaderboardModal/AddOrEditLeaderboardModal.tsx @@ -12,6 +12,7 @@ import { resetStrategies, scoreStrategies, } from "../../utils/leaderboardStrategies"; +import { toast } from "react-toastify"; interface IProps { show: boolean; @@ -34,15 +35,25 @@ const AddOrEditLeaderboardModal = ({ const { gameTypeId } = useParams<{ gameTypeId: string }>(); const onSubmit = async (values: ILeaderboardForm) => { - await upsertLeaderboard({ - ...(selectedLeaderboard?.id && { id: selectedLeaderboard?.id }), - _gameTypeId: - selectedLeaderboard?._gameTypeId || parseInt(gameTypeId || ""), - name: values.name, - scoreStrategy: values.scoreStrategy.toLowerCase(), - resetStrategy: values.resetStrategy.toLowerCase(), - }); - onClose(); + try{ + await upsertLeaderboard({ + ...(selectedLeaderboard?.id && { id: selectedLeaderboard?.id }), + _gameTypeId: + selectedLeaderboard?._gameTypeId || parseInt(gameTypeId || ""), + name: values.name, + scoreStrategy: values.scoreStrategy.toLowerCase(), + resetStrategy: values.resetStrategy.toLowerCase(), + }); + onClose(); + toast('Leaderboard successfully saved.',{ + type: 'success', + }); + + } catch (err: any) { + toast(`Error : ${err?.message}`, { + type: "error", + }); + } }; const validationSchema = Yup.object({