From da4626f7285cef58b9ad4a37e7bce0b2094fc97d Mon Sep 17 00:00:00 2001 From: Israel Adura Date: Sun, 5 Jan 2020 21:49:12 +0000 Subject: [PATCH] Move project name field away from the top section. --- src/index.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 2a297f4ae..5fa3060f7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -533,7 +533,7 @@ function renderScene( } } -function saveAsJSON() { +function saveAsJSON(name: string) { const serialized = JSON.stringify({ version: 1, source: window.location.origin, @@ -541,7 +541,7 @@ function saveAsJSON() { }); saveFile( - "excalidraw.json", + `${name}.json`, "data:text/plain;charset=utf-8," + encodeURIComponent(serialized) ); } @@ -1188,13 +1188,6 @@ class App extends React.Component<{}, AppState> { }} >
-

Project name

- {this.state.name && ( - this.updateProjectName(name)} - /> - )}

Shapes

{SHAPES.map(({ value, icon }) => ( @@ -1367,11 +1360,20 @@ class App extends React.Component<{}, AppState> { background
+

Project name

+
+ {this.state.name && ( + this.updateProjectName(name)} + /> + )} +

Save/Load