change media
This commit is contained in:
parent
66bd6a99d4
commit
ee4a19155f
@ -131,6 +131,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"GIF" : {
|
||||||
|
"comment" : "Message profile category gifs"
|
||||||
|
},
|
||||||
"Hello, world!" : {
|
"Hello, world!" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
@ -508,6 +511,9 @@
|
|||||||
"Глобальный поиск" : {
|
"Глобальный поиск" : {
|
||||||
"comment" : "Global search section"
|
"comment" : "Global search section"
|
||||||
},
|
},
|
||||||
|
"Голосовые" : {
|
||||||
|
"comment" : "Message profile category voice"
|
||||||
|
},
|
||||||
"Голосовые звонки пока недоступны. Как только включим WebRTC, кнопка оживёт." : {
|
"Голосовые звонки пока недоступны. Как только включим WebRTC, кнопка оживёт." : {
|
||||||
"comment" : "Message profile call action description"
|
"comment" : "Message profile call action description"
|
||||||
},
|
},
|
||||||
@ -522,6 +528,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Группы" : {
|
||||||
|
"comment" : "Message profile category groups"
|
||||||
|
},
|
||||||
"Данные" : {
|
"Данные" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
@ -843,8 +852,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"История медиа синхронизируется. Как только появятся первые вложения, они покажутся здесь списком превью." : {
|
"История вложений скоро подтянется — каждую категорию можно будет открыть отдельно." : {
|
||||||
"comment" : "Message profile media footer"
|
"comment" : "Message profile media footer new"
|
||||||
},
|
},
|
||||||
"Ищем пользователей…" : {
|
"Ищем пользователей…" : {
|
||||||
"comment" : "Global search loading"
|
"comment" : "Global search loading"
|
||||||
@ -1060,6 +1069,9 @@
|
|||||||
},
|
},
|
||||||
"Массовая отчистка" : {
|
"Массовая отчистка" : {
|
||||||
|
|
||||||
|
},
|
||||||
|
"Медиа" : {
|
||||||
|
"comment" : "Message profile category media"
|
||||||
},
|
},
|
||||||
"Медиа, ссылки и файлы" : {
|
"Медиа, ссылки и файлы" : {
|
||||||
"comment" : "Message profile media title"
|
"comment" : "Message profile media title"
|
||||||
@ -1106,6 +1118,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Музыка" : {
|
||||||
|
"comment" : "Message profile category music"
|
||||||
|
},
|
||||||
"Мы используем адрес только для ответа на ваш запрос." : {
|
"Мы используем адрес только для ответа на ваш запрос." : {
|
||||||
"comment" : "feedback: email hint",
|
"comment" : "feedback: email hint",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@ -2145,6 +2160,9 @@
|
|||||||
"Последний вход: %@" : {
|
"Последний вход: %@" : {
|
||||||
"comment" : "Дата последнего входа в сессию"
|
"comment" : "Дата последнего входа в сессию"
|
||||||
},
|
},
|
||||||
|
"Посты" : {
|
||||||
|
"comment" : "Message profile category posts"
|
||||||
|
},
|
||||||
"Похвала" : {
|
"Похвала" : {
|
||||||
"comment" : "feedback category: praise",
|
"comment" : "feedback category: praise",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@ -2383,6 +2401,9 @@
|
|||||||
"Разблокировать" : {
|
"Разблокировать" : {
|
||||||
"comment" : "Message profile unblock alert title\nMessage profile unblock title\nUnblock confirmation action"
|
"comment" : "Message profile unblock alert title\nMessage profile unblock title\nUnblock confirmation action"
|
||||||
},
|
},
|
||||||
|
"Раздел скоро станет активным — собираем и индексируем вложения." : {
|
||||||
|
"comment" : "Message profile media placeholder message"
|
||||||
|
},
|
||||||
"Разрешить пересылку сообщений" : {
|
"Разрешить пересылку сообщений" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
@ -2700,6 +2721,9 @@
|
|||||||
},
|
},
|
||||||
"Сохранение..." : {
|
"Сохранение..." : {
|
||||||
|
|
||||||
|
},
|
||||||
|
"Сохранённые" : {
|
||||||
|
"comment" : "Message profile category saved"
|
||||||
},
|
},
|
||||||
"Сохраните секретный ключ и введите код из приложения, чтобы завершить настройку." : {
|
"Сохраните секретный ключ и введите код из приложения, чтобы завершить настройку." : {
|
||||||
"comment" : "Сообщение после активации 2FA"
|
"comment" : "Сообщение после активации 2FA"
|
||||||
@ -2742,6 +2766,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Ссылки" : {
|
||||||
|
"comment" : "Message profile category links"
|
||||||
|
},
|
||||||
"Старый пароль" : {
|
"Старый пароль" : {
|
||||||
"comment" : "Старый пароль",
|
"comment" : "Старый пароль",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@ -2898,6 +2925,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Файлы" : {
|
||||||
|
"comment" : "Message profile category files"
|
||||||
|
},
|
||||||
"Функция пока недоступна." : {
|
"Функция пока недоступна." : {
|
||||||
"comment" : "Сообщение заглушки"
|
"comment" : "Сообщение заглушки"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -337,28 +337,19 @@ struct MessageProfileView: View {
|
|||||||
description: NSLocalizedString("Плитки как в Telegram — скоро здесь появятся вложения из чата.", comment: "Message profile media description")
|
description: NSLocalizedString("Плитки как в Telegram — скоро здесь появятся вложения из чата.", comment: "Message profile media description")
|
||||||
) {
|
) {
|
||||||
card {
|
card {
|
||||||
LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 8), count: 3), spacing: 8) {
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
ForEach(Array(sharedMediaPlaceholderIcons.enumerated()), id: \.offset) { index, icon in
|
HStack(spacing: 12) {
|
||||||
RoundedRectangle(cornerRadius: 16, style: .continuous)
|
ForEach(mediaCategories) { category in
|
||||||
.fill(sharedMediaPlaceholderColors[index % sharedMediaPlaceholderColors.count])
|
mediaCategoryButton(category)
|
||||||
.frame(height: 72)
|
}
|
||||||
.overlay(
|
|
||||||
Image(systemName: icon)
|
|
||||||
.font(.system(size: 20, weight: .semibold))
|
|
||||||
.foregroundColor(.white.opacity(0.9))
|
|
||||||
)
|
|
||||||
.overlay(
|
|
||||||
RoundedRectangle(cornerRadius: 16, style: .continuous)
|
|
||||||
.stroke(Color.white.opacity(0.18), lineWidth: 1)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
.padding(.vertical, 4)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
|
|
||||||
Text(NSLocalizedString("История медиа синхронизируется. Как только появятся первые вложения, они покажутся здесь списком превью.", comment: "Message profile media footer"))
|
Text(NSLocalizedString("История вложений скоро подтянется — каждую категорию можно будет открыть отдельно.", comment: "Message profile media footer new"))
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.padding(.top, 12)
|
.padding(.top, 16)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -534,6 +525,20 @@ struct MessageProfileView: View {
|
|||||||
showPlaceholderAction(title: title, message: message)
|
showPlaceholderAction(title: title, message: message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var mediaCategories: [MediaCategory] {
|
||||||
|
[
|
||||||
|
MediaCategory(title: NSLocalizedString("Медиа", comment: "Message profile category media"), icon: "photo.on.rectangle", tint: .blue),
|
||||||
|
MediaCategory(title: NSLocalizedString("Сохранённые", comment: "Message profile category saved"), icon: "bookmark.fill", tint: .purple),
|
||||||
|
MediaCategory(title: NSLocalizedString("Файлы", comment: "Message profile category files"), icon: "doc.text.fill", tint: .orange),
|
||||||
|
MediaCategory(title: NSLocalizedString("Голосовые", comment: "Message profile category voice"), icon: "waveform", tint: .green),
|
||||||
|
MediaCategory(title: NSLocalizedString("Ссылки", comment: "Message profile category links"), icon: "link", tint: .pink),
|
||||||
|
MediaCategory(title: NSLocalizedString("Группы", comment: "Message profile category groups"), icon: "person.3.fill", tint: .indigo),
|
||||||
|
MediaCategory(title: NSLocalizedString("Музыка", comment: "Message profile category music"), icon: "music.note", tint: .teal),
|
||||||
|
MediaCategory(title: NSLocalizedString("GIF", comment: "Message profile category gifs"), icon: "sparkles", tint: .yellow),
|
||||||
|
MediaCategory(title: NSLocalizedString("Посты", comment: "Message profile category posts"), icon: "bubble.left.and.bubble.right.fill", tint: .red)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - Derived Data
|
// MARK: - Derived Data
|
||||||
|
|
||||||
private var profileBio: String? {
|
private var profileBio: String? {
|
||||||
@ -685,26 +690,37 @@ struct MessageProfileView: View {
|
|||||||
return tags
|
return tags
|
||||||
}
|
}
|
||||||
|
|
||||||
private var sharedMediaPlaceholderIcons: [String] {
|
private func mediaCategoryButton(_ category: MediaCategory) -> some View {
|
||||||
[
|
Button {
|
||||||
"photo.on.rectangle",
|
showPlaceholderAction(
|
||||||
"doc.text.fill",
|
title: category.title,
|
||||||
"link",
|
message: NSLocalizedString("Раздел скоро станет активным — собираем и индексируем вложения.", comment: "Message profile media placeholder message")
|
||||||
"paperclip",
|
)
|
||||||
"music.note",
|
} label: {
|
||||||
"video.fill"
|
VStack(alignment: .leading, spacing: 6) {
|
||||||
]
|
Image(systemName: category.icon)
|
||||||
}
|
.font(.system(size: 18, weight: .semibold))
|
||||||
|
.foregroundColor(category.tint)
|
||||||
private var sharedMediaPlaceholderColors: [Color] {
|
.frame(width: 36, height: 36)
|
||||||
[
|
.background(category.tint.opacity(0.12))
|
||||||
Color.accentColor.opacity(0.8),
|
.clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
|
||||||
Color.purple.opacity(0.8),
|
Text(category.title)
|
||||||
Color.blue.opacity(0.7),
|
.font(.footnote)
|
||||||
Color.orange.opacity(0.8),
|
.fontWeight(.medium)
|
||||||
Color.green.opacity(0.7),
|
.foregroundColor(.primary)
|
||||||
Color.pink.opacity(0.8)
|
}
|
||||||
]
|
.padding(.vertical, 12)
|
||||||
|
.padding(.horizontal, 14)
|
||||||
|
.background(
|
||||||
|
RoundedRectangle(cornerRadius: 20, style: .continuous)
|
||||||
|
.fill(Color(UIColor.secondarySystemBackground))
|
||||||
|
)
|
||||||
|
.overlay(
|
||||||
|
RoundedRectangle(cornerRadius: 20, style: .continuous)
|
||||||
|
.stroke(Color(UIColor.separator).opacity(0.2), lineWidth: 1)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
.buttonStyle(.plain)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var quickActionItems: [ProfileQuickAction] {
|
private var quickActionItems: [ProfileQuickAction] {
|
||||||
@ -917,6 +933,13 @@ private struct StatusTag: Identifiable {
|
|||||||
let tint: Color
|
let tint: Color
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private struct MediaCategory: Identifiable {
|
||||||
|
let id = UUID()
|
||||||
|
let title: String
|
||||||
|
let icon: String
|
||||||
|
let tint: Color
|
||||||
|
}
|
||||||
|
|
||||||
private struct ProfileQuickAction: Identifiable {
|
private struct ProfileQuickAction: Identifiable {
|
||||||
let id = UUID()
|
let id = UUID()
|
||||||
let icon: String
|
let icon: String
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user