Skip to content

Commit

Permalink
Replace the home screen schedule view with list view
Browse files Browse the repository at this point in the history
  • Loading branch information
X1nto committed Oct 30, 2024
1 parent 640db4f commit 063c3ac
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions iosApp/iosApp/HomeScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,26 @@ struct _HomeScreen: View {
switch state {
case .loading:
ProgressView()
case .success(selectedDay: _, lectures: let lectures):
TabPager(
selectedIndex: $selectedDay,
items: lectures,
tabContent: { Text($0) }
) { lectures in
List(lectures, id: \.hashValue) { lecture in
NavigationLink(
destination: {
}
) {
VStack(alignment: .leading) {
Text(lecture.name)
Text(lecture.lecturer)
Text(lecture.time)
case let .success(_, lecturesByDay):
List {
ForEach(Array(lecturesByDay.keys), id: \.self) { day in
Section {
ForEach(lecturesByDay[day]!, id: \.hashValue) { lecture in
NavigationLink(
destination: {

}
) {
VStack(alignment: .leading) {
Text(lecture.name)
Text(lecture.lecturer)
Text(lecture.time)
}
}
}
} header: {
Text(day)
.padding(.leading, -12)
}
}
}
Expand All @@ -101,5 +105,6 @@ struct _HomeScreen: View {
}
.navigationTitle("Home")
.toolbarTitleDisplayMode(.inlineLarge)
.headerProminence(.increased)
}
}

0 comments on commit 063c3ac

Please sign in to comment.