Skip to content

Commit

Permalink
Merge branch 'main' into add_tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l authored Sep 16, 2023
2 parents f78d6c8 + 4f45fdc commit 16ecf85
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
32 changes: 20 additions & 12 deletions web/src/pages/[gameId]/[locationSlug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
StyleProps,
useDisclosure,
useBreakpointValue,
Flex,
} from "@chakra-ui/react";
import Layout from "@/components/Layout";
import { useRouter } from "next/router";
Expand Down Expand Up @@ -120,24 +121,31 @@ export default function Location() {
{drugInfo.name}
</CardHeader>
<CardBody>
<HStack w="full" justify="center" position="relative" m="2px">
<HStack
<HStack w="full" justify="center">
<Flex
as={motion.div}
initial={{ opacity: 0 }}
whileHover={{ opacity: 1 }}
w="full"
p="20px"
gap="10px"
p="2px"
align="center"
boxSize="full"
position="absolute"
bgColor="neon.900"
pointerEvents={["none", "auto"]}
>
<BuySellBtns
canBuy={canBuy}
canSell={canSell}
drugSlug={drugInfo.slug}
/>
</HStack>
<HStack
h="100px"
w="full"
p="20px"
gap="10px"
bgColor="neon.900"
>
<BuySellBtns
canBuy={canBuy}
canSell={canSell}
drugSlug={drugInfo.slug}
/>
</HStack>
</Flex>
{drugInfo.icon({})}
</HStack>
</CardBody>
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/[gameId]/travel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function Travel() {
if (playerEntity && !isSubmitting) {
const location = getLocationById(playerEntity.locationId);
setCurrentLocationId(location.id);
setTargetId(location.id);
}
}, [playerEntity, isSubmitting]);

Expand Down
20 changes: 12 additions & 8 deletions web/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ import { useDojo } from "@/dojo";
import { JoinedEventData } from "@/dojo/events";
import { getLocationById } from "@/dojo/helpers";
import { usePlayerStore } from "@/hooks/state";

import { useState } from "react";
import HomeLeftPanel from "@/components/HomeLeftPanel";
import Tutorial from "@/components/Tutorial";

import { useEffect, useState } from "react";

// hardcode game params for now
const START_TIME = 0;
Expand All @@ -43,6 +41,13 @@ export default function Home() {
const { resetAll } = usePlayerStore();
const { toast } = useToast();
const [isSubmitting, setIsSubmitting] = useState(false);
const [isGated, setIsGated] = useState(false);

useEffect(
() =>
setIsGated(window.location.host === "rollyourown.preview.cartridge.gg"),
[],
);

const [isTutorialOpen, setIsTutorialOpen] = useState(false);
const isLocal = true;
Expand All @@ -53,7 +58,8 @@ export default function Home() {
<VStack boxSize="full" gap="10px" justify="center">
<Card variant="pixelated">
<HStack w="full" p="20px" gap="10px" justify="center">
{!isLocal && (

{isGated ? (
<VStack>
<HStack>
<Alert />
Expand All @@ -63,9 +69,8 @@ export default function Home() {
Get ready hustlers... Season II starts in September
</Text>
</VStack>
)}

{isLocal && (
) : (
<>
<Button flex="1" onClick={() => setIsTutorialOpen(true)}>
Tutorial
Expand Down Expand Up @@ -99,11 +104,10 @@ export default function Home() {
</Button>
</>
)}

</HStack>
</Card>

{isLocal && (
{!isGated && (
<>
<Text>HALL OF FAME</Text>
<VStack
Expand Down

0 comments on commit 16ecf85

Please sign in to comment.