Skip to content

Commit

Permalink
Offset centered NTP content by 10% up
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Oct 10, 2024
1 parent 6df0763 commit c674df3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DuckDuckGo/HomePage/View/HomePageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ extension HomePage.Views {
Spacer(minLength: 40)
}
.frame(height: totalHeight(with: geometryProxy))
.offset(y: -geometryProxy.size.height * 0.1)

VStack(spacing: 0) {
remoteMessage()
Expand Down Expand Up @@ -390,14 +391,15 @@ extension HomePage.Views.RootView {
if model.isContinueSetUpAvailable && model.isContinueSetUpVisible && continueSetUpModel.shouldShowAllFeatures {
return false
}
if model.isFavoriteVisible && favoritesModel.showAllFavorites {
if model.isFavoriteVisible && favoritesModel.showAllFavorites && favoritesModel.models.count > HomePage.favoritesPerRow {
return false
}
if model.isRecentActivityVisible && recentlyVisitedModel.showRecentlyVisited {
return false
}
if activeRemoteMessageModel.shouldShowRemoteMessage {
return geometry.size.height > totalHeight(with: geometry) + 2 * remoteMessageHeight
// 32px is the VStack spacing and 38px I don't really know (16px top padding of a Remote Message, 22px not sure)
return geometry.size.height > (totalHeight(with: geometry) + 2 * remoteMessageHeight + 38 + 32 + 0.1 * geometry.size.height)
}
return true
}
Expand Down

0 comments on commit c674df3

Please sign in to comment.