This commit is contained in:
Letter N
2020-08-12 16:38:36 +08:00
parent cc67ac0184
commit 081f07e259
3 changed files with 60 additions and 236 deletions

View File

@@ -1,5 +1,5 @@
import { useBackend } from '../backend';
import { AnimatedNumber, Box, Section, LabeledList, Button, ProgressBar } from '../components';
import { Box, Section, LabeledList, Button, ProgressBar } from '../components';
import { Fragment } from 'inferno';
import { Window } from '../layouts';
@@ -41,18 +41,6 @@ export const Sleeper = (props, context) => {
}
return 0;
});
const preSortSynth = data.synthchems || [];
const synthchems = preSortSynth.sort((a, b) => {
const descA = a.name.toLowerCase();
const descB = b.name.toLowerCase();
if (descA < descB) {
return -1;
}
if (descA > descB) {
return 1;
}
return 0;
});
return (
<Window
width={310}
@@ -93,15 +81,6 @@ export const Sleeper = (props, context) => {
color="bad" />
</LabeledList.Item>
))}
<LabeledList.Item
label={'Blood'}>
<ProgressBar
value={data.blood_levels/100}
color="bad">
<AnimatedNumber value={data.blood_levels} />
</ProgressBar>
{data.blood_status}
</LabeledList.Item>
<LabeledList.Item
label="Cells"
color={occupant.cloneLoss ? 'bad' : 'good'}>
@@ -116,18 +95,6 @@ export const Sleeper = (props, context) => {
</Fragment>
)}
</Section>
<Section title="Chemical Analysis">
<LabeledList.Item label="Chemical Contents">
{data.chemical_list.map(specificChem => (
<Box
key={specificChem.id}
color="good" >
{specificChem.volume} units of {specificChem.name}
</Box>
),
)}
</LabeledList.Item>
</Section>
<Section
title="Medicines"
minHeight="205px"
@@ -149,33 +116,6 @@ export const Sleeper = (props, context) => {
})} />
))}
</Section>
<Section
title="Synthesize Chemicals">
{synthchems.map(chem => (
<Button
key={chem.name}
content={chem.name}
width="140px"
onClick={() => act('synth', {
chem: chem.id,
})}
/>
))}
</Section>
<Section
title="Purge Chemicals">
{chems.map(chem => (
<Button
key={chem.name}
content={chem.name}
disabled={!(chem.allowed)}
width="140px"
onClick={() => act('purge', {
chem: chem.id,
})}
/>
))}
</Section>
</Window.Content>
</Window>
);

File diff suppressed because one or more lines are too long