mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
align signon username/password boxes
This commit is contained in:
@@ -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>
|
||||||
|
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user