-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Verify] Update new-architecture input fields on base screens to pass through all textfield props #461
[Verify] Update new-architecture input fields on base screens to pass through all textfield props #461
Changes from 2 commits
7cbad8c
5a0b293
2088ce7
7fb3409
466d99f
f10d723
b77ef4d
78327b5
bff6f1d
3ee716b
2b7e035
7501b30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ export const SetPassword: React.FC<React.PropsWithChildren<SetPasswordProps>> = | |
confirmRef, | ||
passwordNotMatchError, | ||
onSubmit, | ||
passwordTextFieldProps, | ||
confirmPasswordTextFieldProps, | ||
} = props; | ||
const theme = useTheme(); | ||
|
||
|
@@ -84,13 +86,15 @@ export const SetPassword: React.FC<React.PropsWithChildren<SetPasswordProps>> = | |
inputRef={passwordRef} | ||
label={newPasswordLabel} | ||
value={passwordInput} | ||
error={shouldValidatePassword && !isValidPassword()} | ||
sx={TextFieldStyles(theme)} | ||
{...passwordTextFieldProps} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any particular reason the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for the other spreads you added in this pull request There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To override the defaults which we set in the base screen components, spreaded the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not understand. I see that you still have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just had a discussion with Joe in Office hours regarding this, so we need to merge events with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just so I know, why do we have both of these? just for theme aware items? plus additional sx styles? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Raised a PR for removed passing theme object to functions to generate styles. sx prop is for adding styles. |
||
onChange={(evt: ChangeEvent<HTMLInputElement>): void => onPassChange(evt.target.value)} | ||
onKeyUp={(e): void => { | ||
if (e.key === 'Enter' && confirmRef.current) { | ||
confirmRef.current.focus(); | ||
} | ||
}} | ||
error={shouldValidatePassword && !isValidPassword()} | ||
onBlur={(): void => setShouldValidatePassword(true)} | ||
/> | ||
{passwordRequirements && passwordRequirements.length > 0 && ( | ||
|
@@ -108,17 +112,18 @@ export const SetPassword: React.FC<React.PropsWithChildren<SetPasswordProps>> = | |
label={confirmPasswordLabel} | ||
sx={TextFieldStyles(theme)} | ||
value={confirmInput} | ||
onChange={(evt: ChangeEvent<HTMLInputElement>): void => onConfirmChange(evt.target.value)} | ||
onKeyUp={(e): void => { | ||
if (e.key === 'Enter' && onSubmit) onSubmit(); | ||
}} | ||
error={hasConfirmPasswordError()} | ||
helperText={hasConfirmPasswordError() ? passwordNotMatchError : ''} | ||
icon={ | ||
confirmInput.length !== 0 && isValidPassword() && confirmInput === passwordInput ? ( | ||
<CheckCircleOutlinedIcon data-testid="check" color="success" /> | ||
) : undefined | ||
} | ||
{...confirmPasswordTextFieldProps} | ||
onChange={(evt: ChangeEvent<HTMLInputElement>): void => onConfirmChange(evt.target.value)} | ||
onKeyUp={(e): void => { | ||
if (e.key === 'Enter' && onSubmit) onSubmit(); | ||
}} | ||
onBlur={(): void => setShouldValidateConfirmPassword(true)} | ||
/> | ||
</> | ||
|
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 need to merge OnPasswordChange here like https://github.com/etn-ccis/blui-react-workflows/blob/dev/login-workflow/src/screens/AccountDetailsScreen/AccountDetailsScreen.tsx#L142.
Same comment for other screens