my-files-sample/Modules/Sources/Browse/UI/Extensions/View+ViewModifiers.swift

47 lines
1.0 KiB
Swift
Raw Permalink Normal View History

//
// View+ViewModifiers.swift
// Browse
//
// Created by Javier Cicchelli on 14/12/2022.
// Copyright © 2022 Röck+Cöde. All rights reserved.
//
import DataModels
import SwiftUI
extension View {
func navigate(
to destination: some View,
tagged tag: Stack,
in stack: Binding<Stack?>
) -> some View {
modifier(StackNavigationViewModifier(
tag: tag,
stack: stack,
destination: { destination }
))
}
func createFolder(
isPresenting: Binding<Bool>,
id: String,
submitted: @escaping ActionClosure
) -> some View {
modifier(CreateFolderViewModifier(
isPresenting: isPresenting,
id: id,
submitted: submitted
))
}
func delete(
item: Binding<(any FileSystemItem)?>,
deleted: @escaping ActionClosure
) -> some View {
modifier(DeleteItemViewModifier(
item: item,
deleted: deleted
))
}
}