mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Remove layout styling abstraction (#2982)
This commit is contained in:
@@ -17,26 +17,6 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
enum TimelineStyle: String, CaseIterable, Codable {
|
||||
case bubbles
|
||||
|
||||
/// List row insets for a timeline
|
||||
var rowInsets: EdgeInsets {
|
||||
switch self {
|
||||
case .bubbles:
|
||||
return EdgeInsets(top: 1, leading: 8, bottom: 1, trailing: 8)
|
||||
}
|
||||
}
|
||||
|
||||
/// Short hand for `self == .bubbles`
|
||||
var isBubbles: Bool {
|
||||
switch self {
|
||||
case .bubbles:
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum TimelineGroupStyle: Hashable {
|
||||
case single
|
||||
case first
|
||||
@@ -55,20 +35,11 @@ enum TimelineGroupStyle: Hashable {
|
||||
|
||||
// MARK: - Environment
|
||||
|
||||
private struct TimelineStyleKey: EnvironmentKey {
|
||||
static let defaultValue = TimelineStyle.bubbles
|
||||
}
|
||||
|
||||
private struct TimelineGroupStyleKey: EnvironmentKey {
|
||||
static let defaultValue = TimelineGroupStyle.single
|
||||
}
|
||||
|
||||
extension EnvironmentValues {
|
||||
var timelineStyle: TimelineStyle {
|
||||
get { self[TimelineStyleKey.self] }
|
||||
set { self[TimelineStyleKey.self] = newValue }
|
||||
}
|
||||
|
||||
var timelineGroupStyle: TimelineGroupStyle {
|
||||
get { self[TimelineGroupStyleKey.self] }
|
||||
set { self[TimelineGroupStyleKey.self] = newValue }
|
||||
|
||||
Reference in New Issue
Block a user