mirror of
https://github.com/wallabag/ios-app.git
synced 2026-05-19 15:10:34 +00:00
b59b9e0408
* Bump version * Clean code (#393) * Mac os version (#395) * wip mac os version * Build on macos * WIP Webview * Update app icon Refacto routing * Move folder * Image list * Change badge update * Arrange entry view menu * Add refresh command * Add app Sandbox for macos + first build on macos * Fix #397 * Fix macos build * Try fix app icon * Rework toolbar entry * Fix logo * Add test on serverViewModel * Update refresh button * Clean file + clean Picker * Fix progress view * Fix delete entry on ipad fix #389 * Swiftformat * Add swipe to back fix #356 * enhance bottom button tap fix #400 * Add dismiss action in entry view fix #338 * Add sorting options only on id fix #71 * Add progress
30 lines
793 B
Swift
30 lines
793 B
Swift
import SwiftUI
|
|
|
|
struct ArchiveEntryButton: View {
|
|
@ObservedObject var entry: Entry
|
|
let showText: Bool
|
|
let action: (() -> Void)?
|
|
|
|
init(entry: Entry, showText: Bool = true, action: (() -> Void)? = nil) {
|
|
self.entry = entry
|
|
self.showText = showText
|
|
self.action = action
|
|
}
|
|
|
|
var body: some View {
|
|
Button(action: {
|
|
entry.toggleArchive()
|
|
action?()
|
|
}, label: {
|
|
if showText {
|
|
Label(
|
|
entry.isArchived ? "Mark as unread" : "Mark as read",
|
|
systemImage: entry.isArchived ? "book.fill" : "book"
|
|
)
|
|
} else {
|
|
EntryPictoImage(entry: entry, keyPath: \.isArchived, picto: "book")
|
|
}
|
|
})
|
|
}
|
|
}
|