add ideas

This commit is contained in:
cheykrym 2025-10-06 04:03:21 +03:00
parent 200b0172eb
commit 21dd8f01af
5 changed files with 148 additions and 20 deletions

View File

@ -79,6 +79,9 @@
}, },
"Безопасность" : { "Безопасность" : {
},
"Ваше предложение" : {
}, },
"Войти" : { "Войти" : {
"localizations" : { "localizations" : {
@ -89,6 +92,9 @@
} }
} }
} }
},
"Вы предложили: %@" : {
}, },
"Выйти из аккаунта" : { "Выйти из аккаунта" : {
@ -185,6 +191,9 @@
}, },
"Здесь не будут чаты" : { "Здесь не будут чаты" : {
},
"Идеи" : {
}, },
"Инвайт-код (необязательно)" : { "Инвайт-код (необязательно)" : {
"comment" : "Инвайт-код", "comment" : "Инвайт-код",
@ -213,6 +222,9 @@
}, },
"Как связаться с поддержкой?" : { "Как связаться с поддержкой?" : {
"comment" : "FAQ question: support" "comment" : "FAQ question: support"
},
"Какая вкладка вам нужна?" : {
}, },
"Корзина" : { "Корзина" : {
"comment" : "Cart", "comment" : "Cart",
@ -302,9 +314,15 @@
}, },
"Мой профиль" : { "Мой профиль" : {
},
"Мы планируем заменить вкладку. Поделитесь, что бы вы хотели видеть здесь чаще всего." : {
}, },
"Напишите нам через форму обратной связи в разделе \"Поддержка\"." : { "Напишите нам через форму обратной связи в разделе \"Поддержка\"." : {
"comment" : "FAQ answer: support" "comment" : "FAQ answer: support"
},
"Например: закладки, друзья, активность..." : {
}, },
"Настройки" : { "Настройки" : {
"comment" : "Settings", "comment" : "Settings",
@ -361,6 +379,12 @@
}, },
"Отображаемое имя" : { "Отображаемое имя" : {
},
"Отправить предложение" : {
},
"Отправляем..." : {
}, },
"Ошибка авторизации" : { "Ошибка авторизации" : {
@ -394,9 +418,6 @@
}, },
"Подтверждение пароля" : { "Подтверждение пароля" : {
"comment" : "Подтверждение пароля" "comment" : "Подтверждение пароля"
},
"Поиск" : {
}, },
"Помощь" : { "Помощь" : {
"comment" : "Help Center", "comment" : "Help Center",
@ -470,6 +491,9 @@
}, },
"Сменить пароль" : { "Сменить пароль" : {
},
"Спасибо!" : {
}, },
"Тёмная тема" : { "Тёмная тема" : {

View File

@ -12,7 +12,7 @@ struct CustomTabBar: View {
} }
// Tab 2: Search // Tab 2: Search
TabBarButton(systemName: "magnifyingglass", text: NSLocalizedString("Поиск", comment: ""), isSelected: selectedTab == 1) { TabBarButton(systemName: "lightbulb", text: NSLocalizedString("Идеи", comment: ""), isSelected: selectedTab == 1) {
selectedTab = 1 selectedTab = 1
} }

View File

@ -0,0 +1,118 @@
import SwiftUI
struct FeedbackTab: View {
@State private var suggestion: String = ""
@State private var submittedSuggestion: String? = nil
@State private var isSubmitting: Bool = false
@State private var showSubmissionMessage: Bool = false
var body: some View {
ScrollView {
VStack(alignment: .leading, spacing: 20) {
Text(NSLocalizedString("Какая вкладка вам нужна?", comment: ""))
.font(.title2)
.fontWeight(.semibold)
Text(NSLocalizedString(
"Мы планируем заменить вкладку. Поделитесь, что бы вы хотели видеть здесь чаще всего.",
comment: ""
))
.foregroundColor(.secondary)
VStack(alignment: .leading, spacing: 12) {
Text(NSLocalizedString("Ваше предложение", comment: ""))
.font(.headline)
TextEditor(text: $suggestion)
.frame(minHeight: 120)
.padding(12)
.background(
RoundedRectangle(cornerRadius: 12)
.fill(Color(.systemGray6))
)
.overlay(
RoundedRectangle(cornerRadius: 12)
.stroke(Color(.systemGray4))
)
.overlay(
Group {
if suggestion.isEmpty {
Text(NSLocalizedString("Например: закладки, друзья, активность...", comment: ""))
.foregroundColor(.secondary)
.padding(18)
.allowsHitTesting(false)
}
}
)
.disableAutocorrection(true)
}
Button(action: submitSuggestion) {
HStack {
if isSubmitting {
ProgressView()
.progressViewStyle(CircularProgressViewStyle())
}
Text(isSubmitting
? NSLocalizedString("Отправляем...", comment: "")
: NSLocalizedString("Отправить предложение", comment: ""))
.fontWeight(.semibold)
}
.frame(maxWidth: .infinity)
.padding()
.background(suggestionIsValid ? Color.accentColor : Color(.systemGray4))
.foregroundColor(.white)
.cornerRadius(14)
}
.disabled(!suggestionIsValid || isSubmitting)
if let submittedSuggestion, showSubmissionMessage {
VStack(alignment: .leading, spacing: 8) {
Text(NSLocalizedString("Спасибо!", comment: ""))
.font(.headline)
Text(String(format: NSLocalizedString("Вы предложили: %@", comment: ""), submittedSuggestion))
.foregroundColor(.secondary)
}
.transition(.opacity)
}
Spacer(minLength: 24)
// Text(NSLocalizedString(
// "Позже мы добавим отправку на сервер, чтобы собрать статистику, и расскажем о результатах в обновлениях.",
// comment: ""
// ))
// .font(.footnote)
// .foregroundColor(.secondary)
}
.padding(.horizontal, 20)
.padding(.vertical, 32)
}
}
private var suggestionIsValid: Bool {
!suggestion.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
}
private func submitSuggestion() {
guard suggestionIsValid else { return }
let trimmed = suggestion.trimmingCharacters(in: .whitespacesAndNewlines)
isSubmitting = true
DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) { // имитируем сетевой вызов
submittedSuggestion = trimmed
suggestion = ""
withAnimation {
showSubmissionMessage = true
}
isSubmitting = false
}
}
}
struct FeedbackTab_Previews: PreviewProvider {
static var previews: some View {
FeedbackTab()
.environmentObject(ThemeManager())
}
}

View File

@ -17,7 +17,7 @@ struct MainView: View {
private var tabTitle: String { private var tabTitle: String {
switch selectedTab { switch selectedTab {
case 0: return "Home" case 0: return "Home"
case 1: return "Search" case 1: return "Ideas"
case 2: return "Chats" case 2: return "Chats"
case 3: return "Profile" case 3: return "Profile"
default: return "Home" default: return "Home"
@ -45,7 +45,7 @@ struct MainView: View {
NewHomeTab() NewHomeTab()
.opacity(selectedTab == 0 ? 1 : 0) .opacity(selectedTab == 0 ? 1 : 0)
SearchTab() FeedbackTab()
.opacity(selectedTab == 1 ? 1 : 0) .opacity(selectedTab == 1 ? 1 : 0)
ChatsTab() ChatsTab()

View File

@ -1,14 +0,0 @@
import SwiftUI
struct SearchTab: View {
var body: some View {
VStack {
Text("Здесь не будут чаты")
.font(.title)
.foregroundColor(.gray)
Spacer()
}
}
}