Add Share Extension for importing recipes via URL
Adds a Share Extension so users can share URLs from Safari (or any app) to open the main app with the ImportURLSheet pre-filled. Uses a custom URL scheme (nextcloud-cookbook://) as the bridge between the extension and the main app. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -255,10 +255,15 @@ struct RecipeTabView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $viewModel.showImportURLSheet) {
|
||||
ImportURLSheet { recipeDetail in
|
||||
viewModel.navigateToImportedRecipe(recipeDetail: recipeDetail)
|
||||
}
|
||||
.sheet(isPresented: $viewModel.showImportURLSheet, onDismiss: {
|
||||
viewModel.pendingImportURL = nil
|
||||
}) {
|
||||
ImportURLSheet(
|
||||
onImport: { recipeDetail in
|
||||
viewModel.navigateToImportedRecipe(recipeDetail: recipeDetail)
|
||||
},
|
||||
initialURL: viewModel.pendingImportURL ?? ""
|
||||
)
|
||||
.environmentObject(appState)
|
||||
}
|
||||
.sheet(isPresented: $showManualReorderSheet) {
|
||||
@@ -303,6 +308,7 @@ struct RecipeTabView: View {
|
||||
|
||||
@Published var showImportURLSheet: Bool = false
|
||||
@Published var importedRecipeDetail: RecipeDetail? = nil
|
||||
@Published var pendingImportURL: String? = nil
|
||||
|
||||
func navigateToSettings() {
|
||||
sidebarPath.append(SidebarDestination.settings)
|
||||
|
||||
Reference in New Issue
Block a user