mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-02 02:53:44 +00:00
[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:
committed by
Yannik Bloscheck
parent
d1f9806901
commit
c616e235a1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user