-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextField and TextArea components adapted to the new design system #538
Conversation
This pull request has been linked to Shortcut Story #268673: COMPONENTS - Basic components (forms). |
<InputAdornment position='end'> | ||
<IconButton onClick={handleClickShowPassword}> | ||
{showPassword ? <VisibilityOutlined /> : <VisibilityOffOutlined />} | ||
</IconButton> | ||
</InputAdornment> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see the value here. At the beginning I thought we were just going to manage 'password' mode as hardcode. Obviously this makes more sense
import { IconButton, InputAdornment, TextField } from '@mui/material'; | ||
import { VisibilityOffOutlined, VisibilityOutlined } from '@mui/icons-material'; | ||
|
||
const PasswordField = forwardRef(({ style, ...otherProps }, ref) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you extract here 'style' vs 'otherProps'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, is not needed. Removed!
packages/react-ui/src/types.d.ts
Outdated
@@ -219,3 +219,8 @@ type TooltipDataProps = { | |||
]; | |||
title?: string; | |||
}; | |||
|
|||
// PasswordField | |||
export interface PasswordFieldProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need to declare this interface, couldn't we just allow same TextField props?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See this custom TextField here: https://mui.com/material-ui/react-text-field/#customization (eg RedditTextField). It basically passes down all props, using TextFieldProps .
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, totally, removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also cleaned up Button, which had the same unnecessary interface.
Description
Shortcut: #268673
[sc-268673]