110 lines
2.9 KiB
Swift

//
// ProfileView.swift
// BeReal
//
// Created by Javier Cicchelli on 03/12/2022.
// Copyright © 2022 Röck+Cöde. All rights reserved.
//
import SwiftUI
struct ProfileView: View {
var body: some View {
List {
Section {
Image.photo
.resizable()
.scaledToFit()
.frame(width: 160)
.frame(maxWidth: .infinity)
}
.listRowBackground(Color.clear)
Section {
Label {
Text("Javier")
} icon: {
Text("First name")
}
.labelStyle(.nameAndValue)
Label {
Text("Cicchelli")
} icon: {
Text("Last name")
}
.labelStyle(.nameAndValue)
} header: {
Text("Names")
}
Section {
Label {
Text("71207ee4c0573fde80b03643caafe62731406404")
} icon: {
Text("Identifier")
}
.labelStyle(.nameAndValue)
Label {
Text("Yes")
} icon: {
Text("Is a directory?")
}
.labelStyle(.nameAndValue)
Label {
Text("3 days ago")
} icon: {
Text("Last modified")
}
.labelStyle(.nameAndValue)
Label {
Text("My files")
} icon: {
Text("name")
}
.labelStyle(.nameAndValue)
} header: {
Text("Root item information")
}
Section {
Button {
// TODO: Log out the existing user.
} label: {
Text("Log out")
.fontWeight(.semibold)
.foregroundColor(.primary)
.frame(maxWidth: .infinity)
}
.tint(.orange)
.buttonStyle(.borderedProminent)
.buttonBorderShape(.roundedRectangle(radius: 8))
.controlSize(.large)
.padding(0)
}
.listRowBackground(Color.clear)
}
.background(Color.red)
.onAppear {
UITableView.appearance().backgroundColor = .clear
}
}
}
// MARK: - Images+Constants
private extension Image {
static let photo = Image(systemName: "person.crop.circle.fill")
}
// MARK: - Previews
struct ProfileView_Previews: PreviewProvider {
static var previews: some View {
ProfileView()
}
}