mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +00:00
34 lines
1002 B
Swift
34 lines
1002 B
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@StateObject var state = AppState()
|
|
|
|
@State var tabSelection: TabSelection = .popular
|
|
|
|
var body: some View {
|
|
NavigationView {
|
|
TabView(selection: $tabSelection) {
|
|
PopularVideosView(state: state, tabSelection: $tabSelection)
|
|
.tabItem { Text("Popular") }
|
|
.tag(TabSelection.popular)
|
|
|
|
if state.showingChannel {
|
|
ChannelView(state: state, tabSelection: $tabSelection)
|
|
.tabItem { Text("\(state.channel!) Channel") }
|
|
.tag(TabSelection.channel)
|
|
}
|
|
|
|
SearchView(state: state, tabSelection: $tabSelection)
|
|
.tabItem { Image(systemName: "magnifyingglass") }
|
|
.tag(TabSelection.search)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView()
|
|
}
|
|
}
|