change button in profile
This commit is contained in:
parent
55839ffd5d
commit
66bd6a99d4
@ -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"
|
||||
},
|
||||
"Правила сервиса" : {
|
||||
|
||||
},
|
||||
|
||||
@ -258,31 +258,23 @@ struct MessageProfileView: View {
|
||||
|
||||
if shouldShowRelationshipQuickActions {
|
||||
rowDivider
|
||||
VStack(spacing: 8) {
|
||||
buttonRow(
|
||||
icon: "person.badge.plus",
|
||||
filledActionButton(
|
||||
title: NSLocalizedString("Добавить в контакты", comment: "Message profile add to contacts title"),
|
||||
subtitle: NSLocalizedString("Появится отдельная запись в адресной книге Yobble.", comment: "Message profile add to contacts subtitle"),
|
||||
iconTint: .accentColor
|
||||
tint: Color.accentColor
|
||||
) {
|
||||
handleAddContactTap()
|
||||
}
|
||||
|
||||
buttonRow(
|
||||
icon: "hand.raised.slash.fill",
|
||||
rowDivider
|
||||
filledActionButton(
|
||||
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
|
||||
tint: isBlockedByCurrentUser ? Color.green : Color.red
|
||||
) {
|
||||
handleBlockToggleTap()
|
||||
}
|
||||
}
|
||||
.padding(.top, 4)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<Content: View>(color: Color, @ViewBuilder content: () -> Content) -> some View {
|
||||
RoundedRectangle(cornerRadius: 14, style: .continuous)
|
||||
.fill(color)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user