Commit
This commit is contained in:
parent
955c7d9066
commit
f59d00016b
@ -10,48 +10,55 @@ import SwiftUI
|
|||||||
struct ScheduleView: View {
|
struct ScheduleView: View {
|
||||||
@ObservedObject var vm: ViewModel
|
@ObservedObject var vm: ViewModel
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ZStack (alignment: .top) {
|
||||||
VStack (spacing: 20) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
ForEach(vm.classes.indices, id: \.self) { index in
|
VStack (spacing: 20) {
|
||||||
if index != 0 && index != 1 && index == vm.selectedIndex {
|
ForEach(vm.classes.indices, id: \.self) { index in
|
||||||
let daySchedule = vm.classes[index] // Это массив строк для дня
|
if index != 0 && index != 1 && index == vm.selectedIndex {
|
||||||
ForEach(daySchedule.indices.dropFirst(), id: \.self) { lessonIndex in
|
let daySchedule = vm.classes[index] // Это массив строк для дня
|
||||||
let lesson = daySchedule[lessonIndex] // Это строка с расписанием одной пары
|
ForEach(daySchedule.indices.dropFirst(), id: \.self) { lessonIndex in
|
||||||
if !lesson.isEmpty {
|
let lesson = daySchedule[lessonIndex] // Это строка с расписанием одной пары
|
||||||
HStack(spacing: 10) {
|
if !lesson.isEmpty {
|
||||||
VStack {
|
HStack(spacing: 10) {
|
||||||
Text(convertTimeString(vm.classes[1][lessonIndex])[0])
|
VStack {
|
||||||
.font(.system(size: 15, weight: .regular))
|
Text(convertTimeString(vm.classes[1][lessonIndex])[0])
|
||||||
Text(convertTimeString(vm.classes[1][lessonIndex])[1])
|
.font(.system(size: 15, weight: .regular))
|
||||||
.font(.system(size: 15, weight: .regular))
|
Text(convertTimeString(vm.classes[1][lessonIndex])[1])
|
||||||
|
.font(.system(size: 15, weight: .regular))
|
||||||
|
}
|
||||||
|
.padding(.top, 7)
|
||||||
|
.padding(.bottom, 7)
|
||||||
|
.padding(.leading, 10)
|
||||||
|
Rectangle()
|
||||||
|
.frame(width: 2)
|
||||||
|
.frame(maxHeight: UIScreen.main.bounds.height - 18)
|
||||||
|
.padding(.top, 7)
|
||||||
|
.padding(.bottom, 7)
|
||||||
|
.foregroundColor(onlineOrOffline(lesson) ? Color("greenForOffline") : Color("blueForOnline"))
|
||||||
|
Text(lesson)
|
||||||
|
.font(.system(size: 18, weight: .regular))
|
||||||
|
.padding(.top, 7)
|
||||||
|
.padding(.bottom, 7)
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding(.top, 7)
|
.frame(maxWidth: UIScreen.main.bounds.width - 40, maxHeight: 230)
|
||||||
.padding(.bottom, 7)
|
.background(Color.white)
|
||||||
.padding(.leading, 10)
|
.cornerRadius(20)
|
||||||
Rectangle()
|
.shadow(color: .black.opacity(0.25), radius: 4, x: 2, y: 2)
|
||||||
.frame(width: 2)
|
|
||||||
.frame(maxHeight: UIScreen.main.bounds.height - 18)
|
|
||||||
.padding(.top, 7)
|
|
||||||
.padding(.bottom, 7)
|
|
||||||
.foregroundColor(onlineOrOffline(lesson) ? Color("greenForOffline") : Color("blueForOnline"))
|
|
||||||
Text(lesson)
|
|
||||||
.font(.system(size: 18, weight: .regular))
|
|
||||||
.padding(.top, 7)
|
|
||||||
.padding(.bottom, 7)
|
|
||||||
Spacer()
|
|
||||||
}
|
}
|
||||||
.frame(maxWidth: UIScreen.main.bounds.width - 40, maxHeight: 230)
|
|
||||||
.background(Color.white)
|
|
||||||
.cornerRadius(20)
|
|
||||||
.shadow(color: .black.opacity(0.25), radius: 4, x: 4, y: 4)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.frame(width: UIScreen.main.bounds.width)
|
||||||
|
.padding(.bottom, 100)
|
||||||
|
.padding(.top, 30)
|
||||||
|
}
|
||||||
|
VStack {
|
||||||
|
Rectangle()
|
||||||
|
.frame(width: UIScreen.main.bounds.width, height: 25)
|
||||||
|
.foregroundColor(Color("background").opacity(0.9))
|
||||||
}
|
}
|
||||||
.frame(width: UIScreen.main.bounds.width)
|
|
||||||
.padding(.bottom, 100)
|
|
||||||
.padding(.top, 10)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user