Proyectos de Subversion Iphone Microlearning - Inconcert

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
//
2
//  TabBarIconView.swift
3
//  twogetskills
4
//
5
//  Created by Efrain Yanez Recanatini on 7/24/22.
6
//
7
 
8
import SwiftUI
9
 
10
struct TabBarIconView: View {
11
 
12
    @StateObject var appNavigation: AppNavigation
13
    let assignedPage: AppMainSubPage
14
 
15
    let width, height: CGFloat
16
    let systemIconName, tabName: String
17
 
18
    var body: some View {
19
        VStack {
20
            Image(systemName: systemIconName)
21
                .resizable()
22
                .aspectRatio(contentMode: .fit)
23
                .frame(width: width, height: height)
24
                .padding(.top, 10)
25
            Text(tabName)
26
             .font(Font.custom(Config.FONT_NAME_REGULAR, size: Config.FONT_SIZE_TAB_BAR_BUTTONS))
27
 
28
            Spacer()
29
        }
30
            .padding(.horizontal, -4)
31
            .onTapGesture {
32
                withAnimation {
33
                    appNavigation.subpageActive = assignedPage
34
                }
35
            }
36
        .foregroundColor(appNavigation.subpageActive == assignedPage ? Color("color_tab_bar_highlight") : Color("color_tab_bar_foreground"))
37
    }
38
}