From 38222cb9d104521afbbd229224ad0d76b8d2b02e Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 25 Jun 2021 22:07:45 +0200 Subject: new project auto opens project settings --- pages/editor.tsx | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'pages') diff --git a/pages/editor.tsx b/pages/editor.tsx index c90d14b..b217eab 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -82,6 +82,9 @@ interface globalState { right: slideTypes | null; }; }; + dialog: { + projectSettings: boolean; + }; ready: { timeline: boolean; video: { @@ -113,6 +116,9 @@ var global = createState({ right: null, }, }, + dialog: { + projectSettings: false, + }, ready: { timeline: false, video: { @@ -771,19 +777,16 @@ function DialogBox(props: { ; } -function ProjectSettings(props: { - close: () => any; - open?: boolean; -}) { +function ProjectSettings() { var proj = useHookstate(project).timeline; + var open = useHookstate(global).dialog.projectSettings; function close() { global.update.refreshLiveTimeline.value(); - console.log(player); - props.close(); + open.set(false); } - return + return
- setProjectSettingsOpen(false)} /> +

Presentation settings

@@ -974,14 +975,28 @@ function DefaultSettings() { variant='contained' color='default' children='New project' - onClick={() => console.log('new project')} + onClick={() => { + var newProj: timeline = { + slides: [], + name: 'New project', + settings: { controlType: 'FullScreen' }, + framerate: 0, + framecount: 0, + }; + player.loadSlides(JSON.stringify(newProj)); + project.timeline.set(player.timeline); + global.timeline.workingTimeline.set(player.timeline.slides); + global.update.refreshLiveTimeline.value(); + global.ready.timeline.set(true); + global.dialog.projectSettings.set(true); + }} startIcon={} />
-- cgit v1.2.3