Add download button to shared canvases (#7)

thx @sigaloid 

* Add download button to shared canvases
* Update canvas_note_share.js
* Update canvas_note_share.js
* Update canvas_note_share.js
* Change to more accurate language
This commit is contained in:
Matt
2022-05-03 19:43:26 +00:00
committed by GitHub
parent 4e4010e15e
commit 7bcd1c3009
2 changed files with 18 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ const App = () => {
width: undefined,
height: appState.height,
});
const [viewModeEnabled, setViewModeEnabled] = React.useState(false);
console.log("no render?");
/**
@@ -45,6 +46,18 @@ const App = () => {
className: "excalidraw-wrapper",
ref: excalidrawWrapperRef
},
React.createElement(
"label",
null,
React.createElement("input", {
type: "checkbox",
checked: viewModeEnabled,
onChange: () => setViewModeEnabled(!viewModeEnabled)
}),
" Edit mode "
),
React.createElement("br"),
React.createElement(Excalidraw.default, {
ref: excalidrawRef,
width: dimensions.width,
@@ -52,7 +65,7 @@ const App = () => {
initialData: {
elements, appState, files
},
viewModeEnabled: true,
viewModeEnabled: !viewModeEnabled,
zenModeEnabled: false,
gridModeEnabled: false,
isCollaborating: false,
@@ -75,4 +88,4 @@ const App = () => {
)
);
};
ReactDOM.render(React.createElement(App), document.getElementById("excalidraw-app"));
ReactDOM.render(React.createElement(App), document.getElementById("excalidraw-app"));