2022-12-15 00:03:10 +01:00
|
|
|
//
|
|
|
|
// View+ViewModifiers.swift
|
|
|
|
// Browse
|
|
|
|
//
|
|
|
|
// Created by Javier Cicchelli on 14/12/2022.
|
|
|
|
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2022-12-16 17:22:02 +01:00
|
|
|
import DataModels
|
2022-12-15 00:03:10 +01:00
|
|
|
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 }
|
|
|
|
))
|
|
|
|
}
|
2022-12-16 10:47:20 +01:00
|
|
|
|
2022-12-17 00:04:29 +01:00
|
|
|
func createFolder(
|
|
|
|
isPresenting: Binding<Bool>,
|
|
|
|
id: String,
|
|
|
|
submitted: @escaping ActionClosure
|
|
|
|
) -> some View {
|
|
|
|
modifier(CreateFolderViewModifier(
|
|
|
|
isPresenting: isPresenting,
|
|
|
|
id: id,
|
|
|
|
submitted: submitted
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
2022-12-16 10:47:20 +01:00
|
|
|
func delete(
|
2022-12-16 17:20:19 +01:00
|
|
|
item: Binding<(any FileSystemItem)?>,
|
2022-12-16 17:22:02 +01:00
|
|
|
deleted: @escaping ActionClosure
|
2022-12-16 10:47:20 +01:00
|
|
|
) -> some View {
|
2022-12-16 17:22:02 +01:00
|
|
|
modifier(DeleteItemViewModifier(
|
|
|
|
item: item,
|
|
|
|
deleted: deleted
|
|
|
|
))
|
2022-12-16 10:47:20 +01:00
|
|
|
}
|
2022-12-15 00:03:10 +01:00
|
|
|
}
|