Skip to content

Commit

Permalink
fix(web): show back btn on trade page
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Jul 18, 2023
1 parent 8b7b1ab commit c1f16c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
9 changes: 2 additions & 7 deletions web/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ const Header = ({ back }: HeaderProps) => {
const isMobile = IsMobile();
const isMuted = useSoundStore((state) => state.isMuted);
const isConnected = useUiStore((state) => state.isConnected);
const isBackButtonVisible = useUiStore((state) =>
state.isBackButtonVisible(router.pathname),
);
const hasNewMessages = true;

useEffect(() => {
Expand Down Expand Up @@ -82,7 +79,7 @@ const Header = ({ back }: HeaderProps) => {
zIndex="1"
>
<HStack flex="1" justify="left">
{isBackButtonVisible && (
{back && (
<HeaderButton onClick={() => router.back()}>
<Arrow />
</HeaderButton>
Expand All @@ -104,9 +101,7 @@ const Header = ({ back }: HeaderProps) => {
<Divider orientation="vertical" borderColor="neon.600" h="12px" />
<HStack>
<Bag />
<Text>
{inventory}/{MAX_INVENTORY}
</Text>
<Text>{inventory}</Text>
</HStack>
<Divider orientation="vertical" borderColor="neon.600" h="12px" />
<HStack>
Expand Down
4 changes: 3 additions & 1 deletion web/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface LayoutProps {
map: ReactNode;
imageSrc: string;
prefixTitle: string;
showBack?: boolean;
children: ReactNode;
}

Expand All @@ -27,11 +28,12 @@ const Layout = ({
prefixTitle,
map,
imageSrc,
showBack,
children,
}: Partial<LayoutProps>) => {
return (
<>
<Header />
<Header back={showBack} />
<Flex
position="fixed"
top="0"
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/[gameId]/[locationSlug]/[drugSlug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default function Market() {
title={drug.name}
prefixTitle="The market"
imageSrc="/images/dealer.png"
showBack={true}
>
<VStack w="100%" h="100%">
<Card variant="pixelated" p={6} mb={6} _hover={{}}>
Expand Down

1 comment on commit c1f16c2

@vercel
Copy link

@vercel vercel bot commented on c1f16c2 Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

rollyourown – ./

rollyourown.preview.cartridge.gg
rollyourown-git-main.preview.cartridge.gg

Please sign in to comment.