[SignInPage] Remove default RememberMe #4574
Conversation
Netlify deploy preview |
rememberMe optional, add form slotProprememberMe optional
rememberMe optionalrememberMe slot to checkbox
rememberMe slot to checkboxrememberMe slot to checkbox
apedroferreira
left a comment
There was a problem hiding this comment.
Took a look and left some comments!
Overall the idea of the "remember me" slot being more generic and optional with its own component seems good to me.
| passwordField: { variant: 'standard' }, | ||
| submitButton: { variant: 'outlined' }, | ||
| rememberMe: { | ||
| checkbox: { |
There was a problem hiding this comment.
checkbox is more generic than rememberMe so I think it's an improvement, but could we make it more generic even as any type of content could go in this slot, such as a small disclaimer for example, or multiple checkboxes?
Not sure if something like formFooter would be a good name...
Anyway these are just some thoughts!
There was a problem hiding this comment.
Also I see we have a forgotPasswordLink slot too, so if when implementing these you saw that there's a benefit to these slots being more specific then it should be fine.
There was a problem hiding this comment.
Agreed, formFooter makes more sense!
Agreed, I did feel thatforgotPasswordLink and signUpLink seem hyper-specific. If we're offering the entire formFooter area as a slot, perhaps it makes sense to remove forgotPasswordLink entirely with this PR? If someone wants a forgot password link, they can simply add it in their slot component.
I would propose removing forgotPasswordLink, rememberMe and signUpLink to create this structure (including a new form slot to override the entire form):
Wdyt? Also @Janpot and @prakhargupta1
Might make sense to move this to the next release and mark that as having a lot of breaking changes for the SignInPage slots
There was a problem hiding this comment.
Moving those to "plug-in" components seems good to me if they're complex enough!
| `Signing in with "${provider.name}" and credentials: ${formData.get('email')}, ${formData.get('password')} and checkbox value: ${formData.get('tandc')}`, | ||
| ) | ||
| } | ||
| slots={{ checkbox: RememberCheckbox }} |
There was a problem hiding this comment.
What about RememberMeCheckbox, would it be just a bit more descriptive?
| color: 'textSecondary', | ||
| fontSize: theme.typography.pxToRem(14), | ||
| }, | ||
| ...props?.slotProps?.typography, |
There was a problem hiding this comment.
Shouldn't we just spread this inside typography instead?
| import { FormControlLabel, Checkbox } from '@mui/material'; | ||
| import { useTheme } from '@mui/material/styles'; | ||
|
|
||
| interface RememberCheckboxProps { |
There was a problem hiding this comment.
Can't we just allow all slotProps from FormControlLabel and make sure they're passed to the component?
Co-authored-by: Pedro Ferreira <[email protected]> Signed-off-by: Bharat Kashyap <[email protected]>
rememberMe slot to checkboxRememberMe
| label="Remember me" | ||
| {...props} | ||
| control={ | ||
| props.control ? ( |
There was a problem hiding this comment.
Can just do props.control ??, right?
| label: 'Password', | ||
| id: 'password', | ||
| placeholder: '*****', | ||
| placeholder: '***** asdasd', |
There was a problem hiding this comment.
| placeholder: '***** asdasd', | |
| placeholder: '*****', |
Testing leftovers? :D
There was a problem hiding this comment.
😅 Thanks for the catch!
RememberMe RememberMe and add oauthButton
RememberMe and add oauthButtonRememberMe and add oauthButton slotProp
RememberMe and add oauthButton slotPropRememberMe
Breaking Change
Remove the default
rememberMecomponentCloses Provide an option for SignInPage to skip the stack with "Remember Me" and "Forgot Password" #4572
To Do:
rememeberMenull