feat: hide trash button during collaboration (#5037)

* feat: hide trash button during collaboration

* visually hide the trash icon

* pointer events none

* tweak env docs

* fix typo

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Aakansha Doshi 2022-04-15 21:51:41 +05:30 committed by GitHub
parent 96c87f920a
commit 52d10bb41e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 7 deletions

View file

@ -26,3 +26,9 @@
}
}
}
.excalidraw-app.is-collaborating {
[data-testid="clear-canvas-button"] {
visibility: hidden;
pointer-events: none;
}
}

View file

@ -70,6 +70,7 @@ import { isInitializedImageElement } from "../element/typeChecks";
import { loadFilesFromFirebase } from "./data/firebase";
import { LocalData } from "./data/LocalData";
import { isBrowserStorageStateNewer } from "./data/tabSync";
import clsx from "clsx";
const languageDetector = new LanguageDetector();
languageDetector.init({
@ -634,7 +635,12 @@ const ExcalidrawWrapper = () => {
}, []);
return (
<>
<div
style={{ height: "100%" }}
className={clsx("excalidraw-app", {
"is-collaborating": collabAPI?.isCollaborating(),
})}
>
<Excalidraw
ref={excalidrawRefCallback}
onChange={onChange}
@ -686,7 +692,7 @@ const ExcalidrawWrapper = () => {
onClose={() => setErrorMessage("")}
/>
)}
</>
</div>
);
};