mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 14:53:25 +01:00
[ADD] Error log view
This commit is contained in:
33
AltStore/View Components/ModalNavigationLink.swift
Normal file
33
AltStore/View Components/ModalNavigationLink.swift
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// ModalNavigationLink.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Fabian Thies on 03.02.23.
|
||||
// Copyright © 2023 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ModalNavigationLink<Label: View, Modal: View>: View {
|
||||
let modal: () -> Modal
|
||||
let label: () -> Label
|
||||
|
||||
@State var isPresentingModal: Bool = false
|
||||
|
||||
var body: some View {
|
||||
SwiftUI.Button {
|
||||
self.isPresentingModal = true
|
||||
} label: {
|
||||
self.label()
|
||||
}
|
||||
.sheet(isPresented: self.$isPresentingModal) {
|
||||
self.modal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//struct ModalNavigationLink_Previews: PreviewProvider {
|
||||
// static var previews: some View {
|
||||
// ModalNavigationLink()
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user