IceCubesApp/Packages/Env/Sources/Env/CustomEnvValues.swift

95 lines
2.1 KiB
Swift
Raw Normal View History

2023-01-29 16:37:15 +00:00
import Foundation
import SwiftUI
private struct SecondaryColumnKey: EnvironmentKey {
static let defaultValue = false
}
private struct ExtraLeadingInset: EnvironmentKey {
static let defaultValue: CGFloat = 0
}
private struct IsCompact: EnvironmentKey {
static let defaultValue: Bool = false
}
private struct IsMediaCompact: EnvironmentKey {
static let defaultValue: Bool = false
}
2024-01-10 15:50:18 +00:00
private struct IsModal: EnvironmentKey {
static let defaultValue: Bool = false
}
2023-02-19 14:29:07 +00:00
private struct IsInCaptureMode: EnvironmentKey {
static let defaultValue: Bool = false
}
private struct IsSupporter: EnvironmentKey {
static let defaultValue: Bool = false
}
private struct IsStatusFocused: EnvironmentKey {
static let defaultValue: Bool = false
}
private struct IsHomeTimeline: EnvironmentKey {
static let defaultValue: Bool = false
}
private struct IndentationLevel: EnvironmentKey {
static let defaultValue: UInt = 0
}
2023-01-30 06:27:06 +00:00
public extension EnvironmentValues {
var isSecondaryColumn: Bool {
2023-01-29 16:37:15 +00:00
get { self[SecondaryColumnKey.self] }
set { self[SecondaryColumnKey.self] = newValue }
}
2023-02-18 06:26:48 +00:00
var extraLeadingInset: CGFloat {
get { self[ExtraLeadingInset.self] }
set { self[ExtraLeadingInset.self] = newValue }
}
2023-02-18 06:26:48 +00:00
var isCompact: Bool {
get { self[IsCompact.self] }
set { self[IsCompact.self] = newValue }
}
2024-02-14 11:48:14 +00:00
var isMediaCompact: Bool {
get { self[IsMediaCompact.self] }
set { self[IsMediaCompact.self] = newValue }
}
2024-02-14 11:48:14 +00:00
2024-01-10 15:50:18 +00:00
var isModal: Bool {
get { self[IsModal.self] }
set { self[IsModal.self] = newValue }
}
2023-02-21 06:23:42 +00:00
2023-02-19 14:29:07 +00:00
var isInCaptureMode: Bool {
get { self[IsInCaptureMode.self] }
set { self[IsInCaptureMode.self] = newValue }
}
2023-03-13 12:38:28 +00:00
var isSupporter: Bool {
get { self[IsSupporter.self] }
set { self[IsSupporter.self] = newValue }
}
var isStatusFocused: Bool {
get { self[IsStatusFocused.self] }
set { self[IsStatusFocused.self] = newValue }
}
2023-09-18 19:03:52 +00:00
var indentationLevel: UInt {
get { self[IndentationLevel.self] }
set { self[IndentationLevel.self] = newValue }
}
2023-12-18 07:22:59 +00:00
var isHomeTimeline: Bool {
get { self[IsHomeTimeline.self] }
set { self[IsHomeTimeline.self] = newValue }
}
2023-01-29 16:37:15 +00:00
}