mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
[ios] Adjusted opening color to fit with the new style
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -153,7 +153,7 @@ final class PlacePagePreviewViewController: UIViewController {
|
||||
scheduleContainerView.isHidden = true
|
||||
case .allDay:
|
||||
setScheduleLabel(state: L("twentyfour_seven"),
|
||||
stateColor: UIColor.systemGreen,
|
||||
stateColor: UIColor.BaseColors.green,
|
||||
details: nil)
|
||||
|
||||
case .open:
|
||||
@@ -162,8 +162,16 @@ final class PlacePagePreviewViewController: UIViewController {
|
||||
let stringTimeInterval = getTimeIntervalString(minutes: minutesUntilClosed)
|
||||
let stringTime = stringFromTime(nextTimeClosed)
|
||||
|
||||
var state: String = L("editor_time_open")
|
||||
var stateColor = UIColor.BaseColors.green
|
||||
let details: String?
|
||||
if (minutesUntilClosed < 3 * 60) // Less than 3 hours
|
||||
if (minutesUntilClosed < 60) // Less than 1 hour
|
||||
{
|
||||
state = String(format: L("closes_in"), stringTimeInterval)
|
||||
stateColor = UIColor.BaseColors.yellow
|
||||
details = stringTime
|
||||
}
|
||||
else if (minutesUntilClosed < 3 * 60) // Less than 3 hours
|
||||
{
|
||||
details = String(format: L("closes_in"), stringTimeInterval) + " • " + stringTime
|
||||
}
|
||||
@@ -176,8 +184,8 @@ final class PlacePagePreviewViewController: UIViewController {
|
||||
details = nil
|
||||
}
|
||||
|
||||
setScheduleLabel(state: L("editor_time_open"),
|
||||
stateColor: UIColor.systemGreen,
|
||||
setScheduleLabel(state: state,
|
||||
stateColor: stateColor,
|
||||
details: details)
|
||||
|
||||
case .closed:
|
||||
@@ -212,7 +220,7 @@ final class PlacePagePreviewViewController: UIViewController {
|
||||
}
|
||||
|
||||
setScheduleLabel(state: L("closed_now"),
|
||||
stateColor: UIColor.systemRed,
|
||||
stateColor: UIColor.BaseColors.red,
|
||||
details: details)
|
||||
|
||||
@unknown default:
|
||||
@@ -233,7 +241,7 @@ final class PlacePagePreviewViewController: UIViewController {
|
||||
private func setScheduleLabel(state: String, stateColor: UIColor, details: String?) {
|
||||
let attributedString = NSMutableAttributedString()
|
||||
let stateString = NSAttributedString(string: state,
|
||||
attributes: [NSAttributedString.Key.font: UIFont.regular14(),
|
||||
attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14, weight: .semibold),
|
||||
NSAttributedString.Key.foregroundColor: stateColor])
|
||||
attributedString.append(stateString)
|
||||
if (details != nil)
|
||||
|
||||
Reference in New Issue
Block a user