From 0f322c7c9c846ba49b15c78e7c6be7ab1ccf10e6 Mon Sep 17 00:00:00 2001 From: Bart Huijgen Date: Mon, 18 Nov 2024 21:30:17 +0100 Subject: [PATCH 1/3] Add upload button to header --- apps/blueprints/src/components/Header.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/blueprints/src/components/Header.tsx b/apps/blueprints/src/components/Header.tsx index e598b19..34a9834 100644 --- a/apps/blueprints/src/components/Header.tsx +++ b/apps/blueprints/src/components/Header.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { Box, Heading, Flex, Text } from "@chakra-ui/react"; +import { Box, Heading, Flex, Text, Button } from "@chakra-ui/react"; import Link from "next/link"; import { useRouter } from "next/router"; import { useAuth } from "../providers/auth"; @@ -43,7 +43,6 @@ const Buttons: React.FC = () => { - Register Login About From 4f7298aa8970ecbd1e4308a21af62fddb4d52ac8 Mon Sep 17 00:00:00 2001 From: Bart Huijgen Date: Tue, 19 Nov 2024 00:05:06 +0100 Subject: [PATCH 2/3] Fix upload button styling --- apps/blueprints/src/components/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/blueprints/src/components/Header.tsx b/apps/blueprints/src/components/Header.tsx index 34a9834..40828ef 100644 --- a/apps/blueprints/src/components/Header.tsx +++ b/apps/blueprints/src/components/Header.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { Box, Heading, Flex, Text, Button } from "@chakra-ui/react"; +import { Box, Heading, Flex, Text } from "@chakra-ui/react"; import Link from "next/link"; import { useRouter } from "next/router"; import { useAuth } from "../providers/auth"; From aafe13ff5d8ab114500aa18df200db8d62c70787 Mon Sep 17 00:00:00 2001 From: Bart Huijgen Date: Tue, 19 Nov 2024 22:29:58 +0100 Subject: [PATCH 3/3] 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; };