Autoría | Ultima modificación | Ver Log |
//
// TabBarIconView.swift
// twogetskills
//
// Created by Efrain Yanez Recanatini on 7/24/22.
//
import SwiftUI
struct TabBarIconView: View {
@StateObject var appNavigation: AppNavigation
let assignedPage: AppMainSubPage
let width, height: CGFloat
let systemIconName, tabName: String
var body: some View {
VStack {
Image(systemName: systemIconName)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: width, height: height)
.padding(.top, 10)
Text(tabName)
.font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_TAB_BAR_BUTTONS))
Spacer()
}
.padding(.horizontal, -4)
.onTapGesture {
withAnimation {
appNavigation.subpageActive = assignedPage
}
}
.foregroundColor(appNavigation.subpageActive == assignedPage ? Color("color_tab_bar_highlight") : Color("color_tab_bar_foreground"))
}
}