aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-11-08 00:25:18 -0500
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-11-08 00:25:18 -0500
commitce3e290c66629aa85d6ddeb9aab93165a8d636aa (patch)
tree801ad968eeb2b38f52f9e75212c0f3408a7c2917 /src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
parent74e0744cfd3be6d375ff47f0d32588996074f956 (diff)
loading indicator in layout preview works properly
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
index 3cdde90d5..257c7fc00 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
@@ -968,23 +968,6 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
);
}
- get savedLayoutsPreviewContents() {
- return (
- <div className="docCreatorMenu-preview-container">
- {this._savedLayouts.map((layout, index) => (
- <div
- className="docCreatorMenu-preview-window"
- style={{
- border: this.isSelectedLayout(layout) ? `solid 3px ${Colors.MEDIUM_BLUE}` : '',
- boxShadow: this.isSelectedLayout(layout) ? `0 0 15px rgba(68, 118, 247, .8)` : '',
- }}
- onPointerDown={e => this.setUpButtonClick(e, () => runInAction(() => this.updateSelectedSavedLayout(layout)))}>
- {this.layoutPreviewContents(87, layout, true, index)}
- </div>
- ))}
- </div>
- );
- }
@action updateXMargin = (input: string) => {
this._layout.xMargin = Number(input);
@@ -1128,14 +1111,14 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
this._renderedDocCollection = collection;
}
- layoutPreviewContents = (outerSpan: number, altLayout?: DataVizTemplateLayout, small: boolean = false, id?: number) => {
- const doc: Doc | undefined = altLayout ? altLayout.template : this._fullyRenderedDocs[0]; //!!! might cause a slow down
- if (!doc) return;
+ layoutPreviewContents = (id?: number) => {
return this._docsRendering ? (
- <div className="loading-spinner">
- <ReactLoading type="spin" color={StrCast(Doc.UserDoc().userVariantColor)} height={30} width={30} />
- </div>
+ <div className="docCreatorMenu-layout-preview-window-wrapper loading" id={String(id) ?? undefined}>
+ <div className="loading-spinner">
+ <ReactLoading type="spin" color={StrCast(Doc.UserDoc().userVariantColor)} height={30} width={30} />
+ </div>
+ </div>
) : !this._renderedDocCollection? null : (
<div className="docCreatorMenu-layout-preview-window-wrapper" id={String(id) ?? undefined}>
<DocumentView
@@ -1380,8 +1363,6 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
return this.templatesPreviewContents;
case 'options':
return this.optionsMenuContents;
- case 'saved':
- return this.savedLayoutsPreviewContents;
case 'dashboard':
return this.dashboardContents;
default: