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-11132 [Homepage] [Message] initial state + view for message card #24271

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

Conversation

cyndichin
Copy link
Contributor

📜 Tickets

Jira ticket
Github issue

💡 Description

Add initial view and state for the message card section for the new homepage.

  • Added MessageCardState with mock string
  • Copied over previous homepage message card view and made modifications to use state instead of view model
  • Add message section to diffable and add configs for compositional layout + message card cells

📝 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)

Screenshot

iPhone

Comment on lines +100 to +104
func configure(state: MessageCardState, theme: Theme) {
applyGleanMessage(with: state.title, description: state.description, buttonLabel: state.buttonLabel)
applyTheme(theme: theme)
ctaButton.applyTheme(theme: theme)
}
Copy link
Contributor Author

@cyndichin cyndichin Jan 21, 2025

Choose a reason for hiding this comment

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

copied most of this class over, mainly changed this method from the original in LegacyHomepageMessageCardCell. Also moved the shadow constants used in setupShadow here instead of calling it from HomepageViewModel

Previous implementation

func configure(viewModel: HomepageMessageCardViewModel, theme: Theme) {
        self.viewModel = viewModel

        if let message = viewModel.getMessage(for: .newTabCard) {
            applyGleanMessage(message)
        }

        applyTheme(theme: theme)
        ctaButton.applyTheme(theme: theme)
    }
    ```
   
 

@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Jan 21, 2025

Messages
📖 Project coverage: 33.49%
📖 Edited 10 files
📖 Created 3 files

Client.app: Coverage: 32.31

File Coverage
HomepageState.swift 92.94%
HomepageSectionType.swift 41.07% ⚠️
HomepageMessageCardCell.swift 0.0% ⚠️
HomepageMessageCardViewModel.swift 77.01%
HomepageSectionLayoutProvider.swift 48.81% ⚠️
HomepageDiffableDataSource.swift 100.0%
MessageCardState.swift 97.78%
HomepageViewController.swift 45.65% ⚠️
HomepageMessageCard.swift 65.09%

Generated by 🚫 Danger Swift against 9ccd9cd

@cyndichin cyndichin marked this pull request as ready for review January 21, 2025 19:05
@cyndichin cyndichin requested a review from a team as a code owner January 21, 2025 19:05
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