Mercurial > public > lazybear
comparison LazyBear/Views/Global Helpers/Company list/Helpers/ToolbarMenu.swift @ 389:db8bc3ed526a
Implementing add to watchlist feature from SearchView
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sun, 25 Apr 2021 16:42:26 +0200 |
parents | |
children | 4c90e5b18632 |
comparison
equal
deleted
inserted
replaced
388:79c39987aaa4 | 389:db8bc3ed526a |
---|---|
1 // | |
2 // ToolbarMenu.swift | |
3 // LazyBear | |
4 // | |
5 // Created by Dennis Concepción Martín on 25/4/21. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct ToolbarMenu: View { | |
11 @Binding var showRenameAction: Bool | |
12 @Binding var showSearchView: Bool | |
13 @Binding var showDeleteAlert: Bool | |
14 | |
15 var body: some View { | |
16 Menu { | |
17 Section { | |
18 Button(action: { showRenameAction = true }) { | |
19 Label("Rename list", systemImage: "square.and.pencil") | |
20 } | |
21 | |
22 Button(action: { showSearchView = true }) { | |
23 Label("Add company", systemImage: "plus") | |
24 } | |
25 } | |
26 | |
27 Section(header: Text("Secondary actions")) { | |
28 Button(action: { showDeleteAlert = true }) { | |
29 Label("Delete list", systemImage: "trash") | |
30 } | |
31 } | |
32 } | |
33 label: { | |
34 Label("Options", systemImage: "ellipsis.circle") | |
35 .imageScale(.large) | |
36 } | |
37 } | |
38 } | |
39 | |
40 struct ToolbarMenu_Previews: PreviewProvider { | |
41 static var previews: some View { | |
42 ToolbarMenu(showRenameAction: .constant(false), showSearchView: .constant(false), showDeleteAlert: .constant(false)) | |
43 } | |
44 } |