[ios] Update design of existence and opening hour confirmation for place page

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-08-22 20:22:43 +02:00
committed by Yannik Bloscheck
parent d1f9806901
commit c616e235a1
14 changed files with 152 additions and 79 deletions

View File

@@ -23,28 +23,26 @@ class PlacePageHeaderPresenter {
private weak var view: PlacePageHeaderViewProtocol?
private let placePagePreviewData: PlacePagePreviewData
private let placePageData: PlacePageData
let objectType: PlacePageObjectType
private weak var delegate: PlacePageHeaderViewControllerDelegate?
private let headerType: HeaderType
init(view: PlacePageHeaderViewProtocol,
placePageData: PlacePageData,
placePagePreviewData: PlacePagePreviewData,
objectType: PlacePageObjectType,
delegate: PlacePageHeaderViewControllerDelegate?,
headerType: HeaderType) {
self.view = view
self.delegate = delegate
self.placePageData = placePageData
self.placePagePreviewData = placePageData.previewData
self.objectType = placePageData.objectType
self.placePagePreviewData = placePagePreviewData
self.objectType = objectType
self.headerType = headerType
}
}
extension PlacePageHeaderPresenter: PlacePageHeaderPresenterProtocol {
func configure() {
let existenceConfirmation = getExistenceConfirmationText()
view?.setTitle(placePagePreviewData.title, secondaryTitle: placePagePreviewData.secondaryTitle, existenceConfirmation: existenceConfirmation)
view?.setTitle(placePagePreviewData.title, secondaryTitle: placePagePreviewData.secondaryTitle)
switch headerType {
case .flexible:
view?.isExpandViewHidden = false
@@ -70,10 +68,4 @@ extension PlacePageHeaderPresenter: PlacePageHeaderPresenterProtocol {
func onExportTrackButtonPress(_ type: KmlFileType, from sourceView: UIView) {
delegate?.previewDidPressExportTrack(type, from: sourceView)
}
private func getExistenceConfirmationText() -> String? {
guard let mostRecentDate = placePageData.infoData?.getMostRecentCheckDate() else { return nil }
let timeAgoText = mostRecentDate.formatTimeAgo()
return String(format: L("existence_confirmed_time_ago"), timeAgoText)
}
}