Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modules/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let package = Package(
.package(url: "https://github.com/wordpress-mobile/NSURL-IDN", revision: "b34794c9a3f32312e1593d4a3d120572afa0d010"),
.package(
url: "https://github.com/wordpress-mobile/WordPressKit-iOS",
revision: "2613f213b1a958266f88fa7e99d990292096bffb" // see wpios-edition branch
revision: "67db92e3ea5ad8574911df592a838b4729ab9ca5" // see wpios-edition branch
),
.package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"),
// We can't use wordpress-rs branches nor commits here. Only tags work.
Expand Down
21 changes: 7 additions & 14 deletions Modules/Sources/JetpackStats/Cards/ChartCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ struct ChartCard: View {
.presentationDetents([.medium, .large])
.presentationDragIndicator(.visible)
}
.sheet(isPresented: $isShowingRawData) {
if let data = viewModel.chartData[selectedMetric] {
NavigationStack {
ChartDataListView(data: data, dateRange: dateRange)
}
}
}
}

private func headerView(for metric: SiteMetric) -> some View {
Expand Down Expand Up @@ -165,15 +172,6 @@ struct ChartCard: View {
.frame(width: 56, height: 50)
}
.tint(Color.primary)
.sheet(isPresented: $isShowingRawData) {
NavigationStack {
ChartDataListView(
chartDataDict: viewModel.chartData,
selectedMetric: selectedMetric,
dateRanges: dateRange
)
}
}
}

@ViewBuilder
Expand All @@ -190,11 +188,6 @@ struct ChartCard: View {
}
}
Section {
Button {
// Not implemented
} label: {
Label(Strings.Buttons.share, systemImage: "square.and.arrow.up")
}
Button {
isShowingRawData = true
} label: {
Expand Down
22 changes: 5 additions & 17 deletions Modules/Sources/JetpackStats/Cards/TopListCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ struct TopListCard: View {
moreMenu
}
.cardStyle()
.onTapGesture {
navigateToTopListScreen()
}
.grayscale(viewModel.isStale ? 1 : 0)
.opacity(viewModel.isEditing ? 0.6 : 1)
.scaleEffect(viewModel.isEditing ? 0.95 : 1)
Expand All @@ -58,13 +61,6 @@ struct TopListCard: View {
.presentationDetents([.medium, .large])
.presentationDragIndicator(.visible)
}
.background(
Color.clear
.contentShape(Rectangle())
.onTapGesture {
navigateToTopListScreen()
}
)
}

private var cardHeaderView: some View {
Expand Down Expand Up @@ -132,7 +128,7 @@ struct TopListCard: View {
.environment(\.context, context)
.environment(\.router, router)

router.navigate(to: screen)
router.navigate(to: screen, title: viewModel.selection.item.localizedTitle)
}

private var itemTypePicker: some View {
Expand Down Expand Up @@ -188,11 +184,6 @@ struct TopListCard: View {
@ViewBuilder
private var moreMenuContent: some View {
Section {
Button {
// Not implemented
} label: {
Label(Strings.Buttons.share, systemImage: "square.and.arrow.up")
}
if let documentationURL = viewModel.selection.item.documentationURL {
Link(destination: documentationURL) {
Label(Strings.Buttons.learnMore, systemImage: "info.circle")
Expand Down Expand Up @@ -275,9 +266,7 @@ struct TopListCard: View {
}

#Preview {
NavigationView {
TopListCardPreview(item: .authors)
}
TopListCardPreview(item: .authors)
}

private struct TopListCardPreview: View {
Expand All @@ -299,7 +288,6 @@ private struct TopListCardPreview: View {

var body: some View {
TopListCard(viewModel: viewModel)
.cardStyle()
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Constants.Colors.background)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation

/// Represents predefined date range options for stats filtering.
/// Each preset defines a specific time period relative to the current date.
enum DateIntervalPreset: CaseIterable, Identifiable {
enum DateIntervalPreset: String, CaseIterable, Identifiable {
/// The current calendar day
case today
/// The current calendar week
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,16 @@
height: auto;
}
path {
cursor: pointer;
transition: opacity 0.2s ease;
}
path:hover {
opacity: 0.8;
stroke-width: 2;
}
path.selected {
stroke-width: 3;
stroke: #007AFF;
}
</style>
<script>
let selectedCountry = null;

function selectCountry(element) {
if (selectedCountry && selectedCountry !== element) {
selectedCountry.classList.remove('selected');
Expand Down
Loading