align signon username/password boxes

This commit is contained in:
proddy
2025-11-22 22:58:17 +01:00
parent b9566ae1d6
commit eb71996e6a
2 changed files with 15 additions and 10 deletions

View File

@@ -102,23 +102,27 @@ const SignIn = memo(() => {
width: '100%' width: '100%'
})} })}
> >
<Typography variant="h4">{PROJECT_NAME}</Typography> <Typography mb={1} variant="h4">
{PROJECT_NAME}
</Typography>
<LanguageSelector /> <LanguageSelector />
<Box
<Box display="flex" flexDirection="column" alignItems="center"> mt={1}
display="flex"
flexDirection="column"
gap={1}
alignItems="center"
>
<ValidatedTextField <ValidatedTextField
fieldErrors={fieldErrors || {}} fieldErrors={fieldErrors || {}}
disabled={processing} disabled={processing}
sx={{ sx={{
width: 240 width: '32ch'
}} }}
name="username" name="username"
label={LL.USERNAME(0)} label={LL.USERNAME(0)}
value={signInRequest.username} value={signInRequest.username}
onChange={updateLoginRequestValue} onChange={updateLoginRequestValue}
margin="normal"
variant="outlined"
slotProps={{ slotProps={{
input: { input: {
autoCapitalize: 'none', autoCapitalize: 'none',
@@ -130,14 +134,13 @@ const SignIn = memo(() => {
fieldErrors={fieldErrors || {}} fieldErrors={fieldErrors || {}}
disabled={processing} disabled={processing}
sx={{ sx={{
width: 240 width: '32ch'
}} }}
name="password" name="password"
label={LL.PASSWORD()} label={LL.PASSWORD()}
value={signInRequest.password} value={signInRequest.password}
onChange={updateLoginRequestValue} onChange={updateLoginRequestValue}
onKeyDown={submitOnEnter} onKeyDown={submitOnEnter}
variant="outlined"
/> />
</Box> </Box>

View File

@@ -15,6 +15,7 @@ export type ValidatedTextFieldProps = ValidatedFieldProps & TextFieldProps;
const ValidatedTextField: FC<ValidatedTextFieldProps> = ({ const ValidatedTextField: FC<ValidatedTextFieldProps> = ({
fieldErrors, fieldErrors,
sx,
...rest ...rest
}) => { }) => {
const errors = fieldErrors?.[rest.name]; const errors = fieldErrors?.[rest.name];
@@ -28,7 +29,8 @@ const ValidatedTextField: FC<ValidatedTextFieldProps> = ({
sx={{ sx={{
'& .MuiInputBase-input.Mui-disabled': { '& .MuiInputBase-input.Mui-disabled': {
WebkitTextFillColor: 'grey' WebkitTextFillColor: 'grey'
} },
...(sx || {})
}} }}
{...(rest.disabled && { {...(rest.disabled && {
slotProps: { slotProps: {