From 6317f8d8511eb6c5936757d9f32c437b20834742 Mon Sep 17 00:00:00 2001 From: aymericdelab Date: Fri, 13 Dec 2024 14:11:02 +0100 Subject: [PATCH] [client] welcome message even if you've done quests Fixes #2479 --- .../src/ui/modules/navigation/QuestMenu.tsx | 172 +++++++++--------- .../modules/navigation/TopLeftNavigation.tsx | 8 +- 2 files changed, 91 insertions(+), 89 deletions(-) diff --git a/client/src/ui/modules/navigation/QuestMenu.tsx b/client/src/ui/modules/navigation/QuestMenu.tsx index 7f069fcbe..6258e7f60 100644 --- a/client/src/ui/modules/navigation/QuestMenu.tsx +++ b/client/src/ui/modules/navigation/QuestMenu.tsx @@ -1,5 +1,5 @@ import { useDojo } from "@/hooks/context/DojoContext"; -import { Prize, QuestStatus, useQuests } from "@/hooks/helpers/useQuests"; +import { Prize, QuestStatus, useQuests, useUnclaimedQuestsCount } from "@/hooks/helpers/useQuests"; import { useRealm } from "@/hooks/helpers/useRealm"; import useUIStore from "@/hooks/store/useUIStore"; import { useWorldStore } from "@/hooks/store/useWorldLoading"; @@ -11,7 +11,7 @@ import { QuestType } from "@bibliothecadao/eternum"; import clsx from "clsx"; import { useState } from "react"; -export const QuestsMenu = ({ unclaimedQuestsCount }: { unclaimedQuestsCount: number }) => { +export const QuestsMenu = () => { const { account: { account }, setup: { @@ -34,6 +34,9 @@ export const QuestsMenu = ({ unclaimedQuestsCount }: { unclaimedQuestsCount: num const { handleStart } = useTutorial(questSteps.get(currentQuest?.id || QuestType.Settle)); + const isWorldLoading = useWorldStore((state) => state.isWorldLoading); + const { unclaimedQuestsCount } = useUnclaimedQuestsCount(); + const [isLoading, setIsLoading] = useState(false); const [skipQuest, setSkipQuest] = useState(false); @@ -102,96 +105,101 @@ export const QuestsMenu = ({ unclaimedQuestsCount }: { unclaimedQuestsCount: num }; return ( -
- - -
-
-
- - - -
-
-
- - {skipQuest ? ( -
- + +
+
+
+ + +
+
+
+ + {skipQuest ? ( +
+ + + +
+ ) : ( + + )}
- ) : ( - - )} -
+
+ ) ); }; diff --git a/client/src/ui/modules/navigation/TopLeftNavigation.tsx b/client/src/ui/modules/navigation/TopLeftNavigation.tsx index c6bccb01a..fc70dab97 100644 --- a/client/src/ui/modules/navigation/TopLeftNavigation.tsx +++ b/client/src/ui/modules/navigation/TopLeftNavigation.tsx @@ -2,7 +2,6 @@ import { configManager } from "@/dojo/setup"; import { useDojo } from "@/hooks/context/DojoContext"; import { useEntities, useEntitiesUtils } from "@/hooks/helpers/useEntities"; import { useQuery } from "@/hooks/helpers/useQuery"; -import { useUnclaimedQuestsCount } from "@/hooks/helpers/useQuests"; import useUIStore from "@/hooks/store/useUIStore"; import useNextBlockTimestamp from "@/hooks/useNextBlockTimestamp"; import { soundSelector, useUiSounds } from "@/hooks/useUISound"; @@ -96,7 +95,6 @@ const WorkersHutTooltipContent = () => { export const TopLeftNavigation = memo(() => { const { setup } = useDojo(); - const { unclaimedQuestsCount } = useUnclaimedQuestsCount(); const { isMapView, handleUrlChange, hexPosition } = useQuery(); const { playerStructures } = useEntities(); const { getEntityInfo } = useEntitiesUtils(); @@ -321,11 +319,7 @@ export const TopLeftNavigation = memo(() => {
- {unclaimedQuestsCount > 0 && ( -
- -
- )} +
);