1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30
yattee/Shared/Views/SettingsButtons.swift

28 lines
809 B
Swift
Raw Normal View History

2022-12-12 03:45:56 +05:30
import SwiftUI
struct SettingsButtons: View {
@ObservedObject private var accounts = AccountsModel.shared
private var navigation = NavigationModel.shared
var body: some View {
Button(action: { navigation.presentingAccounts = true }) {
2022-12-12 04:10:08 +05:30
if let account = accounts.current {
Label(account.description, image: account.app?.rawValue.capitalized ?? "")
} else {
Label("Signed Out", systemImage: "xmark")
}
2022-12-12 03:45:56 +05:30
}
Button(action: { navigation.presentingSettings = true }) {
Label("Settings", systemImage: "gearshape.2")
}
}
}
struct SettingsButtons_Previews: PreviewProvider {
static var previews: some View {
2022-12-12 04:10:08 +05:30
VStack(spacing: 10) {
SettingsButtons()
}
2022-12-12 03:45:56 +05:30
}
}