Skip to content

Commit

Permalink
Remove quest UI while syncing (#2449)
Browse files Browse the repository at this point in the history
* Remove quest UI while syncing

* Add quest load animation
  • Loading branch information
bob0005 authored Dec 12, 2024
1 parent 7990511 commit 337f111
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions client/src/ui/modules/navigation/TopLeftNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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 { useWorldStore } from "@/hooks/store/useWorldLoading";
import useNextBlockTimestamp from "@/hooks/useNextBlockTimestamp";
import { soundSelector, useUiSounds } from "@/hooks/useUISound";
import { Position } from "@/types/Position";
Expand Down Expand Up @@ -96,6 +97,8 @@ const WorkersHutTooltipContent = () => {
export const TopLeftNavigation = memo(() => {
const { setup } = useDojo();

const worldLoading = useWorldStore((state) => state.isWorldLoading);

const { unclaimedQuestsCount } = useUnclaimedQuestsCount();
const { isMapView, handleUrlChange, hexPosition } = useQuery();
const { playerStructures } = useEntities();
Expand Down Expand Up @@ -321,10 +324,17 @@ export const TopLeftNavigation = memo(() => {
</motion.div>
<div className="relative">
<SecondaryMenuItems />
{unclaimedQuestsCount > 0 && (
<div className="absolute right-0 px-4 top-full mt-2">
<QuestsMenu unclaimedQuestsCount={unclaimedQuestsCount} />
{worldLoading ? (
<div className="absolute right-2 p-4 mt-2 top-full flex flex-row items-center justify-center bg-black/80 rounded-lg">
<img src="/images/eternumloader.png" className="w-10" />
<div className="ml-4">Quests are loading...</div>
</div>
) : (
unclaimedQuestsCount > 0 && (
<div className="absolute right-0 px-4 top-full mt-2">
<QuestsMenu unclaimedQuestsCount={unclaimedQuestsCount} />
</div>
)
)}
</div>
</div>
Expand Down

0 comments on commit 337f111

Please sign in to comment.