summaryrefslogtreecommitdiff
path: root/Hutch/Views/Lookup/UserProfileView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-13 19:06:54 -0500
committerChristian Cleberg <[email protected]>2026-04-13 19:06:54 -0500
commita6ad2b9815d72575206bdca860eef9db850cdf1c (patch)
treeb4d5f27aa1655e5e40bab178550d6e2576d7df8b /Hutch/Views/Lookup/UserProfileView.swift
parent02a44d115b3784231cad640e992d9c18a7f67b40 (diff)
downloadhutch-a6ad2b9815d72575206bdca860eef9db850cdf1c.tar.gz
hutch-a6ad2b9815d72575206bdca860eef9db850cdf1c.tar.bz2
hutch-a6ad2b9815d72575206bdca860eef9db850cdf1c.zip
feat(theme): AMOLED true-black rows via themedRow()
Apply listRowBackground(Color.black) per row in AMOLED mode using ThemedRowStyle and themedRow() across Lists and Forms. Use themedList() for scroll/grouped backgrounds. Treat segmented and clear list rows with isAMOLED-aware listRowBackground where Color.clear was required. Removes reliance on UIKit appearance for list cells on iOS 16+. Implements: https://todo.sr.ht/~ccleberg/hutch/24
Diffstat (limited to 'Hutch/Views/Lookup/UserProfileView.swift')
-rw-r--r--Hutch/Views/Lookup/UserProfileView.swift24
1 files changed, 23 insertions, 1 deletions
diff --git a/Hutch/Views/Lookup/UserProfileView.swift b/Hutch/Views/Lookup/UserProfileView.swift
index 4fbb5a0..8472a90 100644
--- a/Hutch/Views/Lookup/UserProfileView.swift
+++ b/Hutch/Views/Lookup/UserProfileView.swift
@@ -2,6 +2,7 @@ import SwiftUI
struct UserProfileView: View {
@Environment(AppState.self) private var appState
+ @Environment(\.isAMOLEDTheme) private var isAMOLED
@AppStorage(AppStorageKeys.contributionGraphsEnabled, store: .standard) private var contributionGraphsEnabled = true
let user: User
@@ -55,33 +56,41 @@ struct UserProfileView: View {
}
Spacer()
}
- .listRowBackground(Color.clear)
+ .listRowBackground(isAMOLED ? Color.black : Color.clear)
}
}
Section {
LabeledContent("Username", value: user.username)
+ .themedRow()
LabeledContent("Canonical Name", value: user.canonicalName)
+ .themedRow()
if let userType = user.userType {
LabeledContent("User Type", value: userType)
+ .themedRow()
}
if let pronouns = user.pronouns {
LabeledContent("Pronouns", value: pronouns)
+ .themedRow()
}
if let suspensionNotice = user.suspensionNotice {
LabeledContent("Suspension Notice", value: suspensionNotice)
+ .themedRow()
}
}
Section {
LabeledContent("Email", value: user.email)
+ .themedRow()
if let urlString = user.url, let url = URL(string: urlString) {
LabeledContent("URL") {
Link(urlString, destination: url)
}
+ .themedRow()
}
if let location = user.location {
LabeledContent("Location", value: location)
+ .themedRow()
}
}
@@ -91,6 +100,7 @@ struct UserProfileView: View {
.frame(maxWidth: .infinity, alignment: .leading)
.tint(.accentColor)
.textSelection(.enabled)
+ .themedRow()
}
}
@@ -98,9 +108,11 @@ struct UserProfileView: View {
Section {
if let created = user.created {
LabeledContent("Joined", value: formattedTimestamp(created))
+ .themedRow()
}
if let updated = user.updated {
LabeledContent("Updated", value: formattedTimestamp(updated))
+ .themedRow()
}
}
}
@@ -118,15 +130,18 @@ struct UserProfileView: View {
error: viewModel.contributionsError ?? viewModel.contributionStatusText,
isIndexedButEmpty: viewModel.isContributionActivityIndexedButEmpty
)
+ .themedRow()
}
}
Section {
if viewModel.isLoadingRepositories && viewModel.repositories.isEmpty {
ProgressView()
+ .themedRow()
} else if viewModel.repositories.isEmpty {
Text("No public repositories.")
.foregroundStyle(.secondary)
+ .themedRow()
} else {
ForEach(viewModel.repositories.prefix(4)) { repo in
NavigationLink {
@@ -137,10 +152,12 @@ struct UserProfileView: View {
RepositoryRowView(repository: repo, buildStatus: .none)
}
}
+ .themedRow()
if viewModel.repositories.count > 4 {
NavigationLink("See All") {
UserRepositoriesView(viewModel: viewModel)
}
+ .themedRow()
}
}
} header: {
@@ -150,9 +167,11 @@ struct UserProfileView: View {
Section {
if viewModel.isLoadingTrackers && viewModel.trackers.isEmpty {
ProgressView()
+ .themedRow()
} else if viewModel.trackers.isEmpty {
Text("No public trackers.")
.foregroundStyle(.secondary)
+ .themedRow()
} else {
ForEach(viewModel.trackers.prefix(4)) { tracker in
NavigationLink {
@@ -161,10 +180,12 @@ struct UserProfileView: View {
UserProfileTrackerRowView(tracker: tracker)
}
}
+ .themedRow()
if viewModel.trackers.count > 4 {
NavigationLink("See All") {
UserTrackersView(viewModel: viewModel)
}
+ .themedRow()
}
}
} header: {
@@ -172,6 +193,7 @@ struct UserProfileView: View {
}
}
}
+ .themedList()
.listStyle(.insetGrouped)
.navigationTitle(user.canonicalName)
.navigationBarTitleDisplayMode(.inline)