AutorÃa | Ultima modificación | Ver Log |
//
// HomeView.swift
// twogetskills
//
// Created by Efrain Yanez Recanatini on 6/17/22.
//
import SwiftUI
struct HomeView: View {
@EnvironmentObject var appNavigation : AppNavigation
@EnvironmentObject var networkMonitor : NetworkMonitor
@State var showPopUp = false
var body: some View {
GeometryReader { geometry in
VStack(spacing: 0) {
HomeViewSubPage()
.environmentObject(appNavigation)
.environmentObject(networkMonitor)
Spacer()
Spacer()
ZStack {
if showPopUp {
PlusMenuView(showPopUp: self.$showPopUp, widthAndHeight: geometry.size.width/7)
.offset(y: -geometry.size.height/6 )
}
HStack {
TabBarIconView(appNavigation: appNavigation, assignedPage: .mycapsules, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "house", tabName: Config.LANG_TAB_BAR_BUTTON_MY_CAPSULES )
TabBarIconView(appNavigation: appNavigation, assignedPage: .topics, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "books.vertical", tabName: Config.LANG_TAB_BAR_BUTTON_TOPICS)
//
//ZStack {
Button(action: {
withAnimation {
showPopUp.toggle()
}
}, label: {
ZStack {
Circle()
.foregroundColor(.white)
.frame(width: geometry.size.width/9, height: geometry.size.width/9)
.shadow(radius: 4)
Image(systemName: showPopUp ? "minus.circle.fill" : "plus.circle.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: (geometry.size.width/9)-6 , height: (geometry.size.width/9)-6)
.foregroundColor(Color("color_tab_bar_button_plus_background" ))
.rotationEffect(Angle(degrees: showPopUp ? 0 : 90))
}
})
/* }
.offset(y: -geometry.size.height/8/2)
.onTapGesture {
withAnimation {
showPopUp.toggle()
}
}*/
TabBarIconView(appNavigation: appNavigation, assignedPage: .timeline, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "clock.arrow.circlepath", tabName: Config.LANG_TAB_BAR_BUTTON_TIME_LINE)
TabBarIconView(appNavigation: appNavigation, assignedPage: .companies, width: geometry.size.width/5, height: geometry.size.height/28, systemIconName: "chart.bar", tabName: Config.LANG_TAB_BAR_BUTTON_PROGRESS)
}
//.frame(width: geometry.size.width, height: geometry.size.height/8)
.frame(width: geometry.size.width, height: 60)
.background(Color("color_tab_bar_background").shadow(radius: 2))
}
}
}
}
}
struct HomeView_Previews: PreviewProvider {
static var previews: some View {
HomeView()
}
}