fix: mui grid has been deprecated

This commit is contained in:
huzibaca 2024-11-13 00:21:22 +08:00
parent 9d9cf27460
commit c37f22dc65
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302

View File

@ -8,7 +8,8 @@ import { useLockFn } from "ahooks";
import { import {
TextField, TextField,
Button, Button,
Grid, Grid2,
Box,
Stack, Stack,
IconButton, IconButton,
InputAdornment, InputAdornment,
@ -125,10 +126,10 @@ export const BackupConfigViewer = memo(
return ( return (
<form onSubmit={(e) => e.preventDefault()}> <form onSubmit={(e) => e.preventDefault()}>
<Grid container spacing={2}> <Grid2 container spacing={2}>
<Grid item xs={12} sm={9}> <Grid2 size={{ xs: 12, sm: 9 }}>
<Grid container spacing={2}> <Grid2 container spacing={2}>
<Grid item xs={12}> <Grid2 size={{ xs: 12 }}>
<TextField <TextField
fullWidth fullWidth
label={t("WebDAV Server URL")} label={t("WebDAV Server URL")}
@ -140,8 +141,8 @@ export const BackupConfigViewer = memo(
spellCheck="false" spellCheck="false"
inputRef={urlRef} inputRef={urlRef}
/> />
</Grid> </Grid2>
<Grid item xs={6}> <Grid2 size={{ xs: 6 }}>
<TextField <TextField
label={t("Username")} label={t("Username")}
variant="outlined" variant="outlined"
@ -152,8 +153,8 @@ export const BackupConfigViewer = memo(
spellCheck="false" spellCheck="false"
inputRef={usernameRef} inputRef={usernameRef}
/> />
</Grid> </Grid2>
<Grid item xs={6}> <Grid2 size={{ xs: 6 }}>
<TextField <TextField
label={t("Password")} label={t("Password")}
type={showPassword ? "text" : "password"} type={showPassword ? "text" : "password"}
@ -177,10 +178,10 @@ export const BackupConfigViewer = memo(
), ),
}} }}
/> />
</Grid> </Grid2>
</Grid> </Grid2>
</Grid> </Grid2>
<Grid item xs={12} sm={3}> <Grid2 size={{ xs: 12, sm: 3 }}>
<Stack <Stack
direction="column" direction="column"
justifyContent="center" justifyContent="center"
@ -212,8 +213,8 @@ export const BackupConfigViewer = memo(
</Button> </Button>
)} )}
</Stack> </Stack>
</Grid> </Grid2>
</Grid> </Grid2>
</form> </form>
); );
} }