mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-17 01:17:29 +02:00
chore: update input field text sizes (#7107)
Make sure that the main input fields have enough space between them and that their size is correct in both light and dark modes.
This commit is contained in:
parent
4a46c8adbf
commit
688bac9f87
@ -29,13 +29,14 @@ const Input = ({
|
|||||||
className,
|
className,
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
|
size = 'small',
|
||||||
...rest
|
...rest
|
||||||
}: IInputProps) => {
|
}: IInputProps) => {
|
||||||
const { classes: styles } = useStyles();
|
const { classes: styles } = useStyles();
|
||||||
return (
|
return (
|
||||||
<StyledDiv data-loading>
|
<StyledDiv data-loading>
|
||||||
<TextField
|
<TextField
|
||||||
size='small'
|
size={size}
|
||||||
variant='outlined'
|
variant='outlined'
|
||||||
label={label}
|
label={label}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
|
@ -15,6 +15,7 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
|
|||||||
import EnvironmentsIcon from '@mui/icons-material/CloudCircle';
|
import EnvironmentsIcon from '@mui/icons-material/CloudCircle';
|
||||||
import { useStickinessOptions } from 'hooks/useStickinessOptions';
|
import { useStickinessOptions } from 'hooks/useStickinessOptions';
|
||||||
import { ReactComponent as ChangeRequestIcon } from 'assets/icons/merge.svg';
|
import { ReactComponent as ChangeRequestIcon } from 'assets/icons/merge.svg';
|
||||||
|
import theme from 'themes/theme';
|
||||||
|
|
||||||
const StyledForm = styled('form')(({ theme }) => ({
|
const StyledForm = styled('form')(({ theme }) => ({
|
||||||
background: theme.palette.background.default,
|
background: theme.palette.background.default,
|
||||||
@ -33,7 +34,7 @@ const TopGrid = styled(StyledFormSection)(({ theme }) => ({
|
|||||||
gridTemplateAreas:
|
gridTemplateAreas:
|
||||||
'"icon header" "icon project-name" "icon project-description"',
|
'"icon header" "icon project-name" "icon project-description"',
|
||||||
gridTemplateColumns: 'auto 1fr',
|
gridTemplateColumns: 'auto 1fr',
|
||||||
gap: theme.spacing(2),
|
gap: theme.spacing(4),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledIcon = styled(ProjectIcon)(({ theme }) => ({
|
const StyledIcon = styled(ProjectIcon)(({ theme }) => ({
|
||||||
@ -59,14 +60,6 @@ const StyledInput = styled(Input)(({ theme }) => ({
|
|||||||
fieldset: { border: 'none' },
|
fieldset: { border: 'none' },
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledProjectName = styled(StyledInput)(({ theme }) => ({
|
|
||||||
'*': { fontSize: theme.typography.h2.fontSize },
|
|
||||||
}));
|
|
||||||
|
|
||||||
const StyledProjectDescription = styled(StyledInput)(({ theme }) => ({
|
|
||||||
'*': { fontSize: theme.typography.h3.fontSize },
|
|
||||||
}));
|
|
||||||
|
|
||||||
const OptionButtons = styled(StyledFormSection)(({ theme }) => ({
|
const OptionButtons = styled(StyledFormSection)(({ theme }) => ({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexFlow: 'row wrap',
|
flexFlow: 'row wrap',
|
||||||
@ -169,7 +162,7 @@ export const NewProjectForm: React.FC<FormProps> = ({
|
|||||||
<StyledIcon aria-hidden='true' />
|
<StyledIcon aria-hidden='true' />
|
||||||
<StyledHeader variant='h2'>New project</StyledHeader>
|
<StyledHeader variant='h2'>New project</StyledHeader>
|
||||||
<ProjectNameContainer>
|
<ProjectNameContainer>
|
||||||
<StyledProjectName
|
<StyledInput
|
||||||
label='Project name'
|
label='Project name'
|
||||||
aria-required
|
aria-required
|
||||||
value={projectName}
|
value={projectName}
|
||||||
@ -181,10 +174,18 @@ export const NewProjectForm: React.FC<FormProps> = ({
|
|||||||
}}
|
}}
|
||||||
data-testid={PROJECT_NAME_INPUT}
|
data-testid={PROJECT_NAME_INPUT}
|
||||||
autoFocus
|
autoFocus
|
||||||
|
InputProps={{
|
||||||
|
style: { fontSize: theme.typography.h1.fontSize },
|
||||||
|
}}
|
||||||
|
InputLabelProps={{
|
||||||
|
style: { fontSize: theme.typography.h1.fontSize },
|
||||||
|
}}
|
||||||
|
size='medium'
|
||||||
/>
|
/>
|
||||||
</ProjectNameContainer>
|
</ProjectNameContainer>
|
||||||
<ProjectDescriptionContainer>
|
<ProjectDescriptionContainer>
|
||||||
<StyledProjectDescription
|
<StyledInput
|
||||||
|
size='medium'
|
||||||
className='description'
|
className='description'
|
||||||
label='Description (optional)'
|
label='Description (optional)'
|
||||||
multiline
|
multiline
|
||||||
@ -192,6 +193,12 @@ export const NewProjectForm: React.FC<FormProps> = ({
|
|||||||
value={projectDesc}
|
value={projectDesc}
|
||||||
onChange={(e) => setProjectDesc(e.target.value)}
|
onChange={(e) => setProjectDesc(e.target.value)}
|
||||||
data-testid={PROJECT_DESCRIPTION_INPUT}
|
data-testid={PROJECT_DESCRIPTION_INPUT}
|
||||||
|
InputProps={{
|
||||||
|
style: { fontSize: theme.typography.h2.fontSize },
|
||||||
|
}}
|
||||||
|
InputLabelProps={{
|
||||||
|
style: { fontSize: theme.typography.h2.fontSize },
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</ProjectDescriptionContainer>
|
</ProjectDescriptionContainer>
|
||||||
</TopGrid>
|
</TopGrid>
|
||||||
|
Loading…
Reference in New Issue
Block a user