Skip to content

Commit

Permalink
Fix code review comments & apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianchircats committed Sep 30, 2024
1 parent b52423f commit b84ea8b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/components/inputs/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ const TextField: React.FC<TextFieldProps> = ({
minValue = -Infinity,
maxValue = Infinity,
variant = 'standard',
helperText,
...rest
}) => {
const isNumeric = receivedIsNumeric || isStepper
Expand Down Expand Up @@ -264,7 +263,6 @@ const TextField: React.FC<TextFieldProps> = ({
className: classes.label,
...InputLabelProps
}}
helperText={helperText || ' '}
/>
)
}
Expand Down Expand Up @@ -370,11 +368,7 @@ TextField.propTypes = {
* @default 'standard'
* The variant to use.
*/
variant: PropTypes.oneOf(['filled', 'standard', 'outlined']),
/**
* Provide feedback to the user about the error.
*/
helperText: PropTypes.string
variant: PropTypes.oneOf(['filled', 'standard', 'outlined'])
}

export default TextField
16 changes: 16 additions & 0 deletions src/components/themes/common/overrides/TextField.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { CustomComponents } from '../../types'

export default function TextField(): CustomComponents {
return {
MuiFormHelperText: {
styleOverrides: {
root: {
'&.Mui-error': {
marginTop: 0,
lineHeight: 1
}
}
}
}
}
}
4 changes: 3 additions & 1 deletion src/components/themes/common/overrides/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Card from './Card'
import Button from './Button'
import Divider from './Divider'
import TextField from './TextField'
import { Theme } from '@mui/material'
import { CustomComponents } from '../../types'

const componentsOverride = (theme: Theme): CustomComponents => ({
...Card(theme),
...Button(theme),
...Divider()
...Divider(),
...TextField()
})
export default componentsOverride

0 comments on commit b84ea8b

Please sign in to comment.