mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Hide SF display when no SFs owned
This commit is contained in:
parent
81f971b52e
commit
a4bc793cf1
@ -65,12 +65,15 @@ export function SourceFilesElement(): React.ReactElement {
|
||||
|
||||
const [selectedSf, setSelectedSf] = useState<any>(sourceSfs[0]);
|
||||
|
||||
if (sourceSfs.length === 0) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
<Box sx={{ width: "100%", mt: 1 }}>
|
||||
<Paper sx={{ p: 1 }}>
|
||||
<Typography variant="h5">Source Files</Typography>
|
||||
</Paper>
|
||||
{sourceSfs.length > 0 ? (
|
||||
<Paper sx={{ display: "grid", gridTemplateColumns: "1fr 3fr" }}>
|
||||
<Box>
|
||||
<List
|
||||
@ -102,12 +105,7 @@ export function SourceFilesElement(): React.ReactElement {
|
||||
const maxLevel = sfObj?.n === 12 ? "∞" : "3";
|
||||
|
||||
return (
|
||||
<ListItemButton
|
||||
key={i + 1}
|
||||
onClick={() => setSelectedSf(e)}
|
||||
selected={selectedSf === e}
|
||||
sx={{ py: 0 }}
|
||||
>
|
||||
<ListItemButton key={i + 1} onClick={() => setSelectedSf(e)} selected={selectedSf === e} sx={{ py: 0 }}>
|
||||
<ListItemText
|
||||
disableTypography
|
||||
primary={<Typography>{sfObj.name}</Typography>}
|
||||
@ -155,9 +153,6 @@ export function SourceFilesElement(): React.ReactElement {
|
||||
</Typography>
|
||||
</Box>
|
||||
</Paper>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user