IceCubesApp/Packages/Env/Sources/Env/CustomEnvValues.swift
Thomas Ricouard 3d4c636de8 Cleanup
2023-09-17 20:32:57 +02:00

68 lines
1.6 KiB
Swift

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 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 IsStatusReplyToPrevious: EnvironmentKey {
static let defaultValue: Bool = false
}
public extension EnvironmentValues {
var isSecondaryColumn: Bool {
get { self[SecondaryColumnKey.self] }
set { self[SecondaryColumnKey.self] = newValue }
}
var extraLeadingInset: CGFloat {
get { self[ExtraLeadingInset.self] }
set { self[ExtraLeadingInset.self] = newValue }
}
var isCompact: Bool {
get { self[IsCompact.self] }
set { self[IsCompact.self] = newValue }
}
var isInCaptureMode: Bool {
get { self[IsInCaptureMode.self] }
set { self[IsInCaptureMode.self] = newValue }
}
var isSupporter: Bool {
get { self[IsSupporter.self] }
set { self[IsSupporter.self] = newValue }
}
var isStatusFocused: Bool {
get { self[IsStatusFocused.self] }
set { self[IsStatusFocused.self] = newValue }
}
var isStatusReplyToPrevious: Bool {
get { self[IsStatusReplyToPrevious.self] }
set { self[IsStatusReplyToPrevious.self] = newValue }
}
}