From d409d5e7df22fe6af58528d36cae4903b0fbeec1 Mon Sep 17 00:00:00 2001 From: Bart Huijgen Date: Tue, 19 Nov 2024 22:29:58 +0100 Subject: [PATCH] Use storage url directly for render, instead of api --- apps/blueprints/src/components/blueprint/Blueprint.tsx | 1 + .../src/components/blueprint/BlueprintBook.tsx | 1 + .../src/components/blueprint/BlueprintImage.tsx | 9 ++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/blueprints/src/components/blueprint/Blueprint.tsx b/apps/blueprints/src/components/blueprint/Blueprint.tsx index 4a037b2..c98f4c3 100644 --- a/apps/blueprints/src/components/blueprint/Blueprint.tsx +++ b/apps/blueprints/src/components/blueprint/Blueprint.tsx @@ -153,6 +153,7 @@ export const BlueprintSubPage: React.FC = ({ string={string} label={blueprint.label || ""} blueprint_hash={blueprint.blueprint_hash} + image_hash={blueprint.image_hash} onSetRenderer={setRenderer} /> )} diff --git a/apps/blueprints/src/components/blueprint/BlueprintBook.tsx b/apps/blueprints/src/components/blueprint/BlueprintBook.tsx index e874145..7337f91 100644 --- a/apps/blueprints/src/components/blueprint/BlueprintBook.tsx +++ b/apps/blueprints/src/components/blueprint/BlueprintBook.tsx @@ -226,6 +226,7 @@ export const BlueprintBookSubPage: React.FC = ({ string={selectedBlueprintString} label={selected.data.label || ""} blueprint_hash={selected.data.blueprint_hash} + image_hash={selected.type === "blueprint" ? selected.data.image_hash : undefined} onSetRenderer={setRenderer} /> )} diff --git a/apps/blueprints/src/components/blueprint/BlueprintImage.tsx b/apps/blueprints/src/components/blueprint/BlueprintImage.tsx index e3b3910..c964b01 100644 --- a/apps/blueprints/src/components/blueprint/BlueprintImage.tsx +++ b/apps/blueprints/src/components/blueprint/BlueprintImage.tsx @@ -9,6 +9,7 @@ export type RENDERERS = "fbe" | "fbsr"; interface BlueprintImageProps { string: string; blueprint_hash: string; + image_hash?: string; label: string; onSetRenderer?: (renderer: RENDERERS) => void; } @@ -16,6 +17,7 @@ interface BlueprintImageProps { export const BlueprintImage: React.FC = ({ string, blueprint_hash, + image_hash, label, onSetRenderer, }) => { @@ -37,11 +39,12 @@ export const BlueprintImage: React.FC = ({ return renderer === "fbe" ? ( setRenderer("fbsr")}> - ) : ( + ) : image_hash ? ( - ); + ) : null; };