loading icon for goals
This commit is contained in:
@@ -173,7 +173,7 @@ function Level() {
|
|||||||
<Button disabled={levelId <= 1} component={RouterLink} to={`/world/${worldId}/level/${levelId - 1}`} sx={{ ml: 3, mt: 2, mb: 2 }} disableFocusRipple>Previous Level</Button>
|
<Button disabled={levelId <= 1} component={RouterLink} to={`/world/${worldId}/level/${levelId - 1}`} sx={{ ml: 3, mt: 2, mb: 2 }} disableFocusRipple>Previous Level</Button>
|
||||||
<Button disabled={levelId >= gameInfo.data?.worldSize[worldId]} component={RouterLink} to={`/world/${worldId}/level/${levelId + 1}`} sx={{ ml: 3, mt: 2, mb: 2 }} disableFocusRipple>Next Level</Button>
|
<Button disabled={levelId >= gameInfo.data?.worldSize[worldId]} component={RouterLink} to={`/world/${worldId}/level/${levelId + 1}`} sx={{ ml: 3, mt: 2, mb: 2 }} disableFocusRipple>Next Level</Button>
|
||||||
|
|
||||||
<Infoview leanClient={connection.getLeanClient()} editor={editor} editorApi={infoProvider?.getApi()} />
|
<Infoview key={worldId + "/Level" + levelId} leanClient={connection.getLeanClient()} editor={editor} editorApi={infoProvider?.getApi()} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import '@fontsource/roboto/700.css';
|
|||||||
|
|
||||||
import List from '@mui/material/List';
|
import List from '@mui/material/List';
|
||||||
import ListItem from '@mui/material/ListItem';
|
import ListItem from '@mui/material/ListItem';
|
||||||
import { Paper, Box, Typography, Alert, FormControlLabel, FormGroup, Switch, Collapse } from '@mui/material';
|
import { Paper, Box, Typography, Alert, FormControlLabel, FormGroup, Switch, Collapse, CircularProgress } from '@mui/material';
|
||||||
import { Accordion, AccordionSummary, AccordionDetails, Divider } from '@mui/material';
|
import { Accordion, AccordionSummary, AccordionDetails, Divider } from '@mui/material';
|
||||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||||
|
|
||||||
@@ -97,6 +97,7 @@ function OtherGoal({ goal }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function TacticState({ goals, diagnostics, completed, globalDiagnostics }) {
|
function TacticState({ goals, diagnostics, completed, globalDiagnostics }) {
|
||||||
|
const isLoading = goals === null
|
||||||
const hasGoal = goals !== null && goals.length > 0
|
const hasGoal = goals !== null && goals.length > 0
|
||||||
const hasManyGoal = hasGoal && goals.length > 1
|
const hasManyGoal = hasGoal && goals.length > 1
|
||||||
|
|
||||||
@@ -116,7 +117,8 @@ function TacticState({ goals, diagnostics, completed, globalDiagnostics }) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Goal goal={goals[0]} />
|
<Goal goal={goals[0]} />
|
||||||
</Paper>}
|
</Paper>}
|
||||||
{!(hasGoal || completed) &&
|
{isLoading && <CircularProgress />}
|
||||||
|
{!(hasGoal || completed || isLoading) &&
|
||||||
<Typography variant="h6">
|
<Typography variant="h6">
|
||||||
No goals
|
No goals
|
||||||
(at <FontAwesomeIcon icon={faArrowPointer}></FontAwesomeIcon>)
|
(at <FontAwesomeIcon icon={faArrowPointer}></FontAwesomeIcon>)
|
||||||
|
|||||||
Reference in New Issue
Block a user