Skip to content

Commit b30a177

Browse files
author
golson
committed
Move timeline up when all others are off
1 parent 88a6106 commit b30a177

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabCustomizeView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import WMFData
55
public struct WMFActivityTabCustomizeView: View {
66
@ObservedObject var appEnvironment = WMFAppEnvironment.current
77
@ObservedObject public var viewModel: WMFActivityTabCustomizeViewModel
8-
@Environment(\.dismiss) private var dismiss
98

109
public init(viewModel: WMFActivityTabCustomizeViewModel) {
1110
self.viewModel = viewModel

WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ public struct WMFActivityTabView: View {
2424
if !viewModel.customizeViewModel.isTimelineOfBehaviorOn, !viewModel.customizeViewModel.isTimeSpentReadingOn, !viewModel.customizeViewModel.isEditingInsightsOn, !viewModel.customizeViewModel.isReadingInsightsOn {
2525
customizedEmptyState()
2626
} else {
27-
loggedInList(proxy: proxy)
27+
if viewModel.customizeViewModel.isTimeSpentReadingOn || viewModel.customizeViewModel.isReadingInsightsOn || viewModel.customizeViewModel.isEditingInsightsOn {
28+
loggedInList(proxy: proxy)
29+
} else {
30+
loggedInListTimeline(proxy: proxy)
31+
}
2832
}
2933
} else {
3034
if viewModel.customizeViewModel.isTimelineOfBehaviorOn {
@@ -58,7 +62,7 @@ public struct WMFActivityTabView: View {
5862
.accessibilityElement()
5963
.accessibilityLabel("\(viewModel.hoursMinutesRead), \(viewModel.localizedStrings.timeSpentReading)")
6064
}
61-
65+
6266
if viewModel.customizeViewModel.isReadingInsightsOn {
6367
articlesReadModule(proxy: proxy)
6468
.padding(.horizontal, 16)
@@ -117,7 +121,7 @@ public struct WMFActivityTabView: View {
117121
)
118122
}
119123
.listRowSeparator(.hidden)
120-
124+
121125
if viewModel.customizeViewModel.isTimelineOfBehaviorOn {
122126
timelineSectionsList()
123127
.id("timelineSection")
@@ -131,6 +135,19 @@ public struct WMFActivityTabView: View {
131135
viewModel.fetchData(fromAppearance: true)
132136
}
133137
}
138+
139+
private func loggedInListTimeline(proxy: ScrollViewProxy) -> some View {
140+
List {
141+
timelineSectionsList()
142+
}
143+
.scrollContentBackground(.hidden)
144+
.listStyle(.grouped)
145+
.listCustomSectionSpacing(0)
146+
.background(Color(uiColor: theme.paperBackground).edgesIgnoringSafeArea(.all))
147+
.onAppear {
148+
viewModel.fetchData(fromAppearance: true)
149+
}
150+
}
134151

135152
private func loggedOutList(proxy: ScrollViewProxy) -> some View {
136153
List {
@@ -164,7 +181,6 @@ public struct WMFActivityTabView: View {
164181
viewModel.onTapGlobalEdits?()
165182
}
166183
)
167-
// .padding(.top, 20)
168184
}
169185

170186
private func timelineSectionsList() -> some View {

Wikipedia/Code/ActivityTabViewController.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,6 @@ final class WMFActivityTabHostingController: WMFComponentHostingController<WMFAc
316316
return navController
317317
}
318318

319-
@objc private func dismissCustomizeView() {
320-
navigationController?.presentedViewController?.dismiss(animated: true)
321-
}
322-
323319
var learnMoreAboutActivityURL: URL? {
324320

325321
guard let appLanguage = WMFDataEnvironment.current.primaryAppLanguage else {

0 commit comments

Comments
 (0)