twigs-ios/Twigs/Profile/ProfileView.swift

49 lines
1.3 KiB
Swift
Raw Normal View History

//
// ProfileView.swift
// Twigs
//
// Created by Billy Brawner on 10/17/19.
// Copyright © 2019 William Brawner. All rights reserved.
//
import SwiftUI
2022-01-03 17:56:43 +00:00
import TwigsCore
struct ProfileView: View {
@EnvironmentObject var dataStore: DataStore
2022-01-03 17:56:43 +00:00
@ViewBuilder
var body: some View {
VStack(spacing: 10) {
Image(systemName: "person.circle.fill")
2021-10-06 02:26:17 +00:00
.resizable()
.frame(width: 100, height: 100, alignment: .center)
.scaledToFill()
.clipShape(Circle())
.overlay(Circle().stroke(Color.white, lineWidth: 4))
.shadow(radius: 5)
if case let .success(user) = self.dataStore.currentUser {
Text(user.username)
}
NavigationLink(destination: EmptyView()) {
Text("change_password")
}
NavigationLink(destination: EmptyView()) {
Text("change_email")
}
NavigationLink(destination: EmptyView()) {
Text("delete_account")
.foregroundColor(.red)
}
}
}
}
#if DEBUG
struct ProfileView_Previews: PreviewProvider {
static var previews: some View {
ProfileView()
}
}
#endif