From 2f68345c569aa1eba31589c3ec98a2852e87dc62 Mon Sep 17 00:00:00 2001 From: cheykrym Date: Tue, 7 Oct 2025 04:47:03 +0300 Subject: [PATCH] add new tabs --- yobble/Resources/Localizable.xcstrings | 16 +++++++++ yobble/Views/Tab/ConceptTab.swift | 33 +++++++++++++++++++ yobble/Views/Tab/CustomTabBar.swift | 2 +- yobble/Views/Tab/MainView.swift | 4 +-- yobble/Views/Tab/Settings/FAQView.swift | 30 ++++++++++++----- .../FeedbackView.swift} | 8 ++--- 6 files changed, 78 insertions(+), 15 deletions(-) create mode 100644 yobble/Views/Tab/ConceptTab.swift rename yobble/Views/Tab/{FeedbackTab.swift => Settings/FeedbackView.swift} (97%) diff --git a/yobble/Resources/Localizable.xcstrings b/yobble/Resources/Localizable.xcstrings index ef6c18e..9df8ea2 100644 --- a/yobble/Resources/Localizable.xcstrings +++ b/yobble/Resources/Localizable.xcstrings @@ -235,6 +235,9 @@ } } }, + "Если не нашли ответ, напишите нам своё предложение или проблему." : { + "comment" : "FAQ: contact developers footer" + }, "Заглушка: Push-уведомления" : { }, @@ -333,6 +336,7 @@ } }, "Идеи" : { + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -396,6 +400,12 @@ } } }, + "Кликер в разработке" : { + "comment" : "Concept tab placeholder title" + }, + "Концепт" : { + "comment" : "Tab bar: concept clicker" + }, "Корзина" : { "comment" : "Cart", "localizations" : { @@ -1124,6 +1134,9 @@ } } }, + "Связаться с разработчиками" : { + "comment" : "FAQ: contact developers link" + }, "Сервер не отвечает. Попробуйте позже." : { "localizations" : { "en" : { @@ -1165,6 +1178,9 @@ } } }, + "Скоро появится мини-игра, где можно заработать очки для кастомизации профиля. Следите за обновлениями!" : { + "comment" : "Concept tab placeholder description" + }, "Слишком много запросов." : { "localizations" : { "en" : { diff --git a/yobble/Views/Tab/ConceptTab.swift b/yobble/Views/Tab/ConceptTab.swift new file mode 100644 index 0000000..8aeb614 --- /dev/null +++ b/yobble/Views/Tab/ConceptTab.swift @@ -0,0 +1,33 @@ +import SwiftUI + +struct ConceptTab: View { + var body: some View { + ScrollView { + VStack(spacing: 24) { + Image(systemName: "gamecontroller.fill") + .resizable() + .scaledToFit() + .frame(width: 96, height: 96) + .foregroundColor(.accentColor) + + Text(NSLocalizedString("Кликер в разработке", comment: "Concept tab placeholder title")) + .font(.title2) + .fontWeight(.semibold) + + Text(NSLocalizedString("Скоро появится мини-игра, где можно заработать очки для кастомизации профиля. Следите за обновлениями!", comment: "Concept tab placeholder description")) + .font(.body) + .multilineTextAlignment(.center) + .foregroundColor(.secondary) + .padding(.horizontal) + } + .padding(.vertical, 48) + .frame(maxWidth: .infinity) + } + .background(Color(UIColor.systemGroupedBackground)) + } +} + +#Preview { + ConceptTab() + .environmentObject(ThemeManager()) +} diff --git a/yobble/Views/Tab/CustomTabBar.swift b/yobble/Views/Tab/CustomTabBar.swift index 6a818ac..a4bab42 100644 --- a/yobble/Views/Tab/CustomTabBar.swift +++ b/yobble/Views/Tab/CustomTabBar.swift @@ -12,7 +12,7 @@ struct CustomTabBar: View { } // Tab 2: Search - TabBarButton(systemName: "lightbulb", text: NSLocalizedString("Идеи", comment: ""), isSelected: selectedTab == 1) { + TabBarButton(systemName: "gamecontroller.fill", text: NSLocalizedString("Концепт", comment: "Tab bar: concept clicker"), isSelected: selectedTab == 1) { selectedTab = 1 } diff --git a/yobble/Views/Tab/MainView.swift b/yobble/Views/Tab/MainView.swift index 8327632..db3bc2f 100644 --- a/yobble/Views/Tab/MainView.swift +++ b/yobble/Views/Tab/MainView.swift @@ -18,7 +18,7 @@ struct MainView: View { private var tabTitle: String { switch selectedTab { case 0: return "Home" - case 1: return "Ideas" + case 1: return "Concept" case 2: return "Chats" case 3: return "Profile" default: return "Home" @@ -47,7 +47,7 @@ struct MainView: View { NewHomeTab() .opacity(selectedTab == 0 ? 1 : 0) - FeedbackTab() + ConceptTab() .opacity(selectedTab == 1 ? 1 : 0) ChatsTab( diff --git a/yobble/Views/Tab/Settings/FAQView.swift b/yobble/Views/Tab/Settings/FAQView.swift index b9c07cf..c71eb2f 100644 --- a/yobble/Views/Tab/Settings/FAQView.swift +++ b/yobble/Views/Tab/Settings/FAQView.swift @@ -23,15 +23,29 @@ struct FAQView: View { ] var body: some View { - List(faqItems) { item in - VStack(alignment: .leading, spacing: 6) { - Text(item.question) - .font(.headline) - Text(item.answer) - .font(.subheadline) - .foregroundColor(.secondary) + List { + ForEach(faqItems) { item in + VStack(alignment: .leading, spacing: 6) { + Text(item.question) + .font(.headline) + Text(item.answer) + .font(.subheadline) + .foregroundColor(.secondary) + } + .padding(.vertical, 6) + } + + Section { + NavigationLink(destination: FeedbackView()) { + Text(NSLocalizedString("Связаться с разработчиками", comment: "FAQ: contact developers link")) + .font(.callout) + .fontWeight(.semibold) + .foregroundColor(.accentColor) + } + } footer: { + Text(NSLocalizedString("Если не нашли ответ, напишите нам своё предложение или проблему.", comment: "FAQ: contact developers footer")) + .font(.footnote) } - .padding(.vertical, 6) } .listStyle(.insetGrouped) .navigationTitle(NSLocalizedString("Частые вопросы", comment: "FAQ navigation title")) diff --git a/yobble/Views/Tab/FeedbackTab.swift b/yobble/Views/Tab/Settings/FeedbackView.swift similarity index 97% rename from yobble/Views/Tab/FeedbackTab.swift rename to yobble/Views/Tab/Settings/FeedbackView.swift index 09c9b6e..47e9069 100644 --- a/yobble/Views/Tab/FeedbackTab.swift +++ b/yobble/Views/Tab/Settings/FeedbackView.swift @@ -3,7 +3,7 @@ import SwiftUI import UIKit #endif -struct FeedbackTab: View { +struct FeedbackView: View { @State private var suggestion: String = "" @State private var submittedSuggestion: String? = nil @State private var isSubmitting: Bool = false @@ -122,7 +122,7 @@ struct FeedbackTab: View { } } -private extension FeedbackTab { +private extension FeedbackView { func dismissKeyboardIfNeeded() { guard isSuggestionFocused else { return } isSuggestionFocused = false @@ -133,9 +133,9 @@ private extension FeedbackTab { } } -struct FeedbackTab_Previews: PreviewProvider { +struct FeedbackView_Previews: PreviewProvider { static var previews: some View { - FeedbackTab() + FeedbackView() .environmentObject(ThemeManager()) } }