-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHomeView.swift
executable file
·47 lines (42 loc) · 1.3 KB
/
HomeView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// HomeView.swift
// SaveLink
//
// Created by Home on 24/11/21.
//
import SwiftUI
struct HomeView: View {
@ObservedObject var authenticationViewModel: AuthenticationViewModel
@StateObject var linkViewModel: LinkViewModel = LinkViewModel()
var body: some View {
NavigationView {
TabView {
VStack {
Text("Bienvenido \(authenticationViewModel.user?.email ?? "No user")")
.padding(.top, 32)
Spacer()
LinkView(linkViewModel: linkViewModel)
}
.tabItem {
Label("Home", systemImage: "house.fill")
}
ProfileView(authenticationViewModel: authenticationViewModel)
.tabItem {
Label("Profile", systemImage: "person.fill")
}
}
.navigationBarTitleDisplayMode(.inline)
.navigationTitle("Home")
.toolbar {
Button("Logout") {
authenticationViewModel.logout()
}
}
}
}
}
struct HomeView_Previews: PreviewProvider {
static var previews: some View {
HomeView(authenticationViewModel: AuthenticationViewModel())
}
}