Implemented the dismiss button in the ProfileView view for the Profile module.
This commit is contained in:
parent
f324b59601
commit
3d50979d4b
@ -10,10 +10,9 @@
|
|||||||
"profile.sections.names.label.first_name.text" = "First name";
|
"profile.sections.names.label.first_name.text" = "First name";
|
||||||
"profile.sections.names.label.last_name.text" = "Last name";
|
"profile.sections.names.label.last_name.text" = "Last name";
|
||||||
|
|
||||||
"profile.sections.root_info.header.text" = "Root item information";
|
"profile.sections.root_info.header.text" = "Root folder";
|
||||||
"profile.sections.root_info.label.identifier.text" = "Identifier";
|
"profile.sections.root_info.label.identifier.text" = "Identifier";
|
||||||
"profile.sections.root_info.label.is_directory.text" = "Is a directory?";
|
|
||||||
"profile.sections.root_info.label.last_modified.text" = "Last modified";
|
|
||||||
"profile.sections.root_info.label.name.text" = "Name";
|
"profile.sections.root_info.label.name.text" = "Name";
|
||||||
|
"profile.sections.root_info.label.last_modified.text" = "Last modified";
|
||||||
|
|
||||||
"profile.button.log_out.text" = "Log out";
|
"profile.button.log_out.text" = "Log out";
|
||||||
|
@ -11,6 +11,10 @@ import SwiftUI
|
|||||||
|
|
||||||
public struct ProfileView: View {
|
public struct ProfileView: View {
|
||||||
|
|
||||||
|
// MARK: Environments
|
||||||
|
|
||||||
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
|
||||||
// MARK: Properties
|
// MARK: Properties
|
||||||
|
|
||||||
private let user: User?
|
private let user: User?
|
||||||
@ -32,6 +36,7 @@ public struct ProfileView: View {
|
|||||||
// MARK: Body
|
// MARK: Body
|
||||||
|
|
||||||
public var body: some View {
|
public var body: some View {
|
||||||
|
ZStack {
|
||||||
ClearBackgroundList {
|
ClearBackgroundList {
|
||||||
Section {
|
Section {
|
||||||
Image.photo
|
Image.photo
|
||||||
@ -94,6 +99,22 @@ public struct ProfileView: View {
|
|||||||
.listRowBackground(Color.clear)
|
.listRowBackground(Color.clear)
|
||||||
}
|
}
|
||||||
.background(Color.red)
|
.background(Color.red)
|
||||||
|
|
||||||
|
VStack {
|
||||||
|
Button {
|
||||||
|
dismiss()
|
||||||
|
} label: {
|
||||||
|
Image.close
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 32, height: 32)
|
||||||
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||||
|
.padding([.top, .trailing], 24)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -101,6 +122,7 @@ public struct ProfileView: View {
|
|||||||
// MARK: - Images+Constants
|
// MARK: - Images+Constants
|
||||||
|
|
||||||
private extension Image {
|
private extension Image {
|
||||||
|
static let close = Image(systemName: "xmark.circle.fill")
|
||||||
static let photo = Image(systemName: "person.crop.circle.fill")
|
static let photo = Image(systemName: "person.crop.circle.fill")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user