Create / edit recipe form unification and improvements (#4693)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { NavigateFunction } from 'react-router-dom';
|
||||
import { Recipe } from '../api/types.gen';
|
||||
|
||||
export type View =
|
||||
| 'welcome'
|
||||
@@ -15,7 +16,6 @@ export type View =
|
||||
| 'schedules'
|
||||
| 'sharedSession'
|
||||
| 'loading'
|
||||
| 'recipeEditor'
|
||||
| 'recipes'
|
||||
| 'permission';
|
||||
|
||||
@@ -27,13 +27,14 @@ export type ViewOptions = {
|
||||
sessionDetails?: unknown;
|
||||
error?: string;
|
||||
baseUrl?: string;
|
||||
config?: unknown;
|
||||
recipe?: Recipe;
|
||||
parentView?: View;
|
||||
parentViewOptions?: ViewOptions;
|
||||
disableAnimation?: boolean;
|
||||
initialMessage?: string;
|
||||
resetChat?: boolean;
|
||||
shareToken?: string;
|
||||
resumeSessionId?: string;
|
||||
};
|
||||
|
||||
export const createNavigationHandler = (navigate: NavigateFunction) => {
|
||||
@@ -66,9 +67,7 @@ export const createNavigationHandler = (navigate: NavigateFunction) => {
|
||||
case 'sharedSession':
|
||||
navigate('/shared-session', { state: options });
|
||||
break;
|
||||
case 'recipeEditor':
|
||||
navigate('/recipe-editor', { state: options });
|
||||
break;
|
||||
|
||||
case 'welcome':
|
||||
navigate('/welcome', { state: options });
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user