-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoursesListView.swift
44 lines (38 loc) · 1.09 KB
/
CoursesListView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// CoursesListView.swift
// GVCourses
//
// Created by Minh Tran on 01/10/2023.
//
import SwiftUI
struct CoursesListView: View {
@EnvironmentObject var store: CourseStore
var body: some View {
NavigationStack {
GVCoursesSearchBar(text: $store.searchTerm)
.padding(.top, 20)
List {
ForEach(store.filteredCourses) {c in
ZStack(alignment:.leading) {
NavigationLink(destination: CourseDetailsView(course: c)) {
EmptyView()
}
.opacity(0)
CourseRowView(name: c.name!, credits: c.credits!, title: c.title!)
}
}
}
.toolbar(.hidden, for: .tabBar)
.gvcoursesNavigationBar(
title: "All courses"
)
.listStyle(InsetListStyle())
.padding(.bottom, 80)
}.refreshable {
store.refreshView()
}
}
}
#Preview {
CoursesListView()
}