mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Channel view
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@StateObject var state = AppState()
|
||||
|
||||
@State var tabSelection: TabSelection = .popular
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
TabView {
|
||||
PopularVideosView()
|
||||
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()
|
||||
.tabItem { Image(systemName: "magnifyingglass") }
|
||||
.tag(TabSelection.search)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
5
Shared/TabSelection.swift
Normal file
5
Shared/TabSelection.swift
Normal file
@@ -0,0 +1,5 @@
|
||||
import Foundation
|
||||
|
||||
enum TabSelection {
|
||||
case popular, channel, search
|
||||
}
|
Reference in New Issue
Block a user