Skip to content

Commit 2b2bdac

Browse files
authored
Merge pull request #5608 from wikimedia/undo-impact-changes
Activity - Bring back old "Your impact" look
2 parents 828e8a2 + 803efe5 commit 2b2bdac

File tree

1 file changed

+12
-41
lines changed

1 file changed

+12
-41
lines changed

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

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -64,52 +64,28 @@ public struct WMFActivityTabView: View {
6464

6565
if viewModel.customizeViewModel.isReadingInsightsOn {
6666
articlesReadModule(proxy: proxy)
67+
.padding(.horizontal, 16)
6768
savedArticlesModule
69+
.padding(.horizontal, 16)
6870

6971
if !viewModel.articlesReadViewModel.topCategories.isEmpty {
7072
topCategoriesModule(categories: viewModel.articlesReadViewModel.topCategories)
73+
.padding(.horizontal, 16)
7174
.accessibilityElement()
7275
.accessibilityLabel(viewModel.localizedStrings.topCategories)
7376
.accessibilityValue(viewModel.articlesReadViewModel.topCategories.joined(separator: ", "))
7477
}
7578
}
76-
}
77-
.padding(.horizontal, 16)
78-
.padding(.bottom, 16)
79-
.listRowInsets(EdgeInsets())
80-
.background(
81-
LinearGradient(
82-
stops: [
83-
Gradient.Stop(color: Color(uiColor: theme.paperBackground), location: 0),
84-
Gradient.Stop(color: Color(uiColor: theme.softEditorBlue), location: 1)
85-
],
86-
startPoint: .top,
87-
endPoint: .bottom
88-
)
89-
)
90-
}
91-
.listRowSeparator(.hidden)
92-
}
93-
94-
if viewModel.customizeViewModel.isEditingInsightsOn {
95-
Section(header: YourImpactHeaderView(title: viewModel.localizedStrings.yourImpact)) {
96-
VStack(spacing: 16) {
9779

98-
// TODO: Uncomment here for user impact data with stub UI
99-
// if let mostViewedArticlesViewModel = viewModel.mostViewedArticlesViewModel {
100-
// MostViewedArticlesView(viewModel: mostViewedArticlesViewModel)
101-
// }
102-
//
103-
// if let contributionsViewModel = viewModel.contributionsViewModel {
104-
// ContributionsView(viewModel: contributionsViewModel)
105-
// }
106-
//
107-
// if viewModel.allTimeImpactViewModel != nil || viewModel.recentActivityViewModel != nil || viewModel.articleViewsViewModel != nil {
108-
// CombinedImpactView(allTimeImpactViewModel: viewModel.allTimeImpactViewModel, recentActivityViewModel: viewModel.recentActivityViewModel, articleViewsViewModel: viewModel.articleViewsViewModel)
109-
// }
110-
111-
if let globalEditCount = viewModel.globalEditCount, globalEditCount > 0 {
80+
if let globalEditCount = viewModel.globalEditCount, globalEditCount > 0, viewModel.customizeViewModel.isEditingInsightsOn {
81+
HStack {
82+
YourImpactHeaderView(title: viewModel.localizedStrings.yourImpact)
83+
Spacer()
84+
}
85+
.padding(.top, 12)
86+
11287
totalEditsView(amount: animatedGlobalEditCount)
88+
.padding(.horizontal, 16)
11389
.onAppear {
11490
if !hasShownGlobalEditsCard {
11591
hasShownGlobalEditsCard = true
@@ -128,7 +104,6 @@ public struct WMFActivityTabView: View {
128104
}
129105
}
130106
}
131-
.padding(.horizontal, 16)
132107
.padding(.bottom, 16)
133108
.listRowInsets(EdgeInsets())
134109
.background(
@@ -656,16 +631,12 @@ struct YourImpactHeaderView: View {
656631
}
657632

658633
var body: some View {
659-
HStack {
660634
Text(title)
661635
.font(Font(WMFFont.for(.boldHeadline)))
662636
.foregroundColor(Color(uiColor: theme.text))
663637
.textCase(.none)
638+
.padding(.horizontal, 16)
664639
.accessibilityAddTraits(.isHeader)
665-
Spacer()
666-
}
667-
.padding(.top, 12)
668-
.padding(.bottom, 16)
669640
}
670641
}
671642

0 commit comments

Comments
 (0)