diff --git a/IceCubesApp.xcodeproj/project.pbxproj b/IceCubesApp.xcodeproj/project.pbxproj index f8ce7b05..6fb2f5ec 100644 --- a/IceCubesApp.xcodeproj/project.pbxproj +++ b/IceCubesApp.xcodeproj/project.pbxproj @@ -106,7 +106,7 @@ E9DF420129830FEC0003AAD2 /* ActionRequestHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9DF420029830FEC0003AAD2 /* ActionRequestHandler.swift */; }; E9DF420329830FEC0003AAD2 /* Action.js in Resources */ = {isa = PBXBuildFile; fileRef = E9DF420229830FEC0003AAD2 /* Action.js */; }; E9DF420729830FEC0003AAD2 /* IceCubesActionExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = E9DF41FA29830FEC0003AAD2 /* IceCubesActionExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - FA31A9AB2A66BF7C00D5F662 /* AddTagGroupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA31A9AA2A66BF7C00D5F662 /* AddTagGroupView.swift */; }; + FA31A9AB2A66BF7C00D5F662 /* EditTagGroupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA31A9AA2A66BF7C00D5F662 /* EditTagGroupView.swift */; }; FAD203D02A66D8A80030A7FD /* Symbols.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAD203CF2A66D8A80030A7FD /* Symbols.swift */; }; /* End PBXBuildFile section */ @@ -275,7 +275,7 @@ E9DF420229830FEC0003AAD2 /* Action.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Action.js; sourceTree = ""; }; E9DF420429830FEC0003AAD2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F355EEDA297A8BD500E362C0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; - FA31A9AA2A66BF7C00D5F662 /* AddTagGroupView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddTagGroupView.swift; sourceTree = ""; }; + FA31A9AA2A66BF7C00D5F662 /* EditTagGroupView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditTagGroupView.swift; sourceTree = ""; }; FAD203CF2A66D8A80030A7FD /* Symbols.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Symbols.swift; sourceTree = ""; }; FF8259FB298E42E000BEAB69 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; FF8259FC298E42E000BEAB69 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -407,7 +407,7 @@ children = ( 9F398AB229360A4C00A889F2 /* TimelineTab.swift */, 9F7335F12967608F00AFF0BA /* AddRemoteTimelineView.swift */, - FA31A9AA2A66BF7C00D5F662 /* AddTagGroupView.swift */, + FA31A9AA2A66BF7C00D5F662 /* EditTagGroupView.swift */, FAD203CF2A66D8A80030A7FD /* Symbols.swift */, ); path = Timeline; @@ -839,7 +839,7 @@ 9F7335F92968576500AFF0BA /* DisplaySettingsView.swift in Sources */, 9F2A540729699698009B2D7C /* SupportAppView.swift in Sources */, 9F2B92F6295AE04800DE16D0 /* Tabs.swift in Sources */, - FA31A9AB2A66BF7C00D5F662 /* AddTagGroupView.swift in Sources */, + FA31A9AB2A66BF7C00D5F662 /* EditTagGroupView.swift in Sources */, FAD203D02A66D8A80030A7FD /* Symbols.swift in Sources */, 9F398AB329360A4C00A889F2 /* TimelineTab.swift in Sources */, 9F398AA62935FE8A00A889F2 /* AppRouter.swift in Sources */, diff --git a/IceCubesApp/App/AppRouter.swift b/IceCubesApp/App/AppRouter.swift index bdc72bb5..960e9c15 100644 --- a/IceCubesApp/App/AppRouter.swift +++ b/IceCubesApp/App/AppRouter.swift @@ -83,7 +83,7 @@ extension View { AddRemoteTimelineView() .withEnvironments() case .addTagGroup: - AddTagGroupView() + EditTagGroupView() .withEnvironments() case let .statusEditHistory(status): StatusEditHistoryView(statusId: status) @@ -104,6 +104,9 @@ extension View { .withEnvironments() case let .shareImage(image, status): ActivityView(image: image, status: status) + case let .editTagGroup(tagGroup, onSaved): + EditTagGroupView(editingTagGroup: tagGroup, onSaved: onSaved) + .withEnvironments() } } } diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index a8dd2eb1..345b1203 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -269,6 +269,9 @@ struct SettingsTabs: View { Form { ForEach(preferences.tagGroups, id: \.self) { group in Label(group.title, systemImage: group.sfSymbolName) + .onTapGesture { + routerPath.presentedSheet = .editTagGroup(tagGroup: group, onSaved: nil) + } } .onDelete { indexes in if let index = indexes.first { diff --git a/IceCubesApp/App/Tabs/Timeline/AddTagGroupView.swift b/IceCubesApp/App/Tabs/Timeline/EditTagGroupView.swift similarity index 84% rename from IceCubesApp/App/Tabs/Timeline/AddTagGroupView.swift rename to IceCubesApp/App/Tabs/Timeline/EditTagGroupView.swift index 06401626..4fb6e217 100644 --- a/IceCubesApp/App/Tabs/Timeline/AddTagGroupView.swift +++ b/IceCubesApp/App/Tabs/Timeline/EditTagGroupView.swift @@ -7,7 +7,7 @@ import NukeUI import Shimmer import SwiftUI -struct AddTagGroupView: View { +struct EditTagGroupView: View { @Environment(\.dismiss) private var dismiss @EnvironmentObject private var preferences: UserPreferences @@ -19,6 +19,9 @@ struct AddTagGroupView: View { @State private var newTag: String = "" @State private var popupTagsPresented = false + private var editingTagGroup: TagGroup? + private var onSaved: ((TagGroup) -> Void)? + private var canSave: Bool { !title.isEmpty && // At least have 2 tags, one main and one additional. @@ -32,6 +35,11 @@ struct AddTagGroupView: View { case symbol case new } + + init(editingTagGroup: TagGroup? = nil, onSaved: ((TagGroup) -> Void)? = nil) { + self.editingTagGroup = editingTagGroup + self.onSaved = onSaved + } var body: some View { NavigationStack { @@ -41,7 +49,7 @@ struct AddTagGroupView: View { keywordsSection } .formStyle(.grouped) - .navigationTitle("timeline.filter.add-tag-groups") + .navigationTitle(editingTagGroup != nil ? "timeline.filter.edit-tag-groups" : "timeline.filter.add-tag-groups") .navigationBarTitleDisplayMode(.inline) .scrollContentBackground(.hidden) .background(theme.secondaryBackgroundColor) @@ -59,6 +67,11 @@ struct AddTagGroupView: View { } .onAppear { focusedField = .title + if let editingTagGroup { + title = editingTagGroup.title + sfSymbolName = editingTagGroup.sfSymbolName + tags = editingTagGroup.tags + } } } } @@ -150,14 +163,22 @@ struct AddTagGroupView: View { private func save() { var toSave = tags let main = toSave.removeFirst() - preferences.tagGroups.append(.init( + + let tagGroup: TagGroup = .init( title: title.trimmingCharacters(in: .whitespaces), sfSymbolName: sfSymbolName, main: main, additional: toSave - )) + ) + if let editingTagGroup, + let index = preferences.tagGroups.firstIndex(of: editingTagGroup) { + preferences.tagGroups[index] = tagGroup + } else { + preferences.tagGroups.append(tagGroup) + } dismiss() + onSaved?(tagGroup) } @ViewBuilder @@ -189,7 +210,7 @@ struct AddTagGroupView: View { struct AddTagGroupView_Previews: PreviewProvider { static var previews: some View { - AddTagGroupView() + EditTagGroupView() .withEnvironments() } } diff --git a/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings index dad7c037..65fd30f7 100644 --- a/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings @@ -248,6 +248,7 @@ "timeline.filter.tags" = "Адсочваемыя тэгі"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Дадаць уліковы запіс"; diff --git a/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings index c140dce6..a0092462 100644 --- a/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings @@ -242,6 +242,7 @@ "timeline.filter.tags" = "Etiquetes seguides"; "timeline.filter.tag-groups" = "Grups d'Etiquetes"; "timeline.filter.add-tag-groups" = "Afegeix grup"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Afegeix un compte"; diff --git a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings index 305c0892..c9751210 100644 --- a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings @@ -245,6 +245,7 @@ "timeline.filter.tags" = "Gefolgte Hashtags"; "timeline.filter.tag-groups" = "Taggruppen"; "timeline.filter.add-tag-groups" = "Taggruppe hinzufügen"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Konto hinzufügen"; diff --git a/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings index 014f9a29..bbc79e66 100644 --- a/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings @@ -246,6 +246,7 @@ "timeline.filter.tags" = "Followed Tags"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Add Account"; diff --git a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings index b7ab277a..5db00b9e 100644 --- a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings @@ -244,6 +244,7 @@ "timeline.filter.tags" = "Followed Tags"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Add Account"; diff --git a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings index 159fc592..09940b69 100644 --- a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings @@ -244,6 +244,7 @@ "timeline.filter.tags" = "Etiquetas que sigues"; "timeline.filter.tag-groups" = "Grupos de Etiquetas"; "timeline.filter.add-tag-groups" = "Añadir grupo"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Añadir cuenta"; diff --git a/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings index 3c131d1b..237be304 100644 --- a/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings @@ -245,6 +245,7 @@ "timeline.filter.tags" = "Jarraitutako traolak"; "timeline.filter.tag-groups" = "Traola-sortak"; "timeline.filter.add-tag-groups" = "Gehitu traola-sorta"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Gehitu kontua"; diff --git a/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings index 5e4a1b8d..1fb4bf66 100644 --- a/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings @@ -243,6 +243,7 @@ "timeline.filter.tags" = "Tags suivis"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Ajouter un compte"; diff --git a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings index 6ede7a0f..451018ef 100644 --- a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings @@ -242,6 +242,7 @@ "timeline.filter.tags" = "Tag seguiti"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Aggiungi account"; diff --git a/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings index df70ec2b..792bf3e3 100644 --- a/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings @@ -243,6 +243,7 @@ "timeline.filter.tags" = "フォローしたタグ"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "アカウントの追加"; diff --git a/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings index f6cde30d..76a5910f 100644 --- a/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings @@ -244,6 +244,7 @@ "timeline-new-posts %lld" = "%lld개 새 글"; "timeline.filter.tag-groups" = "태그 모음"; "timeline.filter.add-tag-groups" = "태그 모음 추가"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "계정 추가"; diff --git a/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings index 8b7f8f78..8562707f 100644 --- a/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings @@ -243,6 +243,7 @@ "timeline.filter.tags" = "Fulgte tagger"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Legg til konto"; diff --git a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings index 4e649f1d..35edb30e 100644 --- a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings @@ -240,6 +240,7 @@ "timeline.filter.tags" = "Gevolgde hashtags"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Account toevoegen"; diff --git a/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings index e3877ea2..02de43fc 100644 --- a/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings @@ -243,6 +243,7 @@ "timeline.filter.tags" = "Obserwowane hasztagi"; "timeline.filter.tag-groups" = "Grupy hasztagów"; "timeline.filter.add-tag-groups" = "Dodaj grupę hasztagów"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Dodaj konto"; diff --git a/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings index 7d1e950f..a939b644 100644 --- a/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings @@ -243,6 +243,7 @@ "timeline.filter.tags" = "Hashtags Seguidas"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Adicionar Conta"; diff --git a/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings index 96d4d8f9..3ddb1d98 100644 --- a/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings @@ -243,6 +243,7 @@ "timeline.filter.tags" = "Takip Edilen Etiketler"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Hesap Ekle"; diff --git a/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings index 1b648053..15fede9e 100644 --- a/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings @@ -244,6 +244,7 @@ "timeline.filter.tags" = "Хештеґи"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "Додати обліковий запис"; diff --git a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings index a84bbc7f..ed1c2ebc 100644 --- a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings @@ -241,6 +241,7 @@ "timeline.filter.tags" = "关注的标签"; "timeline.filter.tag-groups" = "标签组"; "timeline.filter.add-tag-groups" = "新建标签组"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "添加账户"; diff --git a/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings index 2121db5b..8b8bd7fe 100644 --- a/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/zh-Hant.lproj/Localizable.strings @@ -245,6 +245,7 @@ "timeline.filter.tags" = "跟隨標籤"; "timeline.filter.tag-groups" = "Tag Groups"; "timeline.filter.add-tag-groups" = "Add tag group"; +"timeline.filter.edit-tag-groups" = "Edit tag group"; // MARK: Package: AppAccount "app-account.button.add" = "新增帳號"; diff --git a/Packages/Env/Sources/Env/Router.swift b/Packages/Env/Sources/Env/Router.swift index 00abb6b9..d43935da 100644 --- a/Packages/Env/Sources/Env/Router.swift +++ b/Packages/Env/Sources/Env/Router.swift @@ -39,6 +39,7 @@ public enum SheetDestination: Identifiable { case accountPushNotficationsSettings case report(status: Status) case shareImage(image: UIImage, status: Status) + case editTagGroup(tagGroup: TagGroup, onSaved: ((TagGroup) -> Void)?) public var id: String { switch self { @@ -61,6 +62,8 @@ public enum SheetDestination: Identifiable { return "report" case .shareImage: return "shareImage" + case .editTagGroup: + return "editTagGroup" } } } diff --git a/Packages/Timeline/Sources/Timeline/TimelineView.swift b/Packages/Timeline/Sources/Timeline/TimelineView.swift index de9e9eb2..9f1023f8 100644 --- a/Packages/Timeline/Sources/Timeline/TimelineView.swift +++ b/Packages/Timeline/Sources/Timeline/TimelineView.swift @@ -212,20 +212,28 @@ public struct TimelineView: View { private var tagGroupHeaderView: some View { if let group = viewModel.tagGroup { headerView { - ScrollView(.horizontal) { - HStack(spacing: 4) { - ForEach(group.tags, id: \.self) { tag in - Button { - routerPath.navigate(to: .hashTag(tag: tag, account: nil)) - } label: { - Text("#\(tag)") - .font(.scaledHeadline) + HStack { + ScrollView(.horizontal) { + HStack(spacing: 4) { + ForEach(group.tags, id: \.self) { tag in + Button { + routerPath.navigate(to: .hashTag(tag: tag, account: nil)) + } label: { + Text("#\(tag)") + .font(.scaledHeadline) + } + .buttonStyle(.plain) } - .buttonStyle(.plain) } } + .scrollIndicators(.hidden) + Button("status.action.edit") { + routerPath.presentedSheet = .editTagGroup(tagGroup: group, onSaved: { group in + viewModel.timeline = .tagGroup(group) + }) + } + .buttonStyle(.bordered) } - .scrollIndicators(.hidden) } } }