forked from AcaMate/AcaMate_iOS
57 lines
1.4 KiB
Swift
57 lines
1.4 KiB
Swift
//
|
|
// MainView.swift
|
|
// AcaMate
|
|
//
|
|
// Created by TAnine on 2/4/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
import Combine
|
|
|
|
struct MainView: View {
|
|
@EnvironmentObject var alertController: AlertController
|
|
@State var cancellables: Set<AnyCancellable> = []
|
|
@Binding var naviState : NaviState
|
|
|
|
@State var menuName: MenuName
|
|
|
|
// @State private var scrollOffset: CGPoint = .zero
|
|
// @State private var topViewState: Bool = false
|
|
|
|
var body: some View {
|
|
|
|
VStack(spacing: 0) {
|
|
Group {
|
|
switch menuName {
|
|
case .Home:
|
|
HomeView()
|
|
case .Management:
|
|
ManagementView()
|
|
case .Chatting:
|
|
ChattingView()
|
|
case .Calendar:
|
|
CalendarView()
|
|
case .Etc:
|
|
EtcView()
|
|
}
|
|
}
|
|
Spacer(minLength: 1)
|
|
|
|
BottomView(menuName: $menuName)
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
//
|
|
// .onChange(of: scrollOffset.y) { oldValue, newValue in
|
|
// if newValue > 200 && topViewState == false {
|
|
// topViewState = true
|
|
// } else if newValue < 20 && topViewState == true{
|
|
// topViewState = false
|
|
// }
|
|
// }
|
|
|
|
}
|
|
}
|
|
|
|
|