Skip to content

Commit f1fdff8

Browse files
committed
Revert "Fix missing actions on StackTab"
This reverts commit c22fd6e.
1 parent 115cd70 commit f1fdff8

File tree

3 files changed

+35
-43
lines changed

3 files changed

+35
-43
lines changed

Modules/Sources/AppFeature/Navigation/ProfileFlow/ProfileFlow.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ public struct ProfileTab: View {
3131
public var body: some View {
3232
WithPerceptionTracking {
3333
switch store.case {
34-
case let .loggedIn(store):
35-
StackTabView(store: store)
36-
case let .loggedOut(store):
34+
case let .loggedIn(store),
35+
let .loggedOut(store):
3736
StackTabView(store: store)
3837
}
3938
}

Modules/Sources/AuthFeature/AuthScreen.swift

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,35 @@ public struct AuthScreen: View {
158158
}
159159
}
160160
._toolbarTitleDisplayMode(.inline)
161-
.toolbar(id: "auth_toolbar") {
162-
ToolbarButtons()
161+
.toolbar {
162+
// Profile is used as root in this case so we don't need close button
163+
if store.openReason != .profile {
164+
ToolbarItem(placement: .topBarTrailing) {
165+
if #available(iOS 26, *) {
166+
Button(role: .close) {
167+
send(.closeButtonTapped)
168+
}
169+
} else {
170+
Button {
171+
send(.closeButtonTapped)
172+
} label: {
173+
Text("Close", bundle: .module)
174+
.foregroundStyle(tintColor)
175+
}
176+
}
177+
}
178+
}
179+
180+
// We're showing app settings only if it's opened from profile tab
181+
if store.openReason == .profile {
182+
ToolbarItem(placement: .topBarTrailing) {
183+
Button {
184+
send(.settingsButtonTapped)
185+
} label: {
186+
Image(systemSymbol: .gearshape)
187+
}
188+
}
189+
}
163190
}
164191
.alert($store.scope(state: \.alert, action: \.alert))
165192
.bind($store.focus, to: $focus)
@@ -181,40 +208,6 @@ public struct AuthScreen: View {
181208
}
182209
}
183210

184-
// MARK: - Toolbar Buttons
185-
186-
@ToolbarContentBuilder
187-
private func ToolbarButtons() -> some CustomizableToolbarContent {
188-
// Profile is used as root in this case so we don't need close button
189-
if store.openReason != .profile {
190-
ToolbarItem(id: "auth_close_button", placement: .topBarTrailing) {
191-
if #available(iOS 26, *) {
192-
Button(role: .close) {
193-
send(.closeButtonTapped)
194-
}
195-
} else {
196-
Button {
197-
send(.closeButtonTapped)
198-
} label: {
199-
Text("Close", bundle: .module)
200-
.foregroundStyle(tintColor)
201-
}
202-
}
203-
}
204-
}
205-
206-
// We're showing app settings only if it's opened from profile tab
207-
if store.openReason == .profile {
208-
ToolbarItem(id: "auth_settings_button", placement: .topBarTrailing) {
209-
Button {
210-
send(.settingsButtonTapped)
211-
} label: {
212-
Image(systemSymbol: .gearshape)
213-
}
214-
}
215-
}
216-
}
217-
218211
// MARK: - Field
219212

220213
@ViewBuilder

Modules/Sources/ProfileFeature/ProfileScreen.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public struct ProfileScreen: View {
7070
.alert($store.scope(state: \.destination?.alert, action: \.destination.alert))
7171
.navigationTitle(Text("Profile", bundle: .module))
7272
._toolbarTitleDisplayMode(.large)
73-
.toolbar(id: "profile_toolbar") {
73+
.toolbar {
7474
ToolbarButtons()
7575
}
7676
.onAppear {
@@ -82,9 +82,9 @@ public struct ProfileScreen: View {
8282
// MARK: - Toolbar Items
8383

8484
@ToolbarContentBuilder
85-
private func ToolbarButtons() -> some CustomizableToolbarContent {
85+
private func ToolbarButtons() -> some ToolbarContent {
8686
if store.shouldShowToolbarButtons {
87-
ToolbarItem(id: "profile_logout_button") {
87+
ToolbarItem {
8888
Button {
8989
send(.logoutButtonTapped)
9090
} label: {
@@ -96,7 +96,7 @@ public struct ProfileScreen: View {
9696
ToolbarSpacer(.fixed)
9797
}
9898

99-
ToolbarItem(id: "profile_settings_button") {
99+
ToolbarItem {
100100
Button {
101101
send(.settingsButtonTapped)
102102
} label: {

0 commit comments

Comments
 (0)