From 3f8af7b20758d2d56609c9b6acf369b2490fbf32 Mon Sep 17 00:00:00 2001 From: Paolo Guerra Date: Mon, 23 Oct 2023 21:59:23 +0200 Subject: [PATCH] Fix template component scroll issues (#452) * fix(react): adjust template component style and fallback container * fix(frontend): fix height styles when loading * fix(frontend): fix height styles when loading on page component * docs: add changeset * fix(frontend): add missing h-screen styles --- .changeset/lazy-mangos-promise.md | 5 +++++ .changeset/moody-days-brake.md | 5 +++++ .../src/pages/create-with-template-id/index.tsx | 14 +++++++------- packages/frontend/src/pages/page/index.tsx | 6 +++--- .../react/src/components/template-component.tsx | 5 +++-- 5 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 .changeset/lazy-mangos-promise.md create mode 100644 .changeset/moody-days-brake.md diff --git a/.changeset/lazy-mangos-promise.md b/.changeset/lazy-mangos-promise.md new file mode 100644 index 000000000..f98642a4e --- /dev/null +++ b/.changeset/lazy-mangos-promise.md @@ -0,0 +1,5 @@ +--- +"@carrot-kpi/react": patch +--- + +Adjust template component style and fallback container styles diff --git a/.changeset/moody-days-brake.md b/.changeset/moody-days-brake.md new file mode 100644 index 000000000..38450f3bd --- /dev/null +++ b/.changeset/moody-days-brake.md @@ -0,0 +1,5 @@ +--- +"@carrot-kpi/host-frontend": patch +--- + +Fix height styles when loading on page and create component diff --git a/packages/frontend/src/pages/create-with-template-id/index.tsx b/packages/frontend/src/pages/create-with-template-id/index.tsx index ebdee8cff..2d8a36c5a 100644 --- a/packages/frontend/src/pages/create-with-template-id/index.tsx +++ b/packages/frontend/src/pages/create-with-template-id/index.tsx @@ -30,7 +30,7 @@ export const CreateWithTemplateId = () => { const ipfsGatewayURL = useIPFSGatewayURL(); const invalidateLatestKPITokens = useInvalidateLatestKPITokens(); - const [loading, setLoading] = useState(false); + const [loading, setLoading] = useState(true); const [template, setTemplate] = useState( state && "specification" in state.template ? state.template : null, ); @@ -126,17 +126,17 @@ export const CreateWithTemplateId = () => { return ( -
+
{loading || loadingPermission ? ( -
+
) : !creatorAllowed ? ( -
+
) : !pinningProxyAuthenticated ? ( -
+
) : template ? ( @@ -144,12 +144,12 @@ export const CreateWithTemplateId = () => { key={formKey} template={template || undefined} fallback={ -
+
} error={ -
+
{ return ( -
+
+
} error={ -
+
{fallback}; + if (loading || !template || !Component) + return
{fallback}
; return (