fix: allow to toggle between modes when view only mode to make UI consistent (#3009)

This commit is contained in:
Aakansha Doshi 2021-02-12 14:10:40 +05:30 committed by GitHub
parent ecbd5ba55d
commit b5fc8757a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View file

@ -3701,15 +3701,16 @@ class App extends React.Component<ExcalidrawProps, AppState> {
options.push(actionCopyAsSvg);
}
if (!element) {
const viewModeOptions: ContextMenuOption[] = [
const viewModeOptions = [
...options,
typeof this.props.gridModeEnabled === "undefined" &&
actionToggleGridMode,
typeof this.props.zenModeEnabled === "undefined" && actionToggleZenMode,
typeof this.props.viewModeEnabled === "undefined" &&
actionToggleViewMode,
actionToggleStats,
];
if (typeof this.props.viewModeEnabled === "undefined") {
viewModeOptions.push(actionToggleViewMode);
}
ContextMenu.push({
options: viewModeOptions,
top: clientY,