Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
First attempt at mobile selection box for mod queue
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent a14c072 commit 8786363
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions app/routes/mod-queue.tsx
Expand Up @@ -264,6 +264,24 @@ export default function () {
itemModals[modal].onOpen();
}, []);

const ItemDisplay = (
<Select
onChange={async (v) => {
setEntries([]);
setBefore(Date.now());

const { target } = v;

await updateQueue(
target.options[target.selectedIndex].value,
Date.now(),
);
}}
>
{entryTypes}
</Select>
);

return (
<Container maxW="container.lg">
<NewGameBan
Expand All @@ -281,24 +299,13 @@ export default function () {
/>
<Flex>
<VStack w={isDesktop ? "container.md" : "container.lg"}>
<Box display={isDesktop ? "none" : undefined} mb="16px">
{ItemDisplay}
</Box>
{entries}
</VStack>
<Box display={isDesktop ? undefined : "none"} ml="16px" w="248px">
<Select
onChange={async (v) => {
setEntries([]);
setBefore(Date.now());

const { target } = v;

await updateQueue(
target.options[target.selectedIndex].value,
Date.now(),
);
}}
>
{entryTypes}
</Select>
{ItemDisplay}
</Box>
</Flex>
<Popover placement="top-end">
Expand Down

0 comments on commit 8786363

Please sign in to comment.