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

Magic Links: UI Updates Mk1 #1194

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions Simplenote/AuthViewController+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,23 @@ extension AuthViewController {
// Secondary Action
secondaryActionButton.contentTintColor = .simplenoteBrandColor

// Toggle Signup: Tip
switchTipField.textColor = .simplenoteTertiaryTextColor

// Toggle Signup: Action
switchActionButton.contentTintColor = .simplenoteBrandColor

// WordPress SSO
wordPressSSOButton.image = NSImage(named: .wordPressLogo)?.tinted(with: .simplenoteBrandColor)
wordPressSSOButton.title = Localization.dotcomSSOAction
wordPressSSOButton.contentTintColor = .simplenoteTertiaryTextColor
wordPressSSOButton.contentTintColor = .white
wordPressSSOContainerView.wantsLayer = true
wordPressSSOContainerView.layer?.backgroundColor = NSColor.simplenoteWPBlue50Color.cgColor
wordPressSSOContainerView.layer?.cornerRadius = 5

setupActionsSeparatorView()
}

private func setupActionsSeparatorView() {
leadingSeparatorView.wantsLayer = true
leadingSeparatorView.layer?.backgroundColor = NSColor.lightGray.cgColor
trailingSeparatorView.wantsLayer = true
trailingSeparatorView.layer?.backgroundColor = NSColor.lightGray.cgColor

separatorLabel.textColor = .lightGray
}
}

Expand Down Expand Up @@ -67,8 +74,6 @@ extension AuthViewController {
func refreshButtonTitles() {
actionButton.title = mode.primaryActionText
secondaryActionButton.title = mode.secondaryActionText?.uppercased() ?? ""
switchTipField.stringValue = mode.switchActionTip.uppercased()
switchActionButton.title = mode.switchActionText.uppercased()
}

/// Makes sure unused components (in the current mode) are effectively disabled
Expand Down Expand Up @@ -102,7 +107,7 @@ extension AuthViewController {
secondaryActionButton.alphaValue = mode.secondaryActionFieldAlpha
wordPressSSOButton.alphaValue = mode.wordPressSSOFieldAlpha

switchAuthenticationView.isHidden = !mode.isSwitchVisible
actionsSeparatorView.isHidden = !mode.showActionSeparator
}

/// Animates Visible / Invisible components, based on the specified state
Expand Down Expand Up @@ -167,11 +172,6 @@ extension AuthViewController {
performSelector(onMainThread: secondaryActionSelector, with: nil, waitUntilDone: false)
}

@IBAction
func switchAuthenticationMode(_ sender: Any) {
containingNavigationController?.push(nextViewController())
}

private func nextViewController() -> AuthViewController {
let nextMode = mode.nextMode()

Expand All @@ -181,6 +181,11 @@ extension AuthViewController {

return nextVC
}

@objc
func pushEmailLoginView() {
containingNavigationController?.push(nextViewController())
}
}


Expand Down
7 changes: 4 additions & 3 deletions Simplenote/AuthViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
@property (nonatomic, strong) IBOutlet NSButton *actionButton;
@property (nonatomic, strong) IBOutlet NSProgressIndicator *actionProgress;
@property (nonatomic, strong) IBOutlet NSButton *secondaryActionButton;
@property (nonatomic, strong) IBOutlet NSTextField *switchTipField;
@property (nonatomic, strong) IBOutlet NSButton *switchActionButton;
@property (nonatomic, strong) IBOutlet NSView *wordPressSSOContainerView;
@property (nonatomic, strong) IBOutlet NSButton *wordPressSSOButton;
@property (weak) IBOutlet NSView *switchAuthenticationView;
@property (weak) IBOutlet NSView *actionsSeparatorView;
@property (weak) IBOutlet NSView *leadingSeparatorView;
@property (weak) IBOutlet NSTextField *separatorLabel;
@property (weak) IBOutlet NSView *trailingSeparatorView;

@property (nonatomic, strong) IBOutlet NSLayoutConstraint *passwordFieldHeightConstraint;
@property (nonatomic, strong) IBOutlet NSLayoutConstraint *secondaryActionHeightConstraint;
Expand Down
1 change: 0 additions & 1 deletion Simplenote/AuthViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ - (void)setInterfaceEnabled:(BOOL)enabled {
[self.passwordField setEnabled:enabled];
[self.actionButton setEnabled:enabled];
[self.secondaryActionButton setEnabled:enabled];
[self.switchActionButton setEnabled:enabled];
[self.wordPressSSOButton setEnabled:enabled];
}

Expand Down
Loading