mirror of
https://github.com/metabolist/metatext
synced 2025-01-14 19:07:05 +01:00
34 lines
1014 B
Swift
34 lines
1014 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import SwiftUI
|
|
|
|
struct SettingsView: View {
|
|
@StateObject var viewModel: SettingsViewModel
|
|
@EnvironmentObject var sceneViewModel: SceneViewModel
|
|
|
|
var body: some View {
|
|
NavigationView {
|
|
Form {
|
|
Text(viewModel.identity.handle)
|
|
}
|
|
.navigationBarTitle(Text("settings"), displayMode: .inline)
|
|
.navigationBarItems(
|
|
leading: Button {
|
|
sceneViewModel.presentingSettings.toggle()
|
|
} label: {
|
|
Image(systemName: "xmark.circle.fill").imageScale(.large)
|
|
})
|
|
}
|
|
.navigationViewStyle(StackNavigationViewStyle())
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
struct SettingsView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
SettingsView(viewModel: SettingsViewModel(identity: .development))
|
|
.environmentObject(SceneViewModel.development)
|
|
}
|
|
}
|
|
#endif
|