Compare commits
2 Commits
359b516272
...
2f68345c56
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f68345c56 | |||
| 9952ca6d2b |
@ -235,6 +235,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Если не нашли ответ, напишите нам своё предложение или проблему." : {
|
||||||
|
"comment" : "FAQ: contact developers footer"
|
||||||
|
},
|
||||||
"Заглушка: Push-уведомления" : {
|
"Заглушка: Push-уведомления" : {
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -333,6 +336,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Идеи" : {
|
"Идеи" : {
|
||||||
|
"extractionState" : "stale",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
@ -396,6 +400,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Кликер в разработке" : {
|
||||||
|
"comment" : "Concept tab placeholder title"
|
||||||
|
},
|
||||||
|
"Концепт" : {
|
||||||
|
"comment" : "Tab bar: concept clicker"
|
||||||
|
},
|
||||||
"Корзина" : {
|
"Корзина" : {
|
||||||
"comment" : "Cart",
|
"comment" : "Cart",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@ -1124,6 +1134,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Связаться с разработчиками" : {
|
||||||
|
"comment" : "FAQ: contact developers link"
|
||||||
|
},
|
||||||
"Сервер не отвечает. Попробуйте позже." : {
|
"Сервер не отвечает. Попробуйте позже." : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
@ -1165,6 +1178,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Скоро появится мини-игра, где можно заработать очки для кастомизации профиля. Следите за обновлениями!" : {
|
||||||
|
"comment" : "Concept tab placeholder description"
|
||||||
|
},
|
||||||
"Слишком много запросов." : {
|
"Слишком много запросов." : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
#if canImport(UIKit)
|
||||||
|
import UIKit
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ChatsTab: View {
|
struct ChatsTab: View {
|
||||||
var currentUserId: String?
|
var currentUserId: String?
|
||||||
@ -125,7 +128,9 @@ struct ChatsTab: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listStyle(.plain)
|
.listStyle(.plain)
|
||||||
|
.modifier(ScrollDismissesKeyboardModifier())
|
||||||
.simultaneousGesture(searchBarGesture)
|
.simultaneousGesture(searchBarGesture)
|
||||||
|
.simultaneousGesture(tapToDismissKeyboardGesture)
|
||||||
// .safeAreaInset(edge: .top) {
|
// .safeAreaInset(edge: .top) {
|
||||||
// VStack(spacing: 0) {
|
// VStack(spacing: 0) {
|
||||||
// searchBar
|
// searchBar
|
||||||
@ -193,6 +198,12 @@ struct ChatsTab: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var tapToDismissKeyboardGesture: some Gesture {
|
||||||
|
TapGesture().onEnded {
|
||||||
|
dismissKeyboard()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var isSearching: Bool {
|
private var isSearching: Bool {
|
||||||
!searchText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
|
!searchText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
|
||||||
}
|
}
|
||||||
@ -286,6 +297,24 @@ struct ChatsTab: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension ChatsTab {
|
||||||
|
func dismissKeyboard() {
|
||||||
|
#if canImport(UIKit)
|
||||||
|
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private struct ScrollDismissesKeyboardModifier: ViewModifier {
|
||||||
|
func body(content: Content) -> some View {
|
||||||
|
if #available(iOS 16.0, *) {
|
||||||
|
content.scrollDismissesKeyboard(.interactively)
|
||||||
|
} else {
|
||||||
|
content
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private struct ChatRowView: View {
|
private struct ChatRowView: View {
|
||||||
let chat: PrivateChatListItem
|
let chat: PrivateChatListItem
|
||||||
let currentUserId: String?
|
let currentUserId: String?
|
||||||
|
|||||||
33
yobble/Views/Tab/ConceptTab.swift
Normal file
33
yobble/Views/Tab/ConceptTab.swift
Normal file
@ -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())
|
||||||
|
}
|
||||||
@ -12,7 +12,7 @@ struct CustomTabBar: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Tab 2: Search
|
// 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
|
selectedTab = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,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 "Ideas"
|
case 1: return "Concept"
|
||||||
case 2: return "Chats"
|
case 2: return "Chats"
|
||||||
case 3: return "Profile"
|
case 3: return "Profile"
|
||||||
default: return "Home"
|
default: return "Home"
|
||||||
@ -47,7 +47,7 @@ struct MainView: View {
|
|||||||
NewHomeTab()
|
NewHomeTab()
|
||||||
.opacity(selectedTab == 0 ? 1 : 0)
|
.opacity(selectedTab == 0 ? 1 : 0)
|
||||||
|
|
||||||
FeedbackTab()
|
ConceptTab()
|
||||||
.opacity(selectedTab == 1 ? 1 : 0)
|
.opacity(selectedTab == 1 ? 1 : 0)
|
||||||
|
|
||||||
ChatsTab(
|
ChatsTab(
|
||||||
|
|||||||
@ -23,7 +23,8 @@ struct FAQView: View {
|
|||||||
]
|
]
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List(faqItems) { item in
|
List {
|
||||||
|
ForEach(faqItems) { item in
|
||||||
VStack(alignment: .leading, spacing: 6) {
|
VStack(alignment: .leading, spacing: 6) {
|
||||||
Text(item.question)
|
Text(item.question)
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
@ -33,6 +34,19 @@ struct FAQView: View {
|
|||||||
}
|
}
|
||||||
.padding(.vertical, 6)
|
.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)
|
||||||
|
}
|
||||||
|
}
|
||||||
.listStyle(.insetGrouped)
|
.listStyle(.insetGrouped)
|
||||||
.navigationTitle(NSLocalizedString("Частые вопросы", comment: "FAQ navigation title"))
|
.navigationTitle(NSLocalizedString("Частые вопросы", comment: "FAQ navigation title"))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import SwiftUI
|
|||||||
import UIKit
|
import UIKit
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct FeedbackTab: View {
|
struct FeedbackView: View {
|
||||||
@State private var suggestion: String = ""
|
@State private var suggestion: String = ""
|
||||||
@State private var submittedSuggestion: String? = nil
|
@State private var submittedSuggestion: String? = nil
|
||||||
@State private var isSubmitting: Bool = false
|
@State private var isSubmitting: Bool = false
|
||||||
@ -122,7 +122,7 @@ struct FeedbackTab: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension FeedbackTab {
|
private extension FeedbackView {
|
||||||
func dismissKeyboardIfNeeded() {
|
func dismissKeyboardIfNeeded() {
|
||||||
guard isSuggestionFocused else { return }
|
guard isSuggestionFocused else { return }
|
||||||
isSuggestionFocused = false
|
isSuggestionFocused = false
|
||||||
@ -133,9 +133,9 @@ private extension FeedbackTab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FeedbackTab_Previews: PreviewProvider {
|
struct FeedbackView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
FeedbackTab()
|
FeedbackView()
|
||||||
.environmentObject(ThemeManager())
|
.environmentObject(ThemeManager())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user