Added the add file and/or folder menu actions into the navigation toolbar in the BrowseView view.
This commit is contained in:
parent
c9b148a2ff
commit
b6202c76af
@ -92,8 +92,39 @@ struct BrowseView: View {
|
|||||||
.navigationTitle("Folder name")
|
.navigationTitle("Folder name")
|
||||||
.toolbar {
|
.toolbar {
|
||||||
ToolbarItem(placement: .primaryAction) {
|
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 {
|
Button {
|
||||||
// ...
|
// TODO: Implement the show of the user profile.
|
||||||
} label: {
|
} label: {
|
||||||
Image.profile
|
Image.profile
|
||||||
.foregroundColor(.red)
|
.foregroundColor(.red)
|
||||||
@ -107,6 +138,9 @@ struct BrowseView: View {
|
|||||||
|
|
||||||
private extension Image {
|
private extension Image {
|
||||||
static let profile = Image(systemName: "person.crop.circle.fill")
|
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 trash = Image(systemName: "trash")
|
||||||
static let download = Image(systemName: "arrow.down.doc")
|
static let download = Image(systemName: "arrow.down.doc")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user