From 30a931656240d12476258d8733f67dca412b151b Mon Sep 17 00:00:00 2001 From: jonty007 Date: Fri, 2 Aug 2024 16:20:43 +0530 Subject: [PATCH] Explorer fixes --- packages/components/built/Gallery.js | 4 ++-- .../built/common/SmartCallExecutionResult.js | 4 +++- packages/components/src/Gallery.tsx | 4 ++-- .../src/common/SmartCallExecutionResult.tsx | 13 ++++++++++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/components/built/Gallery.js b/packages/components/built/Gallery.js index 02bbb990b..314241b20 100644 --- a/packages/components/built/Gallery.js +++ b/packages/components/built/Gallery.js @@ -54,7 +54,7 @@ import { useUtilsComponents } from "./UtilsContext"; import { ComputerContext } from "./ComputerContext"; function HomePageCard(_a) { var content = _a.content; - return (_jsx("div", __assign({ className: "block w-80 p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700" }, { children: _jsx("pre", __assign({ className: "font-normal overflow-auto text-gray-700 dark:text-gray-400 text-xs" }, { children: content() })) }))); + return (_jsx("div", __assign({ className: "block w-72 p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700" }, { children: _jsx("pre", __assign({ className: "font-normal overflow-auto text-gray-700 dark:text-gray-400 text-xs" }, { children: content() })) }))); } function ValueComponent(_a) { var _this = this; @@ -92,7 +92,7 @@ function ValueComponent(_a) { } function FromRevs(_a) { var revs = _a.revs, computer = _a.computer; - return (_jsx("div", __assign({ className: "flex flex-wrap gap-4 mb-4 mt-4" }, { children: revs.map(function (rev) { return (_jsx("div", { children: _jsx(Link, __assign({ to: "/objects/".concat(rev), className: "block font-medium text-blue-600 dark:text-blue-500" }, { children: _jsx(ValueComponent, { rev: rev, computer: computer }) })) }, rev)); }) }))); + return (_jsx("div", __assign({ className: "flex flex-wrap flex-col max-h-[75vh] gap-4 mb-4 mt-4" }, { children: revs.map(function (rev) { return (_jsx("div", { children: _jsx(Link, __assign({ to: "/objects/".concat(rev), className: "block font-medium text-blue-600 dark:text-blue-500" }, { children: _jsx(ValueComponent, { rev: rev, computer: computer }) })) }, rev)); }) }))); } function Pagination(_a) { var isPrevAvailable = _a.isPrevAvailable, handlePrev = _a.handlePrev, isNextAvailable = _a.isNextAvailable, handleNext = _a.handleNext; diff --git a/packages/components/built/common/SmartCallExecutionResult.js b/packages/components/built/common/SmartCallExecutionResult.js index fe30861c5..01efb3999 100644 --- a/packages/components/built/common/SmartCallExecutionResult.js +++ b/packages/components/built/common/SmartCallExecutionResult.js @@ -19,5 +19,7 @@ export function FunctionResultModalContent(_a) { navigate("/objects/".concat(functionResult._rev)); window.location.reload(); } }, { children: "smart object" })), "."] })) })); - return (_jsxs("p", __assign({ className: "text-base leading-relaxed text-gray-500 dark:text-gray-400" }, { children: ["You created the value below at Revision ", functionResult._rev, _jsx("pre", { children: functionResult.res.toString() })] }))); + if (functionResult._rev && functionResult.res.toString()) + return (_jsxs("p", __assign({ className: "text-base leading-relaxed text-gray-500 dark:text-gray-400" }, { children: ["You created the value below at Revision ", functionResult._rev, _jsx("pre", { children: functionResult.res.toString() })] }))); + return (_jsx("p", __assign({ className: "text-base leading-relaxed text-gray-500 dark:text-gray-400 p-2" }, { children: functionResult }))); } diff --git a/packages/components/src/Gallery.tsx b/packages/components/src/Gallery.tsx index 8f50aa333..e41a3e96e 100644 --- a/packages/components/src/Gallery.tsx +++ b/packages/components/src/Gallery.tsx @@ -23,7 +23,7 @@ export type UserQuery = Partial<{ function HomePageCard({ content }: any) { return ( -
+
         {content()}
       
@@ -81,7 +81,7 @@ function ValueComponent({ rev, computer }: { rev: string; computer: Computer }) function FromRevs({ revs, computer }: { revs: string[]; computer: any }) { return ( -
+
{revs.map((rev) => (
) + if (functionResult._rev && functionResult.res.toString()) + return ( +

+ You created the value below at Revision {functionResult._rev} +

{functionResult.res.toString()}
+

+ ) + return ( -

- You created the value below at Revision {functionResult._rev} -

{functionResult.res.toString()}
+

+ {functionResult}

) }