Skip to content

Commit ebd0831

Browse files
authored
Fix quote notification layout (#2342)
* Fix quote notification layout * Enable text for quote notifications and adjust padding Text is now enabled only for notifications of type .quote by updating the textDisabled property. Additionally, a bottom padding of 8 is added to the NotificationRowStatusView for improved layout.
1 parent 7a1663d commit ebd0831

File tree

2 files changed

+35
-21
lines changed

2 files changed

+35
-21
lines changed

Packages/Notifications/Sources/Notifications/Models/NotificationTypeExt.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension Models.Notification.NotificationType {
2222
case .update:
2323
"notifications.label.update"
2424
case .quote:
25-
"quoted a status"
25+
"quoted your post"
2626
case .quoted_update:
2727
"updated a quoted status"
2828
}

Packages/Notifications/Sources/Notifications/Row/NotificationRowContentView.swift

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,41 @@ struct NotificationRowContentView: View {
1414

1515
var body: some View {
1616
if let status = notification.status {
17-
HStack {
18-
if notification.type == .mention {
19-
StatusRowExternalView(
20-
viewModel: .init(
21-
status: status,
22-
client: client,
23-
routerPath: routerPath,
24-
showActions: true)
25-
)
26-
.environment(\.isNotificationsTab, false)
27-
.environment(\.isMediaCompact, false)
28-
} else {
29-
StatusRowExternalView(
30-
viewModel: .init(
31-
status: status,
17+
HStack(alignment: .top) {
18+
VStack(alignment: .leading, spacing: 8) {
19+
if notification.type == .mention {
20+
StatusRowExternalView(
21+
viewModel: .init(
22+
status: status,
23+
client: client,
24+
routerPath: routerPath,
25+
showActions: true)
26+
)
27+
.environment(\.isNotificationsTab, false)
28+
.environment(\.isMediaCompact, false)
29+
} else {
30+
StatusRowExternalView(
31+
viewModel: .init(
32+
status: status,
33+
client: client,
34+
routerPath: routerPath,
35+
showActions: false,
36+
textDisabled: notification.type != .quote)
37+
)
38+
.environment(\.isMediaCompact, true)
39+
}
40+
41+
if notification.type == .quote,
42+
status.quote?.state == .accepted,
43+
let quotedStatus = status.quote?.quotedStatus
44+
{
45+
StatusEmbeddedView(
46+
status: quotedStatus,
3247
client: client,
33-
routerPath: routerPath,
34-
showActions: false,
35-
textDisabled: true)
36-
)
37-
.environment(\.isMediaCompact, true)
48+
routerPath: routerPath
49+
)
50+
.padding(.bottom, 8)
51+
}
3852
}
3953
Spacer()
4054
}

0 commit comments

Comments
 (0)