2019-10-19 22:18:06 +00:00
|
|
|
//
|
|
|
|
// ProfileView.swift
|
2021-09-21 03:10:24 +00:00
|
|
|
// Twigs
|
2019-10-19 22:18:06 +00:00
|
|
|
//
|
|
|
|
// Created by Billy Brawner on 10/17/19.
|
|
|
|
// Copyright © 2019 William Brawner. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct ProfileView: View {
|
2021-10-06 01:26:54 +00:00
|
|
|
@EnvironmentObject var authDataStore: AuthenticationDataStore
|
|
|
|
var currentUser: User {
|
|
|
|
get {
|
|
|
|
return try! authDataStore.currentUser.get()
|
|
|
|
}
|
|
|
|
}
|
2019-10-19 22:18:06 +00:00
|
|
|
|
|
|
|
var body: some View {
|
2021-09-15 03:22:14 +00:00
|
|
|
VStack(spacing: 10) {
|
|
|
|
Image(systemName: "person.circle.fill")
|
2021-10-06 02:26:17 +00:00
|
|
|
.resizable()
|
2021-09-15 03:22:14 +00:00
|
|
|
.frame(width: 100, height: 100, alignment: .center)
|
|
|
|
.scaledToFill()
|
|
|
|
.clipShape(Circle())
|
|
|
|
.overlay(Circle().stroke(Color.white, lineWidth: 4))
|
|
|
|
.shadow(radius: 5)
|
|
|
|
Text(currentUser.username)
|
|
|
|
NavigationLink(destination: EmptyView()) {
|
|
|
|
Text("change_password")
|
|
|
|
}
|
|
|
|
NavigationLink(destination: EmptyView()) {
|
|
|
|
Text("change_email")
|
|
|
|
}
|
|
|
|
NavigationLink(destination: EmptyView()) {
|
|
|
|
Text("delete_account")
|
|
|
|
.foregroundColor(.red)
|
2019-10-19 22:18:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
struct ProfileView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
2021-10-06 01:26:54 +00:00
|
|
|
ProfileView()
|
2019-10-19 22:18:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|