2023-03-02 19:15:07 +00:00
|
|
|
import DesignSystem
|
2023-03-13 12:38:28 +00:00
|
|
|
import Models
|
|
|
|
import SwiftUI
|
2023-03-02 19:15:07 +00:00
|
|
|
|
|
|
|
public struct TagsListView: View {
|
2023-09-18 19:03:52 +00:00
|
|
|
@Environment(Theme.self) private var theme
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-03-02 19:15:07 +00:00
|
|
|
let tags: [Tag]
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-03-02 19:15:07 +00:00
|
|
|
public init(tags: [Tag]) {
|
|
|
|
self.tags = tags
|
|
|
|
}
|
2023-03-13 12:38:28 +00:00
|
|
|
|
2023-03-02 19:15:07 +00:00
|
|
|
public var body: some View {
|
|
|
|
List {
|
|
|
|
ForEach(tags) { tag in
|
|
|
|
TagRowView(tag: tag)
|
2024-02-14 11:48:14 +00:00
|
|
|
#if !os(visionOS)
|
2023-03-02 19:15:07 +00:00
|
|
|
.listRowBackground(theme.primaryBackgroundColor)
|
2024-02-14 11:48:14 +00:00
|
|
|
#endif
|
2023-03-02 19:15:07 +00:00
|
|
|
.padding(.vertical, 4)
|
|
|
|
}
|
|
|
|
}
|
2024-01-15 20:15:40 +00:00
|
|
|
#if !os(visionOS)
|
2023-03-02 19:15:07 +00:00
|
|
|
.scrollContentBackground(.hidden)
|
|
|
|
.background(theme.primaryBackgroundColor)
|
|
|
|
.listStyle(.plain)
|
2024-01-15 20:15:40 +00:00
|
|
|
#else
|
|
|
|
.listStyle(.grouped)
|
|
|
|
#endif
|
2023-03-02 19:15:07 +00:00
|
|
|
.navigationTitle("explore.section.trending.tags")
|
|
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
|
|
}
|
|
|
|
}
|