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

[iOS] Add borders to user icons #921

Merged
merged 1 commit into from
Sep 1, 2024
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import SwiftUI
import Theme

private actor CircularUserIconInMemoryCache {
static let shared = CircularUserIconInMemoryCache()
Expand Down Expand Up @@ -35,6 +36,10 @@
}
}
.clipShape(Circle())
.overlay(
Circle()
.stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1)
)
.task {
if let data = await CircularUserIconInMemoryCache.shared.data(urlString: urlString) {
iconData = data
Expand All @@ -45,7 +50,7 @@
return
}
let urlRequest = URLRequest(url: url, cachePolicy: .useProtocolCachePolicy)
if let (data, _) = try? await URLSession.shared.data(for: urlRequest) {

Check warning on line 53 in app-ios/Sources/CommonComponents/Timetable/CircularUserIcon.swift

View workflow job for this annotation

GitHub Actions / build-test-ios

passing argument of non-sendable type '(any URLSessionTaskDelegate)?' outside of main actor-isolated context may introduce data races
iconData = data
await CircularUserIconInMemoryCache.shared.set(data: data, urlString: urlString)
}
Expand Down
4 changes: 0 additions & 4 deletions app-ios/Sources/StaffFeature/StaffLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ struct StaffLabel: View {
HStack(alignment: .center, spacing: 12) {
CircularUserIcon(urlString: icon.absoluteString)
.frame(width: 52, height: 52)
.overlay(
Circle()
.stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1)
)

Text(name)
.textStyle(.bodyLarge)
Expand Down
11 changes: 2 additions & 9 deletions app-ios/Sources/TimetableFeature/TimetableGridCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,8 @@ public struct TimetableGridCard: View {

ForEach(timetableItem.speakers, id: \.id) { speaker in
HStack(spacing: 8) {
Group {
AsyncImage(url: URL(string: speaker.iconUrl)) {
$0.resizable()
} placeholder: {
Color.gray
}
}
.frame(width: 32, height: 32)
.clipShape(Circle())
CircularUserIcon(urlString: speaker.iconUrl)
.frame(width: 32, height: 32)

Text(speaker.name)
.textStyle(.titleSmall)
Expand Down
Loading