aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-07-30 14:00:12 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-07-30 14:00:12 -0400
commitfb4b4658f39c2a845174372a8fd814c49bf26d7c (patch)
tree2268448b391b5599730618baa229bcca006f31d5 /src/client/views
parent107c389f61df36b464ae3ec73e2f553a78f3e64a (diff)
template preview columns update with resizing
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu.scss2
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu.scss b/src/client/views/nodes/DataVizBox/DocCreatorMenu.scss
index 81fd3386c..b3bacb13c 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu.scss
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu.scss
@@ -259,7 +259,7 @@
.docCreatorMenu-preview-container {
display: grid;
- grid-template-columns: repeat(2, 1fr);
+ grid-template-columns: repeat(2, 140px);
grid-template-rows: 140px;
grid-auto-rows: 141px;
overflow-y: scroll;
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx
index e5288f4f8..34bec3b88 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx
@@ -296,7 +296,8 @@ export class DocCreatorMenu extends ObservableReactComponent<{}> {
get templatesPreviewContents(){
const renderedTemplates: Doc[] = [];
return (
- <div className='docCreatorMenu-preview-container'>
+ <div className='docCreatorMenu-preview-container'
+ style={{gridTemplateColumns: `repeat(${Math.floor((this._menuDimensions.width - 10) / 140)}, 140px)`}}>
{this._templateDocs.map(doc => ({icon: ImageCast(doc.icon), doc})).filter(info => info.icon && info.doc).map(info => {
if (renderedTemplates.includes(info.doc)) return undefined;
renderedTemplates.push(info.doc);