Skip to content

Commit

Permalink
fix prescience overlaps
Browse files Browse the repository at this point in the history
  • Loading branch information
starknetdev committed Sep 13, 2024
1 parent 6e18e9d commit ca73455
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
28 changes: 15 additions & 13 deletions ui/src/app/components/encounters/EnounterDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,30 @@ const EncounterDialog = () => {
const position = useMemo(() => {
if (width > 1024) {
// Large screens
return { x: width - 650, y: 50 };
return { x: width - 850, y: -500 };
} else if (width > 768) {
// Medium screens
return { x: width - 620, y: 50 };
return { x: width - 620, y: -500 };
} else {
// Small screens
return { x: 300, y: 50 };
return { x: 0, y: -500 };
}
}, [width]);

return (
<Draggable defaultPosition={position}>
<div className="relative">
<MdClose
className="w-10 h-10 absolute top-0 left-[-40px] z-10 border-y border-l border-bottom border-terminal-green bg-terminal-black cursor-pointer"
onClick={() => showEncounterTable(false)}
/>
<div className="flex flex-col gap-5 sm:gap-0 sm:flex-row justify-between w-[600px] bg-terminal-black max-h-[300px] border border-terminal-green text-xs sm:text-base overflow-y-scroll default-scroll cursor-pointer hover:shadow-lg">
<EncounterTable />
<div className="absolute">
<Draggable defaultPosition={position}>
<div className="relative">
<MdClose
className="w-10 h-10 absolute top-0 left-[-40px] z-10 border-y border-l border-bottom border-terminal-green bg-terminal-black cursor-pointer"
onClick={() => showEncounterTable(false)}
/>
<div className="flex flex-col gap-5 sm:gap-0 sm:flex-row justify-between w-[600px] bg-terminal-black max-h-[300px] border border-terminal-green text-xs sm:text-base overflow-y-scroll default-scroll cursor-pointer hover:shadow-lg">
<EncounterTable />
</div>
</div>
</div>
</Draggable>
</Draggable>
</div>
);
};

Expand Down
6 changes: 1 addition & 5 deletions ui/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -866,11 +866,7 @@ function Home() {
{screen === "player" && <Player gameContract={gameContract!} />}
{screen === "wallet" && <WalletSelect />}

{encounterTable && (
<div className="absolute top-1/2 right-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10">
<EncounterDialog />
</div>
)}
{encounterTable && <EncounterDialog />}

{showProfile && (
<div className="absolute flex items-center justify-center top-0 right-0 left-0 w-full h-full bg-black/50">
Expand Down

0 comments on commit ca73455

Please sign in to comment.