mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-25 04:48:16 -04:00
Add system button
This commit is contained in:
parent
f8a5a266d4
commit
96fcb0c1d8
@ -145,6 +145,8 @@ private struct CompactView: View {
|
||||
Spacer()
|
||||
BookmarkButton()
|
||||
Spacer()
|
||||
ShareButton()
|
||||
Spacer()
|
||||
TabsManagerButton()
|
||||
if FeatureFlags.hasLibrary {
|
||||
Spacer()
|
||||
|
@ -37,6 +37,7 @@ struct BrowserTab: View {
|
||||
#endif
|
||||
ToolbarItemGroup(placement: .primaryAction) {
|
||||
OutlineButton()
|
||||
ShareButton()
|
||||
BookmarkButton()
|
||||
ArticleShortcutButtons(displayMode: .mainAndRandomArticle)
|
||||
}
|
||||
|
33
Views/Buttons/ShareButton.swift
Normal file
33
Views/Buttons/ShareButton.swift
Normal file
@ -0,0 +1,33 @@
|
||||
// This file is part of Kiwix for iOS & macOS.
|
||||
//
|
||||
// Kiwix is free software; you can redistribute it and/or modify it
|
||||
// under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 3 of the License, or
|
||||
// any later version.
|
||||
//
|
||||
// Kiwix is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Kiwix; If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ShareButton: View {
|
||||
|
||||
@EnvironmentObject private var browser: BrowserViewModel
|
||||
|
||||
var body: some View {
|
||||
Button {
|
||||
debugPrint("share this")
|
||||
} label: {
|
||||
Label {
|
||||
Text("Share".localized)
|
||||
} icon: {
|
||||
Image(systemName: "square.and.arrow.up")
|
||||
}
|
||||
}.disabled(browser.zimFileName.isEmpty)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user