-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWelcomePage.swift
53 lines (46 loc) · 1.92 KB
/
WelcomePage.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
48
49
50
51
52
import SwiftUI
struct ContentView: View {
@ObservedObject var refreshManager: RefreshManager
@State private var queuePosition = CoreDataManager.shared.getQueueCount()
@State private var peopleJoining = CoreDataManager.shared.getPeopleJoining() ?? 0
var body: some View {
NavigationView {
VStack {
Spacer()
Text("👋 Welcome!") // Waving hand emoji with Welcome text
Text("You are in position \(queuePosition) of the line.")
Spacer()
NavigationLink(destination: HomePage(refreshManager: refreshManager)) {
HStack {
Spacer()
Text("Join a Queue")
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.blue)
.cornerRadius(10)
.padding(.horizontal)
}
}
NavigationLink(destination: StartQueuePage()) {
HStack {
Spacer()
Text("Start a Queue")
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.blue)
.cornerRadius(10)
.padding(.horizontal)
}
}
Spacer()
}
.onReceive(refreshManager.$shouldRefresh) { _ in
// Update queuePosition1 when returning from InQueuePage
queuePosition = CoreDataManager.shared.getQueueCount()
}
}
.navigationBarHidden(true)
}
}