@@ -6,12 +6,14 @@ import Common
66import SiteImageView
77
88/// The synced tab cell used in the homepage's Jump Back In section
9- class SyncedTabCell : UICollectionViewCell , ReusableCell , ThemeApplicable , Blurrable , Notifiable {
9+ class SyncedTabCell : UICollectionViewCell , ReusableCell , ThemeApplicable , Blurrable , Notifiable , FeatureFlaggable {
1010 struct UX {
1111 static let heroImageSize = CGSize ( width: 108 , height: 80 )
1212 static let syncedDeviceImageSize = CGSize ( width: 24 , height: 24 )
1313 static let tabStackTopAnchorConstant : CGFloat = 72
1414 static let tabStackTopAnchorCompactPhoneConstant : CGFloat = 24
15+ static let generalCornerRadius : CGFloat = 16
16+ static let heroImageCornerRadius : CGFloat = 13
1517 }
1618
1719 private var syncedDeviceIconFirstBaselineConstraint : NSLayoutConstraint ?
@@ -21,6 +23,10 @@ class SyncedTabCell: UICollectionViewCell, ReusableCell, ThemeApplicable, Blurra
2123 private var showAllSyncedTabsAction : ( @MainActor ( ) -> Void ) ?
2224 private var openSyncedTabAction : ( @MainActor ( ) -> Void ) ?
2325
26+ private var cardCornerRadius : CGFloat {
27+ return isAnyStoriesRedesignEnabled ? UX . generalCornerRadius : HomepageUX . generalCornerRadius
28+ }
29+
2430 // MARK: - UI Elements
2531 private var tabHeroImage : HeroImageView = . build { _ in }
2632
@@ -120,7 +126,9 @@ class SyncedTabCell: UICollectionViewCell, ReusableCell, ThemeApplicable, Blurra
120126
121127 syncedDeviceImage. image = configuration. syncedDeviceImage
122128
129+ let heroImageCornerRadius = isAnyStoriesRedesignEnabled ? UX . heroImageCornerRadius : HomepageUX . generalCornerRadius
123130 let heroViewModel = HomepageHeroImageViewModel ( urlStringRequest: configuration. url. absoluteString,
131+ generalCornerRadius: heroImageCornerRadius,
124132 heroImageSize: UX . heroImageSize)
125133 tabHeroImage. setHeroImage ( heroViewModel)
126134
@@ -174,7 +182,7 @@ class SyncedTabCell: UICollectionViewCell, ReusableCell, ThemeApplicable, Blurra
174182
175183 contentView. layer. shadowPath = UIBezierPath (
176184 roundedRect: contentView. bounds,
177- cornerRadius: HomepageUX . generalCornerRadius
185+ cornerRadius: cardCornerRadius
178186 ) . cgPath
179187 }
180188
@@ -285,9 +293,9 @@ class SyncedTabCell: UICollectionViewCell, ReusableCell, ThemeApplicable, Blurra
285293 }
286294
287295 private func setupShadow( theme: Theme ) {
288- contentView. layer. cornerRadius = HomepageUX . generalCornerRadius
296+ contentView. layer. cornerRadius = cardCornerRadius
289297 contentView. layer. shadowPath = UIBezierPath ( roundedRect: contentView. bounds,
290- cornerRadius: HomepageUX . generalCornerRadius ) . cgPath
298+ cornerRadius: cardCornerRadius ) . cgPath
291299 contentView. layer. shadowRadius = HomepageUX . shadowRadius
292300 contentView. layer. shadowOffset = HomepageUX . shadowOffset
293301 contentView. layer. shadowColor = theme. colors. shadowDefault. cgColor
@@ -314,7 +322,7 @@ class SyncedTabCell: UICollectionViewCell, ReusableCell, ThemeApplicable, Blurra
314322 // Add blur
315323 if shouldApplyWallpaperBlur {
316324 contentView. addBlurEffectWithClearBackgroundAndClipping ( using: . systemThickMaterial)
317- contentView. layer. cornerRadius = HomepageUX . generalCornerRadius
325+ contentView. layer. cornerRadius = cardCornerRadius
318326 } else {
319327 contentView. removeVisualEffectView ( )
320328 contentView. backgroundColor = theme. colors. layer5
0 commit comments