Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat committed Apr 14, 2024
1 parent 21968df commit 20d1f29
Showing 1 changed file with 10 additions and 53 deletions.
63 changes: 10 additions & 53 deletions tgui/packages/tgui/interfaces/common/StatusDisplayControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,15 @@ type Data = {

export const StatusDisplayControls = (props, context) => {
const { act, data } = useBackend<Data>(context);
const {
upperText: initialUpper,
lowerText: initialLower,
maxStatusLineLength,
} = data;
const { upperText: initialUpper, lowerText: initialLower, maxStatusLineLength } = data;

const [upperText, setUpperText] = useSharedState(
context,
'statusUpperText',
initialUpper
);
const [lowerText, setLowerText] = useSharedState(
context,
'statusLowerText',
initialLower
);
const [upperText, setUpperText] = useSharedState(context, 'statusUpperText', initialUpper);
const [lowerText, setLowerText] = useSharedState(context, 'statusLowerText', initialLower);

return (
<>
<Section>
<Button
icon="toggle-off"
content="Off"
color="bad"
onClick={() => act('setStatusPicture', { picture: 'blank' })}
/>
<Button icon="toggle-off" content="Off" color="bad" onClick={() => act('setStatusPicture', { picture: 'blank' })} />
<Button
icon="space-shuttle"
content="Shuttle ETA / Off"
Expand All @@ -44,57 +27,31 @@ export const StatusDisplayControls = (props, context) => {
</Section>

<Section title="Graphics">
<Button
icon="flag"
content="Logo"
onClick={() => act('setStatusPicture', { picture: 'default' })}
/>
<Button icon="flag" content="Logo" onClick={() => act('setStatusPicture', { picture: 'default' })} />

<Button
icon="bell-o"
content="Red Alert"
onClick={() => act('setStatusPicture', { picture: 'redalert' })}
/>
<Button icon="bell-o" content="Red Alert" onClick={() => act('setStatusPicture', { picture: 'redalert' })} />

<Button
icon="exclamation-triangle"
content="Lockdown"
onClick={() => act('setStatusPicture', { picture: 'lockdown' })}
/>

<Button
icon="biohazard"
content="Biohazard"
onClick={() => act('setStatusPicture', { picture: 'biohazard' })}
/>
<Button icon="biohazard" content="Biohazard" onClick={() => act('setStatusPicture', { picture: 'biohazard' })} />
</Section>

<Section title="Message">
<Flex direction="column" align="stretch">
<Flex.Item mb={1}>
<Input
fluid
maxLength={maxStatusLineLength}
value={upperText}
onChange={(_, value) => setUpperText(value)}
/>
<Input fluid maxLength={maxStatusLineLength} value={upperText} onChange={(_, value) => setUpperText(value)} />
</Flex.Item>

<Flex.Item mb={1}>
<Input
fluid
maxLength={maxStatusLineLength}
value={lowerText}
onChange={(_, value) => setLowerText(value)}
/>
<Input fluid maxLength={maxStatusLineLength} value={lowerText} onChange={(_, value) => setLowerText(value)} />
</Flex.Item>

<Flex.Item>
<Button
icon="comment-o"
onClick={() => act('setStatusMessage', { upperText, lowerText })}
content="Send"
/>
<Button icon="comment-o" onClick={() => act('setStatusMessage', { upperText, lowerText })} content="Send" />
</Flex.Item>
</Flex>
</Section>
Expand Down

0 comments on commit 20d1f29

Please sign in to comment.