Skip to content

Commit

Permalink
Merge pull request #1613 from Automattic/lantean/adjusting-copy
Browse files Browse the repository at this point in the history
Magic Links: Adjusting Copy
  • Loading branch information
jleandroperez committed Jul 15, 2024
2 parents 94f66ad + 6d779c0 commit 747c3ef
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
3 changes: 2 additions & 1 deletion Simplenote/Classes/MagicLinkAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ private extension MagicLinkAuthenticator {
authenticator.authenticate(withUsername: confirmation.username, token: confirmation.syncToken)

NotificationCenter.default.post(name: .magicLinkAuthDidSucceed, object: nil)
SPTracker.trackUserConfirmedLoginLink()
SPTracker.trackLoginLinkConfirmationSuccess()
}

} catch {
NSLog("[MagicLinkAuthenticator] Magic Link TokenExchange Error: \(error)")
NotificationCenter.default.post(name: .magicLinkAuthDidFail, object: error)
SPTracker.trackLoginLinkConfirmationFailure()
}
}

Expand Down
2 changes: 1 addition & 1 deletion Simplenote/Classes/SPAuthViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private extension SPAuthViewController {
self.handleError(error: error)
} else {
self.presentMagicLinkRequestedView(email: email)
SPTracker.trackUserRequestedLoginLink()
SPTracker.trackLoginLinkRequested()
}

self.unlockInterface()
Expand Down
7 changes: 5 additions & 2 deletions Simplenote/Classes/SPTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@
#pragma mark - User
+ (void)trackUserAccountCreated;
+ (void)trackUserSignedIn;
+ (void)trackUserRequestedLoginLink;
+ (void)trackUserConfirmedLoginLink;
+ (void)trackUserSignedOut;

#pragma mark - Login Links
+ (void)trackLoginLinkRequested;
+ (void)trackLoginLinkConfirmationSuccess;
+ (void)trackLoginLinkConfirmationFailure;

#pragma mark - WP.com Sign In
+ (void)trackWPCCButtonPressed;
+ (void)trackWPCCLoginSucceeded;
Expand Down
21 changes: 15 additions & 6 deletions Simplenote/Classes/SPTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -317,21 +317,30 @@ + (void)trackUserSignedIn
[self trackAutomatticEventWithName:@"user_signed_in" properties:nil];
}

+ (void)trackUserRequestedLoginLink
+ (void)trackUserSignedOut
{
[self trackAutomatticEventWithName:@"user_requested_login_link" properties:nil];
[self trackAutomatticEventWithName:@"user_signed_out" properties:nil];
}

+ (void)trackUserConfirmedLoginLink

#pragma mark - Login Links

+ (void)trackLoginLinkRequested
{
[self trackAutomatticEventWithName:@"user_confirmed_login_link" properties:nil];
[self trackAutomatticEventWithName:@"login_link_requested" properties:nil];
}

+ (void)trackUserSignedOut
+ (void)trackLoginLinkConfirmationSuccess
{
[self trackAutomatticEventWithName:@"user_signed_out" properties:nil];
[self trackAutomatticEventWithName:@"login_link_confirmation_success" properties:nil];
}

+ (void)trackLoginLinkConfirmationFailure
{
[self trackAutomatticEventWithName:@"login_link_confirmation_failure" properties:nil];
}


#pragma mark - WP.com Sign In

+ (void)trackWPCCButtonPressed
Expand Down
13 changes: 4 additions & 9 deletions Simplenote/MagicLinkInvalidView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ struct MagicLinkInvalidView: View {
.renderingMode(.template)
.foregroundColor(Color(.simplenoteLightBlueColor))

Text("Invalid Link")
Text("Link no longer valid")
.bold()
.font(.system(size: Metrics.titleFontSize))
.padding()

Text("Your authentication link is no longer valid")
.font(.system(size: Metrics.detailsFontSize))
.multilineTextAlignment(.center)
.padding(.bottom, Metrics.detailsPaddingBottom)
.padding(.bottom, Metrics.titlePaddingBottom)

Button(action: pressedRequestNewLink) {
Text("Request a new Link")
Expand Down Expand Up @@ -71,9 +67,8 @@ struct MagicLinkInvalidView: View {
private enum Metrics {
static let crossIconSize = CGSize(width: 100, height: 100)
static let dismissSize = CGSize(width: 30, height: 30)
static let titleFontSize: CGFloat = 22
static let detailsFontSize: CGFloat = 17
static let detailsPaddingBottom: CGFloat = 30
static let titleFontSize: CGFloat = 20
static let titlePaddingBottom: CGFloat = 30
static let actionCornerRadius: CGFloat = 10
}

Expand Down

0 comments on commit 747c3ef

Please sign in to comment.