Skip to content

Commit

Permalink
JSXifies fire support menu. Yippie!
Browse files Browse the repository at this point in the history
  • Loading branch information
sunofang committed Aug 7, 2024
1 parent 8ffa9a7 commit bfe87d0
Showing 1 changed file with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { auto } from '@popperjs/core';

import { useBackend } from '../backend';
import { Button, Collapsible, Section, Stack } from '../components';
import { Window } from '../layouts';

export const GameMasterFireSupportMenu = (props, context) => {
const { act, data } = useBackend(context);
const { act, data } = useBackend();
return (
<Window resizable width={'450px'}>
<Window.Content scrollable>
Expand All @@ -13,75 +14,81 @@ export const GameMasterFireSupportMenu = (props, context) => {
title="Fire Support Menu"
align="center"
justify="center"
height={auto}>
height={auto}
>
<Stack vertical>
<Stack.Item>
<Button
minWidth={'150px'}
fontSize="15px"
ml={1}
selected={data.fire_support_click_intercept}
content="CALL FIRE SUPPORT"
onClick={() => {
act('toggle_click_fire_support');
}}
/>
>
CALL FIRE SUPPORT
</Button>
</Stack.Item>
</Stack>

<Collapsible content="Missiles">
{data.missile_ordnance_options.map((ordnance, i) => (
<Button
content={ordnance}
selected={data.selected_ordnance === ordnance}
key={i}
width={'140px'}
onClick={() => {
act('set_selected_ordnance', { ordnance });
}}
/>
>
{ordnance}
</Button>
))}
</Collapsible>

<Collapsible content="Orbital Bombardments">
{data.orbital_ordnance_options.map((ordnance, i) => (
<Button
content={ordnance}
selected={data.selected_ordnance === ordnance}
key={i}
width={'140px'}
onClick={() => {
act('set_selected_ordnance', { ordnance });
}}
/>
>
{ordnance}
</Button>
))}
</Collapsible>

<Collapsible content="Mortar Shells">
{data.mortar_ordnance_options.map((ordnance, i) => (
<Button
content={ordnance}
selected={data.selected_ordnance === ordnance}
key={i}
width={'140px'}
onClick={() => {
act('set_selected_ordnance', { ordnance });
}}
/>
>
{ordnance}
</Button>
))}
</Collapsible>

<Collapsible content="Misc Ordnance">
{data.misc_ordnance_options.map((ordnance, i) => (
<Button
content={ordnance}
selected={data.selected_ordnance === ordnance}
key={i}
width={'140px'}
onClick={() => {
act('set_selected_ordnance', { ordnance });
}}
/>
>
{ordnance}
</Button>
))}
</Collapsible>
</Section>
Expand Down

0 comments on commit bfe87d0

Please sign in to comment.