diff --git a/yobble/Resources/Localizable.xcstrings b/yobble/Resources/Localizable.xcstrings index 569b2b6..70b11ef 100644 --- a/yobble/Resources/Localizable.xcstrings +++ b/yobble/Resources/Localizable.xcstrings @@ -1943,9 +1943,6 @@ "Перейдите в раздел \"Настройки > Сменить пароль\" и следуйте инструкциям." : { "comment" : "FAQ answer: reset password" }, - "Перестанет появляться в чате и не сможет писать." : { - "comment" : "Message profile block subtitle" - }, "Плитки как в Telegram — скоро здесь появятся вложения из чата." : { "comment" : "Message profile media description" }, @@ -2119,9 +2116,6 @@ } } }, - "Пользователь снова сможет писать вам." : { - "comment" : "Message profile unblock subtitle" - }, "Пользователь удалён" : { "comment" : "Message profile deleted user status" }, @@ -2165,9 +2159,6 @@ "Появится мутация на 1 час, 1 день или навсегда." : { "comment" : "Message profile mute action description" }, - "Появится отдельная запись в адресной книге Yobble." : { - "comment" : "Message profile add to contacts subtitle" - }, "Правила сервиса" : { }, diff --git a/yobble/Views/Chat/MessageProfileView.swift b/yobble/Views/Chat/MessageProfileView.swift index 48d6412..f8f3348 100644 --- a/yobble/Views/Chat/MessageProfileView.swift +++ b/yobble/Views/Chat/MessageProfileView.swift @@ -258,31 +258,23 @@ struct MessageProfileView: View { if shouldShowRelationshipQuickActions { rowDivider - VStack(spacing: 8) { - buttonRow( - icon: "person.badge.plus", - title: NSLocalizedString("Добавить в контакты", comment: "Message profile add to contacts title"), - subtitle: NSLocalizedString("Появится отдельная запись в адресной книге Yobble.", comment: "Message profile add to contacts subtitle"), - iconTint: .accentColor - ) { - handleAddContactTap() - } - - buttonRow( - icon: "hand.raised.slash.fill", - title: isBlockedByCurrentUser - ? NSLocalizedString("Разблокировать", comment: "Message profile unblock title") - : NSLocalizedString("Заблокировать", comment: "Message profile block title"), - subtitle: isBlockedByCurrentUser - ? NSLocalizedString("Пользователь снова сможет писать вам.", comment: "Message profile unblock subtitle") - : NSLocalizedString("Перестанет появляться в чате и не сможет писать.", comment: "Message profile block subtitle"), - iconTint: .red, - destructive: true - ) { - handleBlockToggleTap() - } + filledActionButton( + title: NSLocalizedString("Добавить в контакты", comment: "Message profile add to contacts title"), + tint: Color.accentColor + ) { + handleAddContactTap() } - .padding(.top, 4) + + rowDivider + filledActionButton( + title: isBlockedByCurrentUser + ? NSLocalizedString("Разблокировать", comment: "Message profile unblock title") + : NSLocalizedString("Заблокировать", comment: "Message profile block title"), + tint: isBlockedByCurrentUser ? Color.green : Color.red + ) { + handleBlockToggleTap() + } + } } @@ -483,6 +475,30 @@ struct MessageProfileView: View { .buttonStyle(.plain) } + private func filledActionButton( + title: String, + subtitle: String? = nil, + tint: Color, + action: @escaping () -> Void + ) -> some View { + Button(action: action) { + VStack(alignment: .leading, spacing: 4) { + Text(title) + .font(.body) + .fontWeight(.semibold) + if let subtitle { + Text(subtitle) + .font(.caption) + .foregroundColor(tint.opacity(0.7)) + } + } + .foregroundColor(tint) + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.vertical, 10) + } + .buttonStyle(.plain) + } + private func iconBackground(color: Color, @ViewBuilder content: () -> Content) -> some View { RoundedRectangle(cornerRadius: 14, style: .continuous) .fill(color)