2024-01-10 12:26:55 +00:00
|
|
|
import DesignSystem
|
2024-02-14 11:48:14 +00:00
|
|
|
import Env
|
2024-01-10 12:26:55 +00:00
|
|
|
import Models
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
public struct FollowedTagsListView: View {
|
|
|
|
@Environment(CurrentAccount.self) private var currentAccount
|
|
|
|
@Environment(Theme.self) private var theme
|
|
|
|
|
|
|
|
public init() {}
|
2024-02-14 11:48:14 +00:00
|
|
|
|
2024-01-10 12:26:55 +00:00
|
|
|
public var body: some View {
|
|
|
|
List(currentAccount.tags) { tag in
|
|
|
|
TagRowView(tag: tag)
|
2024-02-14 11:48:14 +00:00
|
|
|
#if !os(visionOS)
|
2024-01-10 12:26:55 +00:00
|
|
|
.listRowBackground(theme.primaryBackgroundColor)
|
2024-02-14 11:48:14 +00:00
|
|
|
#endif
|
2024-01-10 12:26:55 +00:00
|
|
|
.padding(.vertical, 4)
|
|
|
|
}
|
|
|
|
.task {
|
|
|
|
await currentAccount.fetchFollowedTags()
|
|
|
|
}
|
|
|
|
.refreshable {
|
|
|
|
await currentAccount.fetchFollowedTags()
|
|
|
|
}
|
|
|
|
#if !os(visionOS)
|
|
|
|
.scrollContentBackground(.hidden)
|
|
|
|
.background(theme.secondaryBackgroundColor)
|
|
|
|
#endif
|
|
|
|
.listStyle(.plain)
|
|
|
|
.navigationTitle("timeline.filter.tags")
|
|
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
|
|
}
|
|
|
|
}
|