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
|
2022-01-03 17:56:43 +00:00
|
|
|
import TwigsCore
|
2019-10-19 22:18:06 +00:00
|
|
|
|
|
|
|
struct ProfileView: View {
|
2022-05-18 01:04:27 +00:00
|
|
|
@EnvironmentObject var dataStore: DataStore
|
2022-01-03 17:56:43 +00:00
|
|
|
|
2022-05-18 01:04:27 +00:00
|
|
|
@ViewBuilder
|
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)
|
2022-05-18 01:04:27 +00:00
|
|
|
if case let .success(user) = self.dataStore.currentUser {
|
|
|
|
Text(user.username)
|
|
|
|
}
|
2021-09-15 03:22:14 +00:00
|
|
|
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
|