Separate post and page view to files
This commit is contained in:
29
CHDataManagement/Views/Posts/DetailListItem.swift
Normal file
29
CHDataManagement/Views/Posts/DetailListItem.swift
Normal file
@ -0,0 +1,29 @@
|
||||
import SwiftUI
|
||||
|
||||
struct DetailListItem<Content>: View where Content: View {
|
||||
|
||||
private let alignment: VerticalAlignment
|
||||
|
||||
private let spacing: CGFloat?
|
||||
|
||||
private let content: Content
|
||||
|
||||
init(alignment: VerticalAlignment = .center,
|
||||
spacing: CGFloat? = nil,
|
||||
@ViewBuilder content: () -> Content) {
|
||||
self.alignment = alignment
|
||||
self.spacing = spacing
|
||||
self.content = content()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: alignment,
|
||||
spacing: spacing) {
|
||||
content
|
||||
}
|
||||
.padding(.horizontal)
|
||||
.padding(.vertical)
|
||||
.background(Color(NSColor.windowBackgroundColor))
|
||||
.cornerRadius(8)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user