-
Notifications
You must be signed in to change notification settings - Fork 130
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
[Jetpack Setup] Use Magic Link for suspicious emails #13409
base: trunk
Are you sure you want to change the base?
Changes from all commits
ab7ca90
22170a7
625a017
05b91fe
911a2e0
ab371ba
ede70fe
0a3860d
3801a1e
9653e9c
2f12442
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 |
---|---|---|
|
@@ -101,7 +101,11 @@ fun JetpackActivationWPComEmailScreen( | |
WCOutlinedTextField( | ||
value = viewState.emailOrUsername, | ||
onValueChange = onEmailChanged, | ||
label = stringResource(id = R.string.email_or_username), | ||
label = if (viewState.usernameOnly) { | ||
stringResource(R.string.username) | ||
} else { | ||
stringResource(id = R.string.email_or_username) | ||
}, | ||
isError = viewState.errorMessage != null, | ||
helperText = viewState.errorMessage?.let { stringResource(id = it) }, | ||
singleLine = true, | ||
|
@@ -114,10 +118,12 @@ fun JetpackActivationWPComEmailScreen( | |
) | ||
) | ||
Spacer(modifier = Modifier.height(dimensionResource(id = R.dimen.major_100))) | ||
Text( | ||
style = MaterialTheme.typography.body2, | ||
text = stringResource(id = R.string.login_jetpack_connection_create_account) | ||
) | ||
if (!viewState.usernameOnly) { | ||
Text( | ||
style = MaterialTheme.typography.body2, | ||
text = stringResource(id = R.string.login_jetpack_connection_create_account) | ||
) | ||
} | ||
} | ||
|
||
Spacer(modifier = Modifier.weight(1f)) | ||
|
@@ -162,6 +168,7 @@ private fun JetpackActivationWPComScreenPreview() { | |
WooThemeWithBackground { | ||
JetpackActivationWPComEmailScreen( | ||
viewState = JetpackActivationWPComEmailViewModel.ViewState( | ||
usernameOnly = false, | ||
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. Please correct me if I'm mistaken. We were using this screen with a text field labeled "email or username". Now, we've added I'm considering whether we should rename the class from |
||
emailOrUsername = "", | ||
isJetpackInstalled = false | ||
) | ||
|
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.
A minor suggestion: We can move this logic to the view model. So, the
ViewState
can only havefallbackButtonText
.