| 1 |
efrain |
1 |
//
|
|
|
2 |
// MyCapsulesHeaderView.swift
|
|
|
3 |
// twogetskills
|
|
|
4 |
//
|
|
|
5 |
// Created by Efrain Yanez Recanatini on 7/27/22.
|
|
|
6 |
//
|
|
|
7 |
|
|
|
8 |
import SwiftUI
|
|
|
9 |
|
|
|
10 |
struct MyCapsulesHeaderView : View {
|
|
|
11 |
@Binding var showInProgress : Bool
|
|
|
12 |
let firstName : String
|
|
|
13 |
|
|
|
14 |
var body : some View {
|
|
|
15 |
//Inicio de Saluo
|
|
|
16 |
HStack {
|
|
|
17 |
Text(Config.LANG_MY_CAPSULES_GREATING)
|
|
|
18 |
.font(Font.custom(Config.FONT_NAME_BOLD, size: Config.FONT_SIZE_MY_CAPSULES_HEAD_1))
|
|
|
19 |
.foregroundColor(Color("color_textview_foreground"))
|
|
|
20 |
|
|
|
21 |
Text(firstName)
|
|
|
22 |
.font(Font.custom(Config.FONT_NAME_BOLD, size: Config.FONT_SIZE_MY_CAPSULES_HEAD_1))
|
|
|
23 |
.foregroundColor(Color("color_textview_foreground"))
|
|
|
24 |
|
|
|
25 |
Spacer()
|
|
|
26 |
|
|
|
27 |
Button(action :{
|
|
|
28 |
withAnimation {
|
|
|
29 |
self.showInProgress.toggle()
|
|
|
30 |
}
|
|
|
31 |
}, label: {
|
|
|
32 |
Image(systemName: self.showInProgress ? "chevron.down" : "chevron.up")
|
|
|
33 |
.resizable()
|
|
|
34 |
.aspectRatio(contentMode: .fit)
|
|
|
35 |
.frame(width: 16, height: 16, alignment: .center)
|
|
|
36 |
|
|
|
37 |
})
|
|
|
38 |
.foregroundColor(Color("color_textview_foreground"))
|
|
|
39 |
.padding(.trailing, 16)
|
|
|
40 |
}
|
|
|
41 |
.padding(.leading, 16)
|
|
|
42 |
.padding(.top, 10)
|
|
|
43 |
|
|
|
44 |
//Fin Saludo
|
|
|
45 |
}
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
struct MyCapsulesHeaderView_Previews: PreviewProvider {
|
|
|
49 |
@State static var showInProgress : Bool = true
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
static var previews: some View {
|
|
|
53 |
MyCapsulesHeaderView(showInProgress: self.$showInProgress, firstName: "Usuario de prueba")
|
|
|
54 |
}
|
|
|
55 |
}
|