lint(gui): use alert and typography blocks
This commit is contained in:
parent
3679735d86
commit
303adcb693
|
@ -1,5 +1,5 @@
|
||||||
import { doesExist, mustExist } from '@apextoaster/js-utils';
|
import { doesExist, mustExist } from '@apextoaster/js-utils';
|
||||||
import { Grid } from '@mui/material';
|
import { Grid, Typography } from '@mui/material';
|
||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { useStore } from 'zustand';
|
import { useStore } from 'zustand';
|
||||||
|
@ -25,7 +25,7 @@ export function ImageHistory() {
|
||||||
children.push(...history.map((item) => <ImageCard key={item.output.key} value={item} onDelete={removeHistory} />));
|
children.push(...history.map((item) => <ImageCard key={item.output.key} value={item} onDelete={removeHistory} />));
|
||||||
} else {
|
} else {
|
||||||
if (doesExist(loading) === false) {
|
if (doesExist(loading) === false) {
|
||||||
children.push(<div>No results. Press Generate.</div>);
|
children.push(<Typography>No results. Press Generate.</Typography>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ export function OnnxError(props: OnnxErrorProps) {
|
||||||
<Box sx={{ my: 4 }}>
|
<Box sx={{ my: 4 }}>
|
||||||
<Stack spacing={2}>
|
<Stack spacing={2}>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
|
||||||
<Typography variant='body1'>
|
<Typography variant='body1'>
|
||||||
This is a web UI for running ONNX models with GPU acceleration or in software, running locally or on a
|
This is a web UI for running ONNX models with GPU acceleration or in software, running locally or on a
|
||||||
remote machine.
|
remote machine.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { doesExist, Maybe, mustDefault, mustExist } from '@apextoaster/js-utils';
|
import { doesExist, Maybe, mustDefault, mustExist } from '@apextoaster/js-utils';
|
||||||
import { PhotoCamera } from '@mui/icons-material';
|
import { PhotoCamera } from '@mui/icons-material';
|
||||||
import { Button, Stack } from '@mui/material';
|
import { Button, Stack, Typography } from '@mui/material';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
export interface ImageInputProps {
|
export interface ImageInputProps {
|
||||||
|
@ -28,13 +28,13 @@ export function ImageInput(props: ImageInputProps) {
|
||||||
}}
|
}}
|
||||||
/>;
|
/>;
|
||||||
} else {
|
} else {
|
||||||
return <div>Please select an image.</div>;
|
return <Typography>Please select an image.</Typography>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return <Stack direction='row' spacing={2}>
|
return <Stack direction='row' spacing={2}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Button component='label' startIcon={<PhotoCamera />}>
|
<Button component='label' startIcon={<PhotoCamera />} variant='outlined'>
|
||||||
{props.label}
|
{props.label}
|
||||||
<input
|
<input
|
||||||
hidden
|
hidden
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { doesExist, mustDefault, mustExist } from '@apextoaster/js-utils';
|
import { doesExist, mustDefault, mustExist } from '@apextoaster/js-utils';
|
||||||
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material';
|
import { Alert, FormControl, InputLabel, MenuItem, Select, Typography } from '@mui/material';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { UseQueryResult } from 'react-query';
|
import { UseQueryResult } from 'react-query';
|
||||||
|
|
||||||
|
@ -42,18 +42,18 @@ export function QueryList<T>(props: QueryListProps<T>) {
|
||||||
|
|
||||||
if (result.status === 'error') {
|
if (result.status === 'error') {
|
||||||
if (result.error instanceof Error) {
|
if (result.error instanceof Error) {
|
||||||
return <div>Error: {result.error.message}</div>;
|
return <Alert severity='error'>Error: {result.error.message}</Alert>;
|
||||||
} else {
|
} else {
|
||||||
return <div>Unknown Error</div>;
|
return <Alert severity='error'>Unknown Error</Alert>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.status === 'loading') {
|
if (result.status === 'loading') {
|
||||||
return <div>Loading...</div>;
|
return <Typography>Loading...</Typography>;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.status === 'idle') {
|
if (result.status === 'idle') {
|
||||||
return <div>Idle?</div>;
|
return <Typography>Idle?</Typography>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// else: success
|
// else: success
|
||||||
|
|
Loading…
Reference in New Issue