mirror of
https://github.com/Matte23/circolapp.git
synced 2025-12-05 23:19:10 +00:00
Polish layout for iPadOS
This commit is contained in:
@@ -7,6 +7,9 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
950C1784258E582E00B2DBFE /* PadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950C1783258E582E00B2DBFE /* PadView.swift */; };
|
||||||
|
950C1786258E58AD00B2DBFE /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950C1785258E58AD00B2DBFE /* SidebarView.swift */; };
|
||||||
|
950C1788258E5BD300B2DBFE /* PhoneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950C1787258E5BD300B2DBFE /* PhoneView.swift */; };
|
||||||
9512D3C1257AB4F60023C3A1 /* NewReminderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9512D3C0257AB4F60023C3A1 /* NewReminderView.swift */; };
|
9512D3C1257AB4F60023C3A1 /* NewReminderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9512D3C0257AB4F60023C3A1 /* NewReminderView.swift */; };
|
||||||
952DEDDF2576F8DC001DF85D /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952DEDDE2576F8DC001DF85D /* SceneDelegate.swift */; };
|
952DEDDF2576F8DC001DF85D /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952DEDDE2576F8DC001DF85D /* SceneDelegate.swift */; };
|
||||||
953DDE7E2580312500C457CE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 953DDE7D2580312500C457CE /* LaunchScreen.storyboard */; };
|
953DDE7E2580312500C457CE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 953DDE7D2580312500C457CE /* LaunchScreen.storyboard */; };
|
||||||
@@ -52,6 +55,9 @@
|
|||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
892B265487980F6A344AC2A7 /* Pods-circolapp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-circolapp.debug.xcconfig"; path = "Target Support Files/Pods-circolapp/Pods-circolapp.debug.xcconfig"; sourceTree = "<group>"; };
|
892B265487980F6A344AC2A7 /* Pods-circolapp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-circolapp.debug.xcconfig"; path = "Target Support Files/Pods-circolapp/Pods-circolapp.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
8BEA78E7C5BBEF0119834B33 /* Pods_circolapp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_circolapp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
8BEA78E7C5BBEF0119834B33 /* Pods_circolapp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_circolapp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
950C1783258E582E00B2DBFE /* PadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PadView.swift; sourceTree = "<group>"; };
|
||||||
|
950C1785258E58AD00B2DBFE /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = "<group>"; };
|
||||||
|
950C1787258E5BD300B2DBFE /* PhoneView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoneView.swift; sourceTree = "<group>"; };
|
||||||
9512D3C0257AB4F60023C3A1 /* NewReminderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewReminderView.swift; sourceTree = "<group>"; };
|
9512D3C0257AB4F60023C3A1 /* NewReminderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewReminderView.swift; sourceTree = "<group>"; };
|
||||||
952C5954255C57650018C010 /* shared.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = shared.framework; path = "../../shared/build/xcode-frameworks/shared.framework"; sourceTree = "<group>"; };
|
952C5954255C57650018C010 /* shared.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = shared.framework; path = "../../shared/build/xcode-frameworks/shared.framework"; sourceTree = "<group>"; };
|
||||||
952DEDDE2576F8DC001DF85D /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
952DEDDE2576F8DC001DF85D /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||||
@@ -138,6 +144,9 @@
|
|||||||
954AF8F92588A5DD00666D0C /* RemindersList.swift */,
|
954AF8F92588A5DD00666D0C /* RemindersList.swift */,
|
||||||
95B4CE132588BC890090D5E8 /* SettingsView.swift */,
|
95B4CE132588BC890090D5E8 /* SettingsView.swift */,
|
||||||
95DB71AA258A1C1500A78033 /* CarteView.swift */,
|
95DB71AA258A1C1500A78033 /* CarteView.swift */,
|
||||||
|
950C1783258E582E00B2DBFE /* PadView.swift */,
|
||||||
|
950C1785258E58AD00B2DBFE /* SidebarView.swift */,
|
||||||
|
950C1787258E5BD300B2DBFE /* PhoneView.swift */,
|
||||||
);
|
);
|
||||||
path = View;
|
path = View;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -359,8 +368,10 @@
|
|||||||
954AF8FA2588A5DD00666D0C /* RemindersList.swift in Sources */,
|
954AF8FA2588A5DD00666D0C /* RemindersList.swift in Sources */,
|
||||||
95CA31B2255C1EDE00AC095B /* ContentView.swift in Sources */,
|
95CA31B2255C1EDE00AC095B /* ContentView.swift in Sources */,
|
||||||
955B7A10257D10A70091B1F9 /* ViewControllerResolver.swift in Sources */,
|
955B7A10257D10A70091B1F9 /* ViewControllerResolver.swift in Sources */,
|
||||||
|
950C1786258E58AD00B2DBFE /* SidebarView.swift in Sources */,
|
||||||
954E68352574E3890034EBA8 /* iOSServerApi.swift in Sources */,
|
954E68352574E3890034EBA8 /* iOSServerApi.swift in Sources */,
|
||||||
95DB71AB258A1C1500A78033 /* CarteView.swift in Sources */,
|
95DB71AB258A1C1500A78033 /* CarteView.swift in Sources */,
|
||||||
|
950C1784258E582E00B2DBFE /* PadView.swift in Sources */,
|
||||||
954AF8F82588A5CF00666D0C /* FavouritesList.swift in Sources */,
|
954AF8F82588A5CF00666D0C /* FavouritesList.swift in Sources */,
|
||||||
954AF8F62588A5C300666D0C /* CircularList.swift in Sources */,
|
954AF8F62588A5C300666D0C /* CircularList.swift in Sources */,
|
||||||
954AF8FD2588A61000666D0C /* FavouritesViewModel.swift in Sources */,
|
954AF8FD2588A61000666D0C /* FavouritesViewModel.swift in Sources */,
|
||||||
@@ -370,6 +381,7 @@
|
|||||||
954E683D2574ED9E0034EBA8 /* UserDefaultsExtensions.swift in Sources */,
|
954E683D2574ED9E0034EBA8 /* UserDefaultsExtensions.swift in Sources */,
|
||||||
955B7A0E257D098C0091B1F9 /* SearchBar.swift in Sources */,
|
955B7A0E257D098C0091B1F9 /* SearchBar.swift in Sources */,
|
||||||
9554BDB8257E498F00D8925B /* OnboardingView.swift in Sources */,
|
9554BDB8257E498F00D8925B /* OnboardingView.swift in Sources */,
|
||||||
|
950C1788258E5BD300B2DBFE /* PhoneView.swift in Sources */,
|
||||||
95C46A51255D3A34007A75E5 /* CircularViewModel.swift in Sources */,
|
95C46A51255D3A34007A75E5 /* CircularViewModel.swift in Sources */,
|
||||||
95B4CE142588BC890090D5E8 /* SettingsView.swift in Sources */,
|
95B4CE142588BC890090D5E8 /* SettingsView.swift in Sources */,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,22 +23,20 @@ struct CircularList: View {
|
|||||||
@ObservedObject var searchBar: SearchBar = SearchBar(placeholder: "Search circulars")
|
@ObservedObject var searchBar: SearchBar = SearchBar(placeholder: "Search circulars")
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
List(circularViewModel.circulars, id: \.id) { circular in
|
||||||
List(circularViewModel.circulars, id: \.id) { circular in
|
CircularView(circular: circular)
|
||||||
CircularView(circular: circular)
|
|
||||||
}
|
|
||||||
.navigationBarTitle(Text("Circulars"), displayMode: .large)
|
|
||||||
.addSearchBar(self.searchBar)
|
|
||||||
.onReceive(searchBar.$text) {query in
|
|
||||||
self.circularViewModel.search(query: query)
|
|
||||||
}
|
|
||||||
.onAppear {
|
|
||||||
self.circularViewModel.startObservingCirculars()
|
|
||||||
}
|
|
||||||
.onDisappear(perform: {
|
|
||||||
self.circularViewModel.stopObserving()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
.navigationBarTitle(Text("Circulars"), displayMode: .large)
|
||||||
|
.addSearchBar(self.searchBar)
|
||||||
|
.onReceive(searchBar.$text) {query in
|
||||||
|
self.circularViewModel.search(query: query)
|
||||||
|
}
|
||||||
|
.onAppear {
|
||||||
|
self.circularViewModel.startObservingCirculars()
|
||||||
|
}
|
||||||
|
.onDisappear(perform: {
|
||||||
|
self.circularViewModel.stopObserving()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,38 +20,12 @@ import SwiftUI
|
|||||||
import UIKit
|
import UIKit
|
||||||
import Shared
|
import Shared
|
||||||
|
|
||||||
struct ContentView: View {
|
struct ContentView: View {
|
||||||
@State var showOnboarding = !UserDefaults.standard.bool(forKey: "skipOnboarding")
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
TabView {
|
if UIDevice.current.userInterfaceIdiom == .phone {
|
||||||
CircularList()
|
PhoneView()
|
||||||
.tabItem {
|
} else {
|
||||||
Image(systemName: "folder.fill")
|
PadView()
|
||||||
Text("Circulars")
|
|
||||||
}
|
|
||||||
|
|
||||||
FavouritesList()
|
|
||||||
.tabItem {
|
|
||||||
Image(systemName: "book.fill")
|
|
||||||
Text("Favourites")
|
|
||||||
}
|
|
||||||
|
|
||||||
RemindersList()
|
|
||||||
.tabItem {
|
|
||||||
Image(systemName: "alarm.fill")
|
|
||||||
Text("Reminders")
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsView()
|
|
||||||
.tabItem {
|
|
||||||
Image(systemName: "gear")
|
|
||||||
Text("Settings")
|
|
||||||
}
|
|
||||||
}.sheet(isPresented: self.$showOnboarding, onDismiss: {
|
|
||||||
UserDefaults.standard.set(true, forKey: "skipOnboarding")
|
|
||||||
}) {
|
|
||||||
OnboardingView()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,22 +23,20 @@ struct FavouritesList: View {
|
|||||||
@ObservedObject var searchBar: SearchBar = SearchBar(placeholder: "Search circulars")
|
@ObservedObject var searchBar: SearchBar = SearchBar(placeholder: "Search circulars")
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
List(favouritesViewModel.circulars, id: \.id) { circular in
|
||||||
List(favouritesViewModel.circulars, id: \.id) { circular in
|
CircularView(circular: circular)
|
||||||
CircularView(circular: circular)
|
|
||||||
}
|
|
||||||
.navigationBarTitle(Text("Favourites"), displayMode: .large)
|
|
||||||
.addSearchBar(self.searchBar)
|
|
||||||
.onReceive(searchBar.$text) {query in
|
|
||||||
self.favouritesViewModel.search(query: query)
|
|
||||||
}
|
|
||||||
.onAppear {
|
|
||||||
self.favouritesViewModel.startObservingFavourites()
|
|
||||||
}
|
|
||||||
.onDisappear(perform: {
|
|
||||||
self.favouritesViewModel.stopObserving()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
.navigationBarTitle(Text("Favourites"), displayMode: .large)
|
||||||
|
.addSearchBar(self.searchBar)
|
||||||
|
.onReceive(searchBar.$text) {query in
|
||||||
|
self.favouritesViewModel.search(query: query)
|
||||||
|
}
|
||||||
|
.onAppear {
|
||||||
|
self.favouritesViewModel.startObservingFavourites()
|
||||||
|
}
|
||||||
|
.onDisappear(perform: {
|
||||||
|
self.favouritesViewModel.stopObserving()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
41
ios/circolapp/circolapp/View/PadView.swift
Normal file
41
ios/circolapp/circolapp/View/PadView.swift
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Circolapp
|
||||||
|
* Copyright (C) 2019-2020 Matteo Schiff
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct PadView: View {
|
||||||
|
@State var screen: Screen? = .all
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
NavigationView {
|
||||||
|
SidebarView(state: $screen)
|
||||||
|
}
|
||||||
|
.navigationViewStyle(DoubleColumnNavigationViewStyle())
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct PadView_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
PadView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Screen: Hashable {
|
||||||
|
case all, favourites, reminders, settings
|
||||||
|
}
|
||||||
69
ios/circolapp/circolapp/View/PhoneView.swift
Normal file
69
ios/circolapp/circolapp/View/PhoneView.swift
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Circolapp
|
||||||
|
* Copyright (C) 2019-2020 Matteo Schiff
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct PhoneView: View {
|
||||||
|
@State var showOnboarding = !UserDefaults.standard.bool(forKey: "skipOnboarding")
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
TabView {
|
||||||
|
NavigationView {
|
||||||
|
CircularList()
|
||||||
|
}
|
||||||
|
.tabItem {
|
||||||
|
Image(systemName: "folder.fill")
|
||||||
|
Text("Circulars")
|
||||||
|
}
|
||||||
|
|
||||||
|
NavigationView {
|
||||||
|
FavouritesList()
|
||||||
|
}
|
||||||
|
.tabItem {
|
||||||
|
Image(systemName: "book.fill")
|
||||||
|
Text("Favourites")
|
||||||
|
}
|
||||||
|
|
||||||
|
NavigationView {
|
||||||
|
RemindersList()
|
||||||
|
}
|
||||||
|
.tabItem {
|
||||||
|
Image(systemName: "alarm.fill")
|
||||||
|
Text("Reminders")
|
||||||
|
}
|
||||||
|
|
||||||
|
NavigationView {
|
||||||
|
SettingsView()
|
||||||
|
}
|
||||||
|
.tabItem {
|
||||||
|
Image(systemName: "gearshape.fill")
|
||||||
|
Text("Settings")
|
||||||
|
}
|
||||||
|
}.sheet(isPresented: self.$showOnboarding, onDismiss: {
|
||||||
|
UserDefaults.standard.set(true, forKey: "skipOnboarding")
|
||||||
|
}) {
|
||||||
|
OnboardingView()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct PhoneView_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
PhoneView()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,22 +23,20 @@ struct RemindersList: View {
|
|||||||
@ObservedObject var searchBar: SearchBar = SearchBar(placeholder: "Search circulars")
|
@ObservedObject var searchBar: SearchBar = SearchBar(placeholder: "Search circulars")
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
List(remindersViewModel.circulars, id: \.id) { circular in
|
||||||
List(remindersViewModel.circulars, id: \.id) { circular in
|
CircularView(circular: circular)
|
||||||
CircularView(circular: circular)
|
|
||||||
}
|
|
||||||
.navigationBarTitle(Text("Reminders"), displayMode: .large)
|
|
||||||
.addSearchBar(self.searchBar)
|
|
||||||
.onReceive(searchBar.$text) {query in
|
|
||||||
self.remindersViewModel.search(query: query)
|
|
||||||
}
|
|
||||||
.onAppear {
|
|
||||||
self.remindersViewModel.startObservingReminders()
|
|
||||||
}
|
|
||||||
.onDisappear(perform: {
|
|
||||||
self.remindersViewModel.stopObserving()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
.navigationBarTitle(Text("Reminders"), displayMode: .large)
|
||||||
|
.addSearchBar(self.searchBar)
|
||||||
|
.onReceive(searchBar.$text) {query in
|
||||||
|
self.remindersViewModel.search(query: query)
|
||||||
|
}
|
||||||
|
.onAppear {
|
||||||
|
self.remindersViewModel.startObservingReminders()
|
||||||
|
}
|
||||||
|
.onDisappear(perform: {
|
||||||
|
self.remindersViewModel.stopObserving()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,42 +26,40 @@ struct SettingsView: View {
|
|||||||
private let serverCompanion = ServerAPI.Companion()
|
private let serverCompanion = ServerAPI.Companion()
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
Form {
|
||||||
Form {
|
Section(header: Text("GENERAL")) {
|
||||||
Section(header: Text("GENERAL")) {
|
Picker("School", selection: $school) {
|
||||||
Picker("School", selection: $school) {
|
ForEach(0..<Int(serverCompanion.numberOfServers)) { serverID in
|
||||||
ForEach(0..<Int(serverCompanion.numberOfServers)) { serverID in
|
let server = serverCompanion.getServer(serverID: Int32(serverID))
|
||||||
let server = serverCompanion.getServer(serverID: Int32(serverID))
|
Text(serverCompanion.getServerName(server: server))
|
||||||
Text(serverCompanion.getServerName(server: server))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Section(header: Text("ABOUT")) {
|
|
||||||
HStack {
|
|
||||||
Text("Version name")
|
|
||||||
Spacer()
|
|
||||||
Text(
|
|
||||||
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Error"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
HStack {
|
|
||||||
Text("Version code")
|
|
||||||
Spacer()
|
|
||||||
Text(
|
|
||||||
Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Error"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
NavigationLink(destination:
|
|
||||||
CarteView()
|
|
||||||
.navigationBarTitle("Open source licenses", displayMode: .inline)
|
|
||||||
) {
|
|
||||||
Text("Open source licenses")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationBarTitle("Settings", displayMode: .inline)
|
|
||||||
|
Section(header: Text("ABOUT")) {
|
||||||
|
HStack {
|
||||||
|
Text("Version name")
|
||||||
|
Spacer()
|
||||||
|
Text(
|
||||||
|
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Error"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
HStack {
|
||||||
|
Text("Version code")
|
||||||
|
Spacer()
|
||||||
|
Text(
|
||||||
|
Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Error"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
NavigationLink(destination:
|
||||||
|
CarteView()
|
||||||
|
.navigationBarTitle("Open source licenses", displayMode: .inline)
|
||||||
|
) {
|
||||||
|
Text("Open source licenses")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.navigationBarTitle("Settings", displayMode: .inline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
62
ios/circolapp/circolapp/View/SidebarView.swift
Normal file
62
ios/circolapp/circolapp/View/SidebarView.swift
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Circolapp
|
||||||
|
* Copyright (C) 2019-2020 Matteo Schiff
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct SidebarView: View {
|
||||||
|
@Binding var state: Screen?
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
if #available(iOS 14.0, *) {
|
||||||
|
List {
|
||||||
|
NavigationLink(
|
||||||
|
destination: CircularList(),
|
||||||
|
tag: Screen.all,
|
||||||
|
selection: $state,
|
||||||
|
label: {
|
||||||
|
Label("All circulars", systemImage: "folder" )
|
||||||
|
})
|
||||||
|
NavigationLink(
|
||||||
|
destination: FavouritesList(),
|
||||||
|
tag: Screen.favourites,
|
||||||
|
selection: $state,
|
||||||
|
label: {
|
||||||
|
Label("Favourites", systemImage: "book")
|
||||||
|
})
|
||||||
|
NavigationLink(
|
||||||
|
destination: RemindersList(),
|
||||||
|
tag: Screen.reminders,
|
||||||
|
selection: $state,
|
||||||
|
label: {
|
||||||
|
Label("Reminders", systemImage: "alarm")
|
||||||
|
})
|
||||||
|
NavigationLink(
|
||||||
|
destination: SettingsView(),
|
||||||
|
tag: Screen.settings,
|
||||||
|
selection: $state,
|
||||||
|
label: {
|
||||||
|
Label("Settings", systemImage: "gearshape")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
.listStyle(SidebarListStyle())
|
||||||
|
.navigationTitle("CircolApp")
|
||||||
|
} else {
|
||||||
|
// Fallback on earlier versions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user