Add system button

This commit is contained in:
Balazs Perlaki-Horvath 2024-04-14 17:33:43 +02:00
parent f8a5a266d4
commit 96fcb0c1d8
3 changed files with 36 additions and 0 deletions

View File

@ -145,6 +145,8 @@ private struct CompactView: View {
Spacer()
BookmarkButton()
Spacer()
ShareButton()
Spacer()
TabsManagerButton()
if FeatureFlags.hasLibrary {
Spacer()

View File

@ -37,6 +37,7 @@ struct BrowserTab: View {
#endif
ToolbarItemGroup(placement: .primaryAction) {
OutlineButton()
ShareButton()
BookmarkButton()
ArticleShortcutButtons(displayMode: .mainAndRandomArticle)
}

View 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)
}
}