This commit is contained in:
Vladimir Dubovik 2024-12-03 13:56:08 +03:00
parent 2b506ce538
commit 155a175635
3 changed files with 22 additions and 26 deletions

View File

@ -21,7 +21,6 @@ struct ContentView: View {
} }
TabBarView(selectedTab: $selectedTab) TabBarView(selectedTab: $selectedTab)
} }
.background(Color("background"))
} }
} }

View File

@ -72,7 +72,7 @@ struct ScheduleView: View {
} }
} }
} }
.background(.secondary.opacity(0.1)) .background(Color("background"))
.onAppear(perform: { .onAppear(perform: {
if weekSlider.isEmpty { if weekSlider.isEmpty {
let currentWeek = Date().fetchWeek() let currentWeek = Date().fetchWeek()

View File

@ -13,37 +13,34 @@ struct SearchBarView: View {
.padding(.trailing, 7) .padding(.trailing, 7)
TextField("Поиск группы", text: $text) TextField("Поиск группы", text: $text)
.disableAutocorrection(true) .disableAutocorrection(true)
.frame(width: .infinity, height: 40)
.onTapGesture { .onTapGesture {
self.isEditing = true self.isEditing = true
} }
.onSubmit { .onSubmit {
self.isEditing = false self.isEditing = false
} }
if isEditing { ZStack {
Button {
self.text = ""
self.isEditing = false
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
} label: {
Image(systemName: "xmark.circle.fill")
.padding(.trailing, 20)
.offset(x: 10)
.foregroundColor(.gray)
.background(
Rectangle()
.frame(width: 40, height: 40)
.foregroundColor(.white)
.cornerRadius(15)
)
}
.background(Color.white)
}
else {
Rectangle() Rectangle()
.frame(width: 40, height: 40) .frame(width: 40, height: 40)
.foregroundColor(.white) .foregroundColor(.white)
.cornerRadius(15) .cornerRadius(15)
Group {
if isEditing {
Button {
self.text = ""
self.isEditing = false
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
} label: {
Image(systemName: "xmark.circle.fill")
.padding(.trailing, 20)
.offset(x: 10)
.foregroundColor(.gray)
.background(
)
}
.background(Color.white)
}
}
} }
} }
.background( .background(
@ -56,7 +53,7 @@ struct SearchBarView: View {
} label: { } label: {
ZStack { ZStack {
Rectangle() Rectangle()
.frame(width: 36, height: 36) .frame(width: 40)
.foregroundStyle(Color("blueColor")) .foregroundStyle(Color("blueColor"))
.cornerRadius(15) .cornerRadius(15)
Image(systemName: "plus") Image(systemName: "plus")
@ -67,9 +64,9 @@ struct SearchBarView: View {
} }
} }
} }
.frame(width: .infinity)
.padding(.horizontal) .padding(.horizontal)
.padding(.vertical, 5) .padding(.top, 5)
.frame(height: 40)
} }
} }