Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide sparkline in top read widget if size category exceeds extra large #4419

Merged
merged 3 commits into from
Dec 9, 2022
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion Widgets/Widgets/TopReadWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ struct TopReadProvider: TimelineProvider {
struct TopReadView: View {
@Environment(\.widgetFamily) private var family
@Environment(\.colorScheme) private var colorScheme
@Environment(\.sizeCategory) private var sizeCategory

var entry: TopReadProvider.Entry?

Expand Down Expand Up @@ -215,7 +216,7 @@ struct TopReadView: View {

@ViewBuilder
func rowBasedWidget(_ family: WidgetFamily) -> some View {
let showSparkline = family == .systemLarge ? true : false
let showSparkline = sizeCategory > .extraLarge ? false : (family == .systemLarge ? true : false)
let rowCount = family == .systemLarge ? 4 : 2

VStack(alignment: .leading, spacing: 8) {
Expand Down