Mercurial > public > simoleon
view Simoleon/Helpers/Sidebar.swift @ 66:e7210cff632e
Fix default currency bug
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Tue, 27 Jul 2021 22:36:14 +0100 |
parents | b0bce2c8e4a9 |
children | 1d661f15adab 1fd9e27df5be |
line wrap: on
line source
// // Sidebar.swift // Simoleon // // Created by Dennis Concepción Martín on 18/07/2021. // import SwiftUI struct Sidebar: View { @Environment(\.managedObjectContext) private var viewContext @FetchRequest(sortDescriptors: []) private var defaultCurrency: FetchedResults<DefaultCurrency> var body: some View { List { NavigationLink(destination: Conversion(currencyPair: defaultCurrency.first?.pair ?? "USD/GBP")) { Label("Convert", systemImage: "arrow.counterclockwise.circle") } NavigationLink(destination: Favorites()) { Label("Favorites", systemImage: "star") } NavigationLink(destination: Settings()) { Label("Settings", systemImage: "gear") } } .listStyle(SidebarListStyle()) .navigationTitle("Categories") } } struct Sidebar_Previews: PreviewProvider { static var previews: some View { NavigationView { Sidebar() } } }