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

Add FXIOS-10318 [Menu] Populate account header with data & redux #22718

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

dicarobinho
Copy link
Collaborator

📜 Tickets

Jira ticket
Github issue

💡 Description

Implemented the functionality for the Menu account header

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

@dicarobinho dicarobinho marked this pull request as ready for review October 23, 2024 13:44
@dicarobinho dicarobinho requested a review from a team as a code owner October 23, 2024 13:44
Copy link
Contributor

mergify bot commented Oct 23, 2024

This pull request has conflicts when rebasing. Could you fix it @dicarobinho? 🙏

@adudenamedruby adudenamedruby changed the title Add FXIOS-10318 ⁃ Populate account header with data & redux Add FXIOS-10318 [Menu] Populate account header with data & redux Oct 23, 2024
@@ -178,6 +190,24 @@ public final class HeaderView: UIView, ThemeApplicable {
titleLabel.text = title
}

public func setupDetails(subtitle: String, title: String, icon: UIImage?, warningIcon: String?, theme: Theme) {
titleLabel.font = FXFontStyles.Regular.body.scaledFont()
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be in the title label setup, as it doesn't change, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, so body can be by default... will move it to the label setup.

Comment on lines 167 to 172
let title: String = {
if needsReAuth {
return .MainMenu.Account.SyncErrorTitle
}
return userProfile.displayName ?? userProfile.email
}()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let title: String = {
if needsReAuth {
return .MainMenu.Account.SyncErrorTitle
}
return userProfile.displayName ?? userProfile.email
}()
let title: String = if needsReAuth {
return .MainMenu.Account.SyncErrorTitle
} else {
return userProfile.displayName ?? userProfile.email
}

An alternative; but if you use this, please indent with Xcode because I just copy pasted here. No strong opinions on which to use, just pointing out the option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just got some errors after changed the code, maybe something else should be changed. Lets keep this, as it is.

# Conflicts:
#	firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift
#	firefox-ios/Client/Frontend/Browser/MainMenu/MainMenuCoordinator.swift
#	firefox-ios/Client/Frontend/Browser/MainMenu/Redux/MenuNavigationDestination.swift
@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Oct 24, 2024

Messages
📖 Project coverage: 32.66%
📖 Edited 7 files
📖 Created 0 files

Client.app: Coverage: 30.52

File Coverage
BrowserCoordinator.swift 71.46%
MenuNavigationDestination.swift 100.0%
MainMenuCoordinator.swift 84.75%
MainMenuViewController.swift 23.38% ⚠️
MainMenuState.swift 64.44%

ComponentLibrary: Coverage: 30.97

File Coverage
HeaderView.swift 35.9% ⚠️

Generated by 🚫 Danger Swift against 4d9b292

@@ -35,6 +35,8 @@ enum MainMenuActionType: ActionType {
case tapShowDetailsView
case tapToggleUserAgent
case updateCurrentTabInfo
case closeMenu
Copy link
Contributor

Choose a reason for hiding this comment

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

These have been removed/renamed in a previous PR. You'll have to remove them and fix with the appropriate updated names (tapCloseMenuand tapNavigateToDestination)

Copy link
Contributor

mergify bot commented Oct 24, 2024

This pull request has conflicts when rebasing. Could you fix it @dicarobinho? 🙏

# Conflicts:
#	firefox-ios/Client/Frontend/Browser/MainMenu/MainMenuCoordinator.swift
#	firefox-ios/Client/Frontend/Browser/MainMenu/Redux/MenuNavigationDestination.swift
@adudenamedruby
Copy link
Contributor

Also, when you're refactoring this, like we talked about, can you fix the padding on the header too? Kill two birds with one stone! :D

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.

3 participants