Skip to content

Commit

Permalink
Add bookmarks a11y id and finish converting the cell to bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Amin authored and Sophie Amin committed Jun 13, 2024
1 parent a27189d commit 9205caa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions firefox-ios/Client/Application/AccessibilityIdentifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public struct AccessibilityIdentifiers {
static let itemCell = "JumpBackInCell"
}

struct RecentlySaved {
static let itemCell = "RecentlySavedCell"
struct Bookmarks {
static let itemCell = "BookmarksCell"
}

struct SyncedTab {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BookmarksCell: UICollectionViewCell, ReusableCell {
super.init(frame: .zero)

isAccessibilityElement = true
accessibilityIdentifier = AccessibilityIdentifiers.FirefoxHomepage.RecentlySaved.itemCell
accessibilityIdentifier = AccessibilityIdentifiers.FirefoxHomepage.Bookmarks.itemCell

setupLayout()
}
Expand All @@ -55,7 +55,7 @@ class BookmarksCell: UICollectionViewCell, ReusableCell {
cornerRadius: HomepageViewModel.UX.generalCornerRadius).cgPath
}

func configure(viewModel: RecentlySavedCellViewModel, theme: Theme) {
func configure(viewModel: BookmarksCellViewModel, theme: Theme) {
let heroImageViewModel = HomepageHeroImageViewModel(urlStringRequest: viewModel.site.url,
heroImageSize: UX.heroImageSize)
heroImageView.setHeroImage(heroImageViewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Shared

import enum MozillaAppServices.VisitType

struct RecentlySavedCellViewModel {
struct BookmarksCellViewModel {
let site: Site
var accessibilityLabel: String {
return "\(site.title)"
Expand Down Expand Up @@ -132,7 +132,7 @@ extension RecentlySavedViewModel: HomepageSectionHandler {

if let item = recentItems[safe: indexPath.row] {
let site = Site(url: item.url, title: item.title, bookmarked: true)
let viewModel = RecentlySavedCellViewModel(site: site)
let viewModel = BookmarksCellViewModel(site: site)
recentlySavedCell.configure(viewModel: viewModel, theme: theme)
}

Expand Down

0 comments on commit 9205caa

Please sign in to comment.