41 lines
1.2 KiB
Swift
41 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@EnvironmentObject var authManager: AuthManager
|
|
@State private var selectedTab = 0
|
|
|
|
var body: some View {
|
|
if authManager.isAuthenticated {
|
|
TabView(selection: $selectedTab) {
|
|
GachaView()
|
|
.tabItem {
|
|
Label("ガチャ", systemImage: "sparkles")
|
|
}
|
|
.tag(0)
|
|
|
|
CollectionView()
|
|
.tabItem {
|
|
Label("コレクション", systemImage: "square.grid.3x3")
|
|
}
|
|
.tag(1)
|
|
|
|
ProfileView()
|
|
.tabItem {
|
|
Label("プロフィール", systemImage: "person.circle")
|
|
}
|
|
.tag(2)
|
|
}
|
|
.accentColor(Color(hex: "fff700"))
|
|
} else {
|
|
LoginView()
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView()
|
|
.environmentObject(AuthManager())
|
|
.environmentObject(CardManager())
|
|
}
|
|
} |