Added the add file and/or folder menu actions into the navigation toolbar in the BrowseView view.

This commit is contained in:
Javier Cicchelli 2022-12-03 08:36:15 +01:00
parent c9b148a2ff
commit b6202c76af

View File

@ -92,8 +92,39 @@ struct BrowseView: View {
.navigationTitle("Folder name")
.toolbar {
ToolbarItem(placement: .primaryAction) {
Menu {
Button {
// TODO: Implement the creation of a new folder.
} label: {
Label {
Text("Create a new folder")
} icon: {
Image.newFolder
}
}
Button {
// TODO: Implement the upload of a file from the device to the API.
} label: {
Label {
Text("Upload a file")
} icon: {
Image.newFile
}
}
} label: {
Label {
Text("Add file and/or folder")
} icon: {
Image.add
.foregroundColor(.red)
}
}
}
ToolbarItem(placement: .navigationBarTrailing) {
Button {
// ...
// TODO: Implement the show of the user profile.
} label: {
Image.profile
.foregroundColor(.red)
@ -107,6 +138,9 @@ struct BrowseView: View {
private extension Image {
static let profile = Image(systemName: "person.crop.circle.fill")
static let add = Image(systemName: "plus.circle.fill")
static let newFolder = Image(systemName: "folder.badge.plus")
static let newFile = Image(systemName: "doc.badge.plus")
static let trash = Image(systemName: "trash")
static let download = Image(systemName: "arrow.down.doc")
}