Skip to content

Commit 2d3a156

Browse files
authored
fix: image formatting for notifications, tweak post buttons (#141)
1 parent 443c393 commit 2d3a156

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

Splajompy/Notifications/NotificationsView.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ struct NotificationsView: View {
8585
case .failed(let error):
8686
ErrorScreen(
8787
errorString: error.localizedDescription,
88-
onRetry: { await viewModel.loadNotifications(reset: true) })
88+
onRetry: { await viewModel.loadNotifications(reset: true) }
89+
)
8990
}
9091

9192
}
@@ -173,10 +174,18 @@ struct NotificationRow: View {
173174
Spacer()
174175

175176
if let blobUrl = notification.imageBlob {
177+
let targetSize: CGFloat = 40
178+
let scale = UIScreen.main.scale
179+
let downsamplingSize = CGSize(
180+
width: targetSize * scale,
181+
height: targetSize * scale
182+
)
176183
KFImage(URL(string: blobUrl))
177-
.downsampling(size: CGSize.init(width: 40, height: 40))
184+
.downsampling(size: downsamplingSize)
178185
.resizable()
186+
.aspectRatio(contentMode: .fill)
179187
.frame(width: 40, height: 40)
188+
.clipped()
180189
.cornerRadius(5)
181190
}
182191
}

Splajompy/Posts/PostView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ struct PostView: View {
139139
},
140140
label: {
141141
Image(systemName: "ellipsis")
142-
.font(.system(size: 18))
142+
.font(.system(size: 22))
143143
.frame(width: 48, height: 40)
144-
.background(RoundedRectangle(cornerRadius: 12).fill(.gray.opacity(0.08)))
144+
.background(RoundedRectangle(cornerRadius: 12).fill(.gray.opacity(0.15)))
145145
.contentShape(RoundedRectangle(cornerRadius: 12))
146146
}
147147
)
@@ -152,9 +152,9 @@ struct PostView: View {
152152
}) {
153153
ZStack {
154154
Image(systemName: "bubble.middle.bottom")
155-
.font(.system(size: 18))
155+
.font(.system(size: 22))
156156
.frame(width: 48, height: 40)
157-
.background(RoundedRectangle(cornerRadius: 12).fill(.gray.opacity(0.08)))
157+
.background(RoundedRectangle(cornerRadius: 12).fill(.gray.opacity(0.15)))
158158
.contentShape(RoundedRectangle(cornerRadius: 12))
159159

160160
if post.commentCount > 0 {
@@ -175,9 +175,9 @@ struct PostView: View {
175175
PostHogSDK.shared.capture("post_like")
176176
}) {
177177
Image(systemName: post.isLiked ? "heart.fill" : "heart")
178-
.font(.system(size: 18))
178+
.font(.system(size: 22))
179179
.frame(width: 48, height: 40)
180-
.background(RoundedRectangle(cornerRadius: 12).fill(.gray.opacity(0.08)))
180+
.background(RoundedRectangle(cornerRadius: 12).fill(.gray.opacity(0.15)))
181181
.contentShape(RoundedRectangle(cornerRadius: 12))
182182
}
183183
.buttonStyle(.plain)

0 commit comments

Comments
 (0)