IceCubesApp/Packages/Account/Sources/Account/Tags/FollowedTagsListView.swift

35 lines
835 B
Swift
Raw Normal View History

import DesignSystem
2024-02-14 11:48:14 +00:00
import Env
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
public var body: some View {
List(currentAccount.tags) { tag in
TagRowView(tag: tag)
2024-02-14 11:48:14 +00:00
#if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor)
2024-02-14 11:48:14 +00:00
#endif
.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)
}
}