Skip to content

Commit

Permalink
Update the design of the hide this prompt for the quick start cards
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed May 30, 2023
1 parent d572d0d commit 55865bb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,37 @@ final class DashboardQuickStartCardCell: UICollectionViewCell, Reusable, BlogDas
fallthrough

case .newSite:
configureOnEllipsisButtonTap(sourceRect: cardFrameView.ellipsisButton.frame)
configureOnEllipsisButtonTap(sourceRect: cardFrameView.ellipsisButton.frame, blog: blog)
cardFrameView.showHeader()

case .existingSite:
cardFrameView.configureButtonContainerStackView()
configureOnEllipsisButtonTap(sourceRect: cardFrameView.buttonContainerStackView.frame)
configureOnEllipsisButtonTap(sourceRect: cardFrameView.buttonContainerStackView.frame, blog: blog)
cardFrameView.hideHeader()

}

cardFrameView.setTitle(Strings.title(for: blog.quickStartType))
}

private func configureOnEllipsisButtonTap(sourceRect: CGRect) {
cardFrameView.onEllipsisButtonTap = { [weak self] in
guard let self = self,
let viewController = self.viewController,
let blog = self.blog else {
return
private func configureOnEllipsisButtonTap(sourceRect: CGRect, blog: Blog) {
if FeatureFlag.personalizeHomeTab.enabled {
cardFrameView.onEllipsisButtonTap = {
BlogDashboardAnalytics.trackContextualMenuAccessed(for: .quickStart)
}
cardFrameView.ellipsisButton.showsMenuAsPrimaryAction = true
cardFrameView.ellipsisButton.menu = UIMenu(title: "", options: .displayInline, children: [
BlogDashboardHelpers.makeHideCardAction(for: .quickStart, siteID: blog.dotComID?.intValue ?? 0)
])
} else {
cardFrameView.onEllipsisButtonTap = { [weak self] in
guard let self = self,
let viewController = self.viewController,
let blog = self.blog else {
return
}
viewController.removeQuickStart(from: blog, sourceView: self.cardFrameView, sourceRect: sourceRect)
}
viewController.removeQuickStart(from: blog, sourceView: self.cardFrameView, sourceRect: sourceRect)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private extension DashboardCard {
assertionFailure(".quickStart card should only appear in the personalization menu if there are remaining steps")
return ""
case .existingSite:
return NSLocalizedString("personalizeHome.dashboardCard.nextSteps", value: "Get to know the app", comment: "Card title for the pesonalization menu")
return NSLocalizedString("personalizeHome.dashboardCard.getToKnowTheApp", value: "Get to know the app", comment: "Card title for the pesonalization menu")
case .newSite:
return NSLocalizedString("personalizeHome.dashboardCard.nextSteps", value: "Next steps", comment: "Card title for the pesonalization menu")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ final class BlogDashboardPersonalizationViewModelTests: XCTestCase {
}
}


func testThatQuickStartCardsIsNotDisplayedWhenTourIsActive() {
// Given
viewModel = BlogDashboardPersonalizationViewModel(service: service, quickStartType: .newSite)
Expand Down

0 comments on commit 55865bb

Please sign in to comment.