Toolbar experimentation
This commit is contained in:
@@ -12,6 +12,8 @@ struct ContentView: View {
|
||||
@ObservedObject private var bluetoothViewModel = BluetoothViewModel()
|
||||
@StateObject private var store = FeedStore(feed: Feed.sampleFeed)
|
||||
private var feedStores = [FeedStore(feed: Feed.sampleFeed), FeedStore(feed: Feed.sampleFeed2)]
|
||||
//@Binding var currentView: CurrentView
|
||||
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
@@ -40,25 +42,16 @@ struct ContentView: View {
|
||||
}
|
||||
.navigationTitle("Peripherals")
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .bottomBar) {
|
||||
Button("Peers") {}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
public static var cv = CurrentView.feeds
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
|
||||
enum CurrentView {
|
||||
case peers
|
||||
case feeds
|
||||
case friends
|
||||
case settings
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,24 @@ import SwiftUI
|
||||
|
||||
@main
|
||||
struct RippleChatApp: App {
|
||||
@State private var currentView: CurrentView = CurrentView.feeds
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .bottomBar) {
|
||||
Button("Peers") {}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum CurrentView {
|
||||
case peers
|
||||
case feeds
|
||||
case friends
|
||||
case settings
|
||||
}
|
||||
|
||||
22
RippleChat/Views/FeedListView.swift
Normal file
22
RippleChat/Views/FeedListView.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// FeedListView.swift
|
||||
// RippleChat
|
||||
//
|
||||
// Created by Sebastian Lenzlinger on 10.07.23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct FeedListView: View {
|
||||
|
||||
|
||||
var body: some View {
|
||||
Text("FeedListView")
|
||||
}
|
||||
}
|
||||
|
||||
struct FeedListView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
FeedListView()
|
||||
}
|
||||
}
|
||||
20
RippleChat/Views/FriendsListView.swift
Normal file
20
RippleChat/Views/FriendsListView.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// FriendsListView.swift
|
||||
// RippleChat
|
||||
//
|
||||
// Created by Sebastian Lenzlinger on 10.07.23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct FriendsListView: View {
|
||||
var body: some View {
|
||||
Text("Friend List View")
|
||||
}
|
||||
}
|
||||
|
||||
struct FriendsListView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
FriendsListView()
|
||||
}
|
||||
}
|
||||
20
RippleChat/Views/PeeringView.swift
Normal file
20
RippleChat/Views/PeeringView.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// PeeringView.swift
|
||||
// RippleChat
|
||||
//
|
||||
// Created by Sebastian Lenzlinger on 10.07.23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PeeringView: View {
|
||||
var body: some View {
|
||||
Text("Peering View")
|
||||
}
|
||||
}
|
||||
|
||||
struct PeeringView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
PeeringView()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user