Skip to content

Commit

Permalink
Fix NavigationLinks to conform to new look
Browse files Browse the repository at this point in the history
  • Loading branch information
adisve committed Mar 29, 2023
1 parent 6b27119 commit 96f1451
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
{
"identity" : "permissionsswiftui",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jevonmao/PermissionsSwiftUI.git",
"location" : "https://github.com/jevonmao/PermissionsSwiftUI",
"state" : {
"revision" : "8b0b2e6b4ddf52d0d41f5f7b06e139f498f84e6b",
"version" : "1.5.6"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ extension Color {
static let primary = Color("PrimaryColor")
static let onPrimary = Color("OnPrimary")
static let secondary = Color("SecondaryColor")
static let background = Color("BackgroundColor")
static let onBackground = Color("OnBackground")
static let surface = Color("SurfaceColor")
static let onSurface = Color("OnSurface")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension Image {
func drawerIcon() -> some View {
self.font(.system(size: 18))
.frame(width: 15, height: 15)
.foregroundColor(.background)
.foregroundColor(Color(UIColor.systemBackground))
.padding(5)
.background(Color.onBackground)
.clipShape(RoundedRectangle(cornerRadius: 10))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct ToastView: View {
}
.padding()
}
.background(Color.background)
.background(Color(UIColor.systemBackground))
.overlay(
Rectangle()
.fill(type.themeColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct AccountPage: View {
}
.frame(maxHeight: .infinity)
.ignoresSafeArea(.keyboard)
.background(Color.background)
.background(Color(UIColor.systemBackground))
.padding(.bottom, -10)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct AccountLogin: View {
}
.padding(.horizontal, 15)
.padding(.top, 20)
.background(Color.background)
.background(Color(UIColor.systemBackground))
.frame(width: geometry.size.width, height: geometry.size.height) // Set the frame size to match the screen size
}
.ignoresSafeArea(.keyboard)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct UserOverview: View {
}
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
.background(Color.background)
.background(Color(UIColor.systemBackground))
.cornerRadius(20, corners: [.bottomLeft, .bottomRight])
Divider()
.foregroundColor(.onBackground)
Expand All @@ -56,7 +56,7 @@ struct UserOverview: View {
.onAppear {
getResourcesAndEvents()
}
.background(Color.background)
.background(Color(UIColor.systemBackground))
.toastView(toast: $toast)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct EventBookings: View {
.frame(minHeight: geo.size.height)
}
}
.background(Color.background)
.background(Color(UIColor.systemBackground))
.frame(maxHeight: .infinity, alignment: .center)
}
.onAppear {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ struct BookResource: View {
parentViewModel: parentViewModel,
resource: resource,
selectedPickerDate: selectedPickerDate
).customNavigationBackButton(
previousPage: "Date"
)
.navigationTitle("Rooms")
.navigationBarTitleDisplayMode(.inline)
}, label: {
HStack (spacing: 0) {
VStack (alignment: .leading, spacing: 10) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct ResourceBookings: View {
maxHeight: .infinity,
alignment: .top
)
.background(Color.background)
.background(Color(UIColor.systemBackground))
.onAppear {
viewModel.getAllResourceData(date: selectedPickerDate)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct ResourceDatePicker: View {
.padding(.horizontal, 15)
.datePickerStyle(.graphical)
.accentColor(Color.primary)
.background(Color.background)
.background(Color(UIColor.systemBackground))
.environment(\.locale, Locale(identifier: "en_GB"))
.environment(\.calendar, Calendar(identifier: .iso8601))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct ResourceSelection: View {
maxHeight: .infinity,
alignment: .top
)
.background(Color.background)
.background(Color(UIColor.systemBackground))
.onAppear {
for timeslot in timeslots {
if let timeslotId = timeslot.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ struct Resources: View {
ResourceSectionDivider (title: "Your bookings", resourceType: .resource,
destination: AnyView(
ResourceBookings(viewModel: parentViewModel.resourceViewModel)
.customNavigationBackButton(previousPage: "Account"))) {
.navigationTitle("Resources")
.navigationBarTitleDisplayMode(.inline)
)) {
RegisteredBookings(
onClickResource: onClickResource,
state: $parentViewModel.bookingSectionState,
Expand All @@ -63,7 +65,8 @@ struct Resources: View {
viewModel: parentViewModel.resourceViewModel,
getUserEventsForSection: getUserEventsForSection
)
.customNavigationBackButton(previousPage: "Account"))) {
.navigationTitle("Events")
.navigationBarTitleDisplayMode(.inline))) {
RegisteredEvents(
onClickEvent: onClickEvent,
state: $parentViewModel.registeredEventSectionState,
Expand All @@ -81,7 +84,7 @@ struct Resources: View {
.coordinateSpace(name: scrollSpace)
.onPreferenceChange(ResourcesScrollViewOffsetPreferenceKey.self, perform: handleScroll)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.background)
.background(Color(UIColor.systemBackground))
.cornerRadius(20, corners: [.topLeft, .topRight])
.sheet(item: $parentViewModel.examDetailSheetModel, content: { examDetails in
ExamDetailsSheet(
Expand Down
3 changes: 0 additions & 3 deletions tumble-ios/App/Presentation/Views/AppParent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ struct AppParent: View {
@ObservedObject var viewModel: ParentViewModel

private let navigationBarAppearance = UINavigationBar.appearance()
private let tabBarAppearance = UITabBar.appearance()

init(viewModel: ParentViewModel) {
navigationBarAppearance.titleTextAttributes = [.font: navigationBarFont()]
navigationBarAppearance.titleTextAttributes = [.foregroundColor: UIColor(named: "OnSurface")!]
tabBarAppearance.backgroundColor = UIColor(named: "BackgroundColor")
tabBarAppearance.tintColor = UIColor(named: "PrimaryColor")
self.viewModel = viewModel
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct BookmarkPage: View {
}
}
}
.background(Color.background)
.background(Color(UIColor.systemBackground))
.padding(.bottom, -10)
.onAppear {
UIApplication.shared.applicationIconBadgeNumber = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct BookmarkListView: View {
}, label: {
Image(systemName: "arrow.up")
.font(.system(size: 24, weight: .semibold))
.foregroundColor(.background)
.foregroundColor(Color(UIColor.systemBackground))
.padding(15)
.background(Color.primary)
.clipShape(Rectangle())
Expand Down
2 changes: 1 addition & 1 deletion tumble-ios/App/Presentation/Views/General/Info.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ struct Info: View {
maxHeight: .infinity,
alignment: .center
)
.background(Color.background)
.background(Color(UIColor.systemBackground))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ struct InfoLoading: View {
maxHeight: .infinity,
alignment: .center
)
.background(Color.background)
.background(Color(UIColor.systemBackground))
}
}
2 changes: 1 addition & 1 deletion tumble-ios/App/Presentation/Views/Home/HomePage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct HomePage: View {
}
.padding(.horizontal, 16)
.padding(.top, 20)
.background(Color.background)
.background(Color(UIColor.systemBackground))
}

func updateCourseColors() -> Void {
Expand Down
2 changes: 1 addition & 1 deletion tumble-ios/App/Presentation/Views/Root.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct Root: View {

var body: some View {
ZStack {
Color.background
Color(UIColor.systemBackground)
switch viewModel.currentView {
case .onboarding:
OnBoarding(viewModel: viewModel.onBoardingViewModel, updateUserOnBoarded: setUserOnBoarded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct SchedulePreview: View {
maxHeight: .infinity,
alignment: .center
)
.background(Color.background)
.background(Color(UIColor.systemBackground))
}
}

2 changes: 1 addition & 1 deletion tumble-ios/App/Presentation/Views/Search/SearchPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct SearchPage: View {
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
}
.background(Color.background)
.background(Color(UIColor.systemBackground))
.sheet(isPresented: $viewModel.presentPreview) {
SchedulePreview(
parentViewModel: viewModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct SearchResults: View {
}
}
}
.background(Color.background)
.background(Color(UIColor.systemBackground))
}
}
}

0 comments on commit 96f1451

Please sign in to comment.