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

50 lines
1.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
}
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
}
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 }
}
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 }
}
var isSupporter: Bool {
get { self[IsSupporter.self] }
set { self[IsSupporter.self] = newValue }
}
2023-01-29 16:37:15 +00:00
}