diff --git a/Schedule ICTIS/ContentView.swift b/Schedule ICTIS/ContentView.swift index 1be01bf..396c9f3 100644 --- a/Schedule ICTIS/ContentView.swift +++ b/Schedule ICTIS/ContentView.swift @@ -21,7 +21,6 @@ struct ContentView: View { } TabBarView(selectedTab: $selectedTab) } - .background(Color("background")) } } diff --git a/Schedule ICTIS/ScheduleView.swift b/Schedule ICTIS/ScheduleView.swift index ff4ceca..3a4512d 100644 --- a/Schedule ICTIS/ScheduleView.swift +++ b/Schedule ICTIS/ScheduleView.swift @@ -72,7 +72,7 @@ struct ScheduleView: View { } } } - .background(.secondary.opacity(0.1)) + .background(Color("background")) .onAppear(perform: { if weekSlider.isEmpty { let currentWeek = Date().fetchWeek() diff --git a/Schedule ICTIS/SearchBarView.swift b/Schedule ICTIS/SearchBarView.swift index 92ce693..930bd1b 100644 --- a/Schedule ICTIS/SearchBarView.swift +++ b/Schedule ICTIS/SearchBarView.swift @@ -13,37 +13,34 @@ struct SearchBarView: View { .padding(.trailing, 7) TextField("Поиск группы", text: $text) .disableAutocorrection(true) - .frame(width: .infinity, height: 40) .onTapGesture { self.isEditing = true } .onSubmit { self.isEditing = false } - 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( - Rectangle() - .frame(width: 40, height: 40) - .foregroundColor(.white) - .cornerRadius(15) - ) - } - .background(Color.white) - } - else { + ZStack { Rectangle() .frame(width: 40, height: 40) .foregroundColor(.white) .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( @@ -56,7 +53,7 @@ struct SearchBarView: View { } label: { ZStack { Rectangle() - .frame(width: 36, height: 36) + .frame(width: 40) .foregroundStyle(Color("blueColor")) .cornerRadius(15) Image(systemName: "plus") @@ -67,9 +64,9 @@ struct SearchBarView: View { } } } - .frame(width: .infinity) .padding(.horizontal) - .padding(.vertical, 5) + .padding(.top, 5) + .frame(height: 40) } }