Skip to content
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

[auth] style password complexity on sign in #39

Merged
merged 8 commits into from
Nov 26, 2023

Conversation

InayaY3
Copy link
Collaborator

@InayaY3 InayaY3 commented Nov 8, 2023

What's new in this PR

on sign in screen, now checks for the 4 requirements for password complexity (minimum 1 uppercase, 1 lowercase, 1 number, and 8 characters total) and updates it beneath the password input with a check/x icon and green/red. also disables sign up button until complexity is met.

Relevant Links

n/a

Notion Sprint Task

https://www.notion.so/calblueprint/auth-Style-login-signup-screens-726c755253824e5bb89498c578e2e103

Online sources

n/a

Related PRs

styling that adi is working on?

How to review

n/a

Next steps

dependent on adi's styling

Tests Performed, Edge Cases

n/a

Screenshots

RPReplay_Final1699411672

CC: @akshaynthakur

@akshaynthakur akshaynthakur self-requested a review November 8, 2023 09:18
Copy link
Collaborator

@akshaynthakur akshaynthakur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work! Very impressed by your handling of all the complexity associated with this task. Most of the comments I left are just styling nit picks, but please Slack me if you have any questions about any of the changes I requested!

import { Button, Input } from 'react-native-elements';

import Icon from '../../../assets/icons';
import color from '../../styles/colors';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now your PR is failing checks because you're accidentally importing from the same file twice. Delete line 7 (the wrong import) and you should be good!

value={password}
secureTextEntry
placeholder="Password"
autoCapitalize="none"
/>
</View>
<View>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This outermost View is unnecessary

</View>
<View>
{password !== '' && (
<View style={globalStyles.passwordComplexity}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to add the styles for passwordComplexity to globalStyles, because this style is only going to be used on this screen. Create a styles sheet at the bottom of this file (look at verify.tsx as an example) and move this set of styles there instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looking at the designs, we have 8 pixels of padding between each password complexity line of text. If you add paddingBottom: 8 to your passwordComplexity styles, this should fix it.

: { color: colors.textRed }
}
>
At least 1 uppercase letter.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit pick, but to match the designs exactly, let's remove periods from the ends of all of the complexity text lines

<Text
style={
hasLowercase
? { color: colors.textGreen }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: looking at the designs, we want this fontSize to be 12 and there to be a gap of 8 between the icon and the text. To do this, we can replace these lines with
style={[ styles.errorText, hasLength ? { color: colors.textGreen } : { color: colors.textRed }, ]}
where the styles for errorText include fontSize: 12 and marginLeft: 8

Comment on lines 74 to 77
passwordComplexity: {
display: 'flex',
flexDirection: 'row',
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete from globalStyles once moved into the local styles sheet

@akshaynthakur akshaynthakur merged commit 72a750d into main Nov 26, 2023
2 checks passed
@akshaynthakur akshaynthakur deleted the inaya/auth-style-login-signup branch November 26, 2023 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants