From 9e6f481f8f75ba9e0beefa82dac7ba4ce6e2a5f3 Mon Sep 17 00:00:00 2001 From: jonty007 Date: Wed, 16 Oct 2024 11:30:41 +0530 Subject: [PATCH] Dark mode fix in wallet, explorer, nft, vite-template, cra-template --- .../built/common/SmartCallExecutionResult.js | 2 +- .../src/common/SmartCallExecutionResult.tsx | 2 +- packages/cra-template/src/App.tsx | 24 ++-- packages/cra-template/src/components/Mint.tsx | 4 +- packages/explorer/src/App.tsx | 26 +++-- .../components/playground/DeployModule.tsx | 1 - packages/ft2/src/App.tsx | 26 +++-- packages/ft2/src/components/Mint.tsx | 109 +++++++++--------- packages/nft/src/App.tsx | 24 ++-- packages/nft/src/components/Gallery.tsx | 2 +- packages/nft/src/components/Mint.tsx | 4 +- packages/nft/src/components/Nft.tsx | 4 +- packages/vite-template/src/App.tsx | 25 ++-- .../vite-template/src/components/Mint.tsx | 4 +- packages/wallet/src/App.tsx | 6 +- 15 files changed, 137 insertions(+), 126 deletions(-) diff --git a/packages/components/built/common/SmartCallExecutionResult.js b/packages/components/built/common/SmartCallExecutionResult.js index 01efb3999..1d92d2035 100644 --- a/packages/components/built/common/SmartCallExecutionResult.js +++ b/packages/components/built/common/SmartCallExecutionResult.js @@ -15,7 +15,7 @@ export function FunctionResultModalContent(_a) { var functionResult = _a.functionResult; var navigate = useNavigate(); if (functionResult && typeof functionResult === "object" && !Array.isArray(functionResult)) - return (_jsx(_Fragment, { children: _jsxs("div", __assign({ className: "p-4 md:p-5" }, { children: ["You created a\u00A0", _jsx(Link, __assign({ to: "/objects/".concat(functionResult._rev), className: "font-medium text-blue-600 dark:text-blue-500 hover:underline", onClick: function () { + return (_jsx(_Fragment, { children: _jsxs("div", __assign({ className: "p-4 md:p-5 dark:text-gray-400" }, { children: ["You created a\u00A0", _jsx(Link, __assign({ to: "/objects/".concat(functionResult._rev), className: "font-medium text-blue-600 dark:text-blue-500 hover:underline", onClick: function () { navigate("/objects/".concat(functionResult._rev)); window.location.reload(); } }, { children: "smart object" })), "."] })) })); diff --git a/packages/components/src/common/SmartCallExecutionResult.tsx b/packages/components/src/common/SmartCallExecutionResult.tsx index f207917a1..bac638713 100644 --- a/packages/components/src/common/SmartCallExecutionResult.tsx +++ b/packages/components/src/common/SmartCallExecutionResult.tsx @@ -6,7 +6,7 @@ export function FunctionResultModalContent({ functionResult }: any) { if (functionResult && typeof functionResult === "object" && !Array.isArray(functionResult)) return ( <> -
+
You created a  - -
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - +
+ +
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
diff --git a/packages/cra-template/src/components/Mint.tsx b/packages/cra-template/src/components/Mint.tsx index 8a8d1bd53..c5ff743be 100644 --- a/packages/cra-template/src/components/Mint.tsx +++ b/packages/cra-template/src/components/Mint.tsx @@ -6,7 +6,7 @@ import { Counter } from "../contracts/counter" function SuccessContent(rev: string) { return ( <> -
+
You created a{" "} -
+
Something went wrong.
diff --git a/packages/explorer/src/App.tsx b/packages/explorer/src/App.tsx index 4c63cb491..ac8565ed7 100644 --- a/packages/explorer/src/App.tsx +++ b/packages/explorer/src/App.tsx @@ -32,18 +32,20 @@ export default function App() { - -
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - +
+ +
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
diff --git a/packages/explorer/src/components/playground/DeployModule.tsx b/packages/explorer/src/components/playground/DeployModule.tsx index 9a1a14b28..f33195ce7 100644 --- a/packages/explorer/src/components/playground/DeployModule.tsx +++ b/packages/explorer/src/components/playground/DeployModule.tsx @@ -57,7 +57,6 @@ const DeployModule = (props: { > Deploy Module -
) } diff --git a/packages/ft2/src/App.tsx b/packages/ft2/src/App.tsx index f1c3a4d9b..04c800446 100644 --- a/packages/ft2/src/App.tsx +++ b/packages/ft2/src/App.tsx @@ -30,18 +30,20 @@ export default function App() { - -
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - +
+ +
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
diff --git a/packages/ft2/src/components/Mint.tsx b/packages/ft2/src/components/Mint.tsx index d0f14f6bc..c1c20b081 100644 --- a/packages/ft2/src/components/Mint.tsx +++ b/packages/ft2/src/components/Mint.tsx @@ -2,12 +2,12 @@ import { useContext, useState } from "react" import { ComputerContext, Modal, UtilsContext } from "@bitcoin-computer/components" import { TBC20 } from "@bitcoin-computer/TBC20" import { Link } from "react-router-dom" -import { REACT_APP_TOKEN_MOD_SPEC } from '../constants/modSpecs' +import { REACT_APP_TOKEN_MOD_SPEC } from "../constants/modSpecs" function SuccessContent(rev: string) { return ( <> -
+
You created a{" "} -
+
Something went wrong.
@@ -67,17 +67,16 @@ export default function Mint() { const [symbol, setSymbol] = useState("AAA") const { showLoader } = UtilsContext.useUtilsComponents() - const onSubmit = async (e: React.SyntheticEvent) => { e.preventDefault() try { showLoader(true) const tbc20 = new TBC20(computer, REACT_APP_TOKEN_MOD_SPEC) const mintId = await tbc20.mint(computer.getPublicKey(), parseInt(amount, 10), name, symbol) - setSuccessRev(mintId || '') + setSuccessRev(mintId || "") showLoader(false) Modal.showModal("success-modal") - } catch (err) { + } catch (err) { showLoader(false) if (err instanceof Error) { setErrorMsg(err.message) @@ -88,54 +87,56 @@ export default function Mint() { return ( <> -
-
-

Mint NFT

-
- - setName(e.target.value)} - className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" - /> -
-
- - setSymbol(e.target.value)} - className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" - /> -
-
- - { setAmount(e.target.value) }} - className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" - /> + +
+

Mint NFT

+
+ + setName(e.target.value)} + className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" + /> +
+
+ + setSymbol(e.target.value)} + className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" + /> +
+
+ + { + setAmount(e.target.value) + }} + className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" + /> +
-
- - - + Mint NFT + + + - + ) } diff --git a/packages/nft/src/App.tsx b/packages/nft/src/App.tsx index 990957162..75efa8dc2 100644 --- a/packages/nft/src/App.tsx +++ b/packages/nft/src/App.tsx @@ -30,17 +30,19 @@ export default function App() { - -
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - +
+ +
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
diff --git a/packages/nft/src/components/Gallery.tsx b/packages/nft/src/components/Gallery.tsx index fac900cc4..bafc7b24f 100644 --- a/packages/nft/src/components/Gallery.tsx +++ b/packages/nft/src/components/Gallery.tsx @@ -25,7 +25,7 @@ function NFTCard({ nft }: { nft: NFT }) { <>
-
+
-
+
Congratiolations! You minted an nft. Click{" "} {url && (
-
+
diff --git a/packages/nft/src/components/Nft.tsx b/packages/nft/src/components/Nft.tsx index 748be765d..f5e69a696 100644 --- a/packages/nft/src/components/Nft.tsx +++ b/packages/nft/src/components/Nft.tsx @@ -107,7 +107,7 @@ const SmartObjectValues = ({ smartObject }: any) => { )} {smartObject.url && (
-
+
-
+
You bought this NFT{" "} - -
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - +
+ {" "} + +
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
diff --git a/packages/vite-template/src/components/Mint.tsx b/packages/vite-template/src/components/Mint.tsx index 81335f0ae..0ab130933 100644 --- a/packages/vite-template/src/components/Mint.tsx +++ b/packages/vite-template/src/components/Mint.tsx @@ -6,7 +6,7 @@ import { Counter } from "../contracts/counter" function SuccessContent(rev: string) { return ( <> -
+
You created a{" "} -
+
Something went wrong.
diff --git a/packages/wallet/src/App.tsx b/packages/wallet/src/App.tsx index 88993864a..3c151ebbb 100644 --- a/packages/wallet/src/App.tsx +++ b/packages/wallet/src/App.tsx @@ -22,7 +22,7 @@ export default function App() { if (!Auth.isLoggedIn()) return ( -
+

Bitcoin Computer Wallet

@@ -36,8 +36,8 @@ export default function App() { -
-
+
+
} /> } />