From 98c26642d0f405bbea2375d908ba79bf71949ed3 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Tue, 15 Dec 2020 16:21:14 +0100 Subject: [PATCH] fix: hide collab button when onCollabButtonClick not supplied (#2598) --- src/packages/excalidraw/CHANGELOG.MD | 1 + src/packages/excalidraw/README.md | 10 +++++----- src/packages/excalidraw/index.tsx | 3 +-- src/utils.ts | 2 -- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/packages/excalidraw/CHANGELOG.MD b/src/packages/excalidraw/CHANGELOG.MD index c9caeefe..92633cce 100644 --- a/src/packages/excalidraw/CHANGELOG.MD +++ b/src/packages/excalidraw/CHANGELOG.MD @@ -26,6 +26,7 @@ Please add the latest change on the top under the correct section. ### Fixes +- Hide collab button when onCollabButtonClick not supplied [#2598](https://github.com/excalidraw/excalidraw/pull/2598) - Fix resizing the pasted charts [#2586](https://github.com/excalidraw/excalidraw/pull/2586) - Fix element visibility and zoom on cursor when canvas offset isn't 0. [#2534](https://github.com/excalidraw/excalidraw/pull/2534) - Fix Library Menu Layout [#2502](https://github.com/excalidraw/excalidraw/pull/2502) diff --git a/src/packages/excalidraw/README.md b/src/packages/excalidraw/README.md index 43f8214d..a439b9a7 100644 --- a/src/packages/excalidraw/README.md +++ b/src/packages/excalidraw/README.md @@ -219,8 +219,8 @@ This is the user name which shows during collaboration. Defaults to `{name: ''}` #### `excalidrawRef` -You can pass a ref when you want to access some excalidraw API's. -We expose the below API's +You can pass a `ref` when you want to access some excalidraw APIs. +We expose the below APIs: | API | signature | Usage | | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -241,15 +241,15 @@ const excalidrawRef = { current: { readyPromise: { const { @@ -20,7 +19,7 @@ const Excalidraw = (props: ExcalidrawProps) => { initialData, user, excalidrawRef, - onCollabButtonClick = noop, + onCollabButtonClick, isCollaborating, onPointerUpdate, } = props; diff --git a/src/utils.ts b/src/utils.ts index a31a0c4a..821ece57 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -310,8 +310,6 @@ export const isTransparent = (color: string) => { ); }; -export const noop = () => ({}); - export type ResolvablePromise = Promise & { resolve: [T] extends [undefined] ? (value?: T) => void : (value: T) => void; reject: (error: Error) => void;