From 6116ccbc1bcdbb92ff7ebe92a241d0e329a1bc57 Mon Sep 17 00:00:00 2001 From: jonty007 Date: Thu, 25 Jan 2024 22:06:20 +0530 Subject: [PATCH 1/9] loader for transactions and coin issue --- packages/components/built/Auth.js | 6 +++--- packages/components/built/SmartObjectFunction.js | 7 ++++++- packages/components/src/Auth.tsx | 6 +++--- packages/components/src/SmartObjectFunction.tsx | 7 ++++++- packages/explorer/src/components/Navbar.tsx | 11 +++++++++-- .../explorer/src/components/playground/CreateNew.tsx | 5 +++++ .../src/components/playground/DeployModule.tsx | 5 +++++ .../src/components/playground/ExecuteExpression.tsx | 5 +++++ 8 files changed, 42 insertions(+), 10 deletions(-) diff --git a/packages/components/built/Auth.js b/packages/components/built/Auth.js index 689043e56..f7221a67f 100644 --- a/packages/components/built/Auth.js +++ b/packages/components/built/Auth.js @@ -54,9 +54,9 @@ function getUrl(chain, network) { return url; } function defaultConfiguration() { - var chain = (process.env["REACT_APP_CHAIN"] || localStorage.getItem("CHAIN") || "LTC"); - var network = (process.env["REACT_APP_NETWORK"] || - localStorage.getItem("NETWORK") || + var chain = (localStorage.getItem("CHAIN") || process.env["REACT_APP_CHAIN"] || "LTC"); + var network = (localStorage.getItem("NETWORK") || + process.env["REACT_APP_NETWORK"] || "regtest"); var url = getUrl(chain, network); return { chain: chain, network: network, url: url }; diff --git a/packages/components/built/SmartObjectFunction.js b/packages/components/built/SmartObjectFunction.js index deee49cce..5b97569ab 100644 --- a/packages/components/built/SmartObjectFunction.js +++ b/packages/components/built/SmartObjectFunction.js @@ -49,6 +49,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run import { useState } from "react"; import { TypeSelectionDropdown } from "./common/TypeSelectionDropdown"; import { isValidRev, sleep } from "./common/utils"; +import { UtilsContext } from "./UtilsContext"; export var getErrorMessage = function (error) { var _a, _b, _c, _d, _e, _f; if (((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === @@ -87,12 +88,14 @@ export var getValueForType = function (type, stringValue) { export var SmartObjectFunction = function (_a) { var computer = _a.computer, smartObject = _a.smartObject, functionsExist = _a.functionsExist, options = _a.options, setFunctionResult = _a.setFunctionResult, setShow = _a.setShow, setModalTitle = _a.setModalTitle; var _b = useState({}), formState = _b[0], setFormState = _b[1]; + var showLoader = UtilsContext.useUtilsComponents().showLoader; var handleSmartObjectMethod = function (event, smartObject, fnName, params) { return __awaiter(void 0, void 0, void 0, function () { var revMap_1, tx, res, error_1; return __generator(this, function (_a) { switch (_a.label) { case 0: event.preventDefault(); + showLoader(true); _a.label = 1; case 1: _a.trys.push([1, 6, , 7]); @@ -132,12 +135,14 @@ export var SmartObjectFunction = function (_a) { res = _a.sent(); setFunctionResult({ _rev: res[0] }); setModalTitle("Success!"); + showLoader(false); setShow(true); return [3 /*break*/, 7]; case 6: error_1 = _a.sent(); setFunctionResult(getErrorMessage(error_1)); setModalTitle("Error!"); + showLoader(false); setShow(true); return [3 /*break*/, 7]; case 7: return [2 /*return*/]; @@ -163,7 +168,7 @@ export var SmartObjectFunction = function (_a) { }) .map(function (key, fnIndex) { var paramList = getFnParamNames(Object.getPrototypeOf(smartObject)[key]); - return (_jsxs("div", __assign({ className: "mt-6 mb-6" }, { children: [_jsx("h3", __assign({ className: "mt-2 text-xl font-bold dark:text-white" }, { children: key })), _jsxs("form", __assign({ id: "fn-index-".concat(fnIndex) }, { children: [paramList.map(function (paramName, paramIndex) { return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx("div", __assign({ className: "mb-2" }, { children: _jsx("label", __assign({ htmlFor: "".concat(key, "-").concat(paramName), className: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" }, { children: paramName })) })), _jsxs("div", __assign({ className: "flex items-center space-x-4" }, { children: [_jsx("input", { type: "text", id: "".concat(key, "-").concat(paramName), value: formState["".concat(key, "-").concat(paramName)], onChange: function (e) { return updateFormValue(e, "".concat(key, "-").concat(paramName)); }, 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", placeholder: "Value", required: true }), _jsx(TypeSelectionDropdown, { id: "".concat(key).concat(paramName), dropdownList: options, onSelectMethod: function (option) { + return (_jsxs("div", __assign({ className: "mt-6 mb-6" }, { children: [_jsx("h3", __assign({ className: "mt-2 text-xl font-bold dark:text-white" }, { children: key })), _jsxs("form", __assign({ id: "fn-index-".concat(fnIndex) }, { children: [paramList.map(function (paramName, paramIndex) { return (_jsxs("div", __assign({ className: "mb-4" }, { children: [_jsx("div", __assign({ className: "mb-2" }, { children: _jsx("label", __assign({ htmlFor: "".concat(key, "-").concat(paramName), className: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" }, { children: paramName })) })), _jsxs("div", __assign({ className: "flex items-center space-x-4" }, { children: [_jsx("input", { type: "text", id: "".concat(key, "-").concat(paramName), value: formState["".concat(key, "-").concat(paramName)] || "", onChange: function (e) { return updateFormValue(e, "".concat(key, "-").concat(paramName)); }, 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", placeholder: "Value", required: true }), _jsx(TypeSelectionDropdown, { id: "".concat(key).concat(paramName), dropdownList: options, onSelectMethod: function (option) { return updateTypes(option, "".concat(key, "-").concat(paramName)); } })] }))] }), paramIndex)); }), _jsx("button", __assign({ className: "mr-8 text-white bg-blue-700 hover:bg-blue-800 focus:outline-none focus:ring-4 focus:ring-blue-300 font-medium rounded-md text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", onClick: function (evt) { return handleSmartObjectMethod(evt, smartObject, key, paramList); } }, { children: "Call Function" }))] }))] }), fnIndex)); })] })); diff --git a/packages/components/src/Auth.tsx b/packages/components/src/Auth.tsx index c6200e88d..7374d8e92 100644 --- a/packages/components/src/Auth.tsx +++ b/packages/components/src/Auth.tsx @@ -48,9 +48,9 @@ function getUrl(chain: Chain, network: Network) { } function defaultConfiguration() { - const chain = (process.env[`REACT_APP_CHAIN`] || localStorage.getItem("CHAIN") || "LTC") as Chain - const network = (process.env[`REACT_APP_NETWORK`] || - localStorage.getItem("NETWORK") || + const chain = (localStorage.getItem("CHAIN") || process.env[`REACT_APP_CHAIN`] || "LTC") as Chain + const network = (localStorage.getItem("NETWORK") || + process.env[`REACT_APP_NETWORK`] || "regtest") as Network const url = getUrl(chain, network) return { chain, network, url } diff --git a/packages/components/src/SmartObjectFunction.tsx b/packages/components/src/SmartObjectFunction.tsx index ba9a547c7..84b583285 100644 --- a/packages/components/src/SmartObjectFunction.tsx +++ b/packages/components/src/SmartObjectFunction.tsx @@ -1,6 +1,7 @@ import { useState } from "react" import { TypeSelectionDropdown } from "./common/TypeSelectionDropdown" import { isValidRev, sleep } from "./common/utils" +import { UtilsContext } from "./UtilsContext" export const getErrorMessage = (error: any): string => { if ( @@ -49,6 +50,7 @@ export const SmartObjectFunction = ({ setModalTitle, }: any) => { const [formState, setFormState] = useState({}) + const { showLoader } = UtilsContext.useUtilsComponents() const handleSmartObjectMethod = async ( event: any, @@ -57,6 +59,7 @@ export const SmartObjectFunction = ({ params: string[] ) => { event.preventDefault() + showLoader(true) try { const revMap: any = {} @@ -90,10 +93,12 @@ export const SmartObjectFunction = ({ const res = await computer.query({ ids: [smartObject._id] }) setFunctionResult({ _rev: res[0] }) setModalTitle("Success!") + showLoader(false) setShow(true) } catch (error: any) { setFunctionResult(getErrorMessage(error)) setModalTitle("Error!") + showLoader(false) setShow(true) } } @@ -140,7 +145,7 @@ export const SmartObjectFunction = ({ updateFormValue(e, `${key}-${paramName}`)} 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" placeholder="Value" diff --git a/packages/explorer/src/components/Navbar.tsx b/packages/explorer/src/components/Navbar.tsx index 301d93c27..dba9c0451 100644 --- a/packages/explorer/src/components/Navbar.tsx +++ b/packages/explorer/src/components/Navbar.tsx @@ -122,6 +122,13 @@ function NotLoggedMenu() { localStorage.setItem("CHAIN", chain) localStorage.setItem("NETWORK", network) setDropDownLabel(formatChainAndNetwork(chain, network)) + console.log( + chain, + network, + formatChainAndNetwork(chain, network), + localStorage.getItem("CHAIN"), + localStorage.getItem("NETWORK") + ) window.location.href = "/" } catch (err) { showSnackBar("Error setting chain and network", false) @@ -161,7 +168,7 @@ function NotLoggedMenu() { className="z-10 hidden font-normal bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600" > + + ) +} + +export default function Navbar() { + useEffect(() => { + initFlowbite() + }, []) + + return ( + <> + + + ) } diff --git a/packages/cra-template/src/components/NavbarWrapper.tsx b/packages/cra-template/src/components/NavbarWrapper.tsx deleted file mode 100644 index 6788e8f7f..000000000 --- a/packages/cra-template/src/components/NavbarWrapper.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { Dispatch, SetStateAction, useState } from "react" -import Wallet from "./Wallet" -import Navbar from "./Navbar" -import Login from "./Login" -import { Computer } from "@bitcoin-computer/lib" -import { Config } from "../types/common" - -export default function NavbarWrapper(props: { - computer: Computer - config: Config - setComputer: Dispatch> -}) { - const { computer, config, setComputer } = props - const [loggedIn] = useState(localStorage.getItem("BIP_39_KEY") !== null) - const [isOpen, setIsOpen] = useState(false && loggedIn) - const [showLogin, setShowLogin] = useState(false) - - return ( -
- - - {showLogin && ( - - )} -
- ) -} diff --git a/packages/cra-template/src/components/SnackBar.tsx b/packages/cra-template/src/components/SnackBar.tsx deleted file mode 100644 index 13be0b754..000000000 --- a/packages/cra-template/src/components/SnackBar.tsx +++ /dev/null @@ -1,41 +0,0 @@ -function SnackBar(props: any) { - const { message, success, setShow, callback } = props - - const closeMessage = (evt: any) => { - evt.preventDefault() - setShow(false) - } - - setTimeout(async () => { - setShow(false) - if (callback) callback() - }, 4000) - - return ( -
- {message} - - - Close - - - -
- ) -} - -export default SnackBar diff --git a/packages/cra-template/src/components/Wallet.tsx b/packages/cra-template/src/components/Wallet.tsx deleted file mode 100644 index cd1899a96..000000000 --- a/packages/cra-template/src/components/Wallet.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import { Computer } from "@bitcoin-computer/lib" -import { Dispatch, SetStateAction, useCallback, useEffect, useState } from "react" -import { GrClose, GrRefresh } from "react-icons/gr" - -export default function Wallet(props: { - computer: Computer - setIsOpen: Dispatch> - isOpen: boolean -}) { - const { computer, isOpen, setIsOpen } = props - const [balance, setBalance] = useState(0) - - const refreshBalance = useCallback(async () => { - try { - if (computer) setBalance(await computer.getBalance()) - } catch (err) { - console.log(err) - console.log("error occurred while fetching wallet details: ", err) - } - }, [computer]) - - useEffect(() => { - ;(async () => { - await refreshBalance() - })() - }, [refreshBalance]) - - return ( -
-
-
-
- { - setIsOpen(false) - }} - className="justify-end text-2xl mt-4 mr-4 hover:text-slate-500 cursor-pointer" - > -
-
-
Balance
-
- - {balance / 1e8} - LTC - - -
-
-
-
- Address -
- {computer ? computer.getAddress() : ""} - {/* */} -
-
-
- Public Key -
- {computer ? computer.getPublicKey() : ""} - {/* */} -
-
-
-
{ - setIsOpen(false) - }} - >
-
- ) -} diff --git a/packages/cra-template/src/types/common.ts b/packages/cra-template/src/types/common.ts index 19f04e9e1..5eb750411 100644 --- a/packages/cra-template/src/types/common.ts +++ b/packages/cra-template/src/types/common.ts @@ -1,6 +1,2 @@ -export interface Config { - chain: string - network: string - mnemonic: string - url: string -} +export type Chain = "LTC" | "BTC" | "DOGE" +export type Network = "testnet" | "mainnet" | "regtest" diff --git a/packages/cra-template/tailwind.config.js b/packages/cra-template/tailwind.config.js index 37cc65141..1a612e113 100644 --- a/packages/cra-template/tailwind.config.js +++ b/packages/cra-template/tailwind.config.js @@ -1,8 +1,16 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ["./src/**/*.{js,jsx,ts,tsx}"], + content: ["./src/**/*.{js,jsx,ts,tsx}", "../components/built/**/*.{js,jsx,ts,tsx}"], + darkMode: "media", theme: { - extend: {}, + extend: { + colors: { + "blue-1": "#000F38", + "blue-2": "#002A99", + "blue-3": "#0046FF", + "blue-4": "#A7BFFF", + }, + }, }, plugins: [], -}; +} From cf8590adaa0d6b79153c9f7aa6dd2e53c439e9e2 Mon Sep 17 00:00:00 2001 From: jonty007 Date: Tue, 13 Feb 2024 18:46:54 +0530 Subject: [PATCH 5/9] Updated package.json --- packages/TBC20/package.json | 2 +- packages/TBC721/package.json | 2 +- packages/cra-template/package.json | 2 +- packages/explorer/package.json | 2 +- packages/nodejs-template/package.json | 2 +- packages/wallet/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/TBC20/package.json b/packages/TBC20/package.json index 6ff993a69..fe8cfed09 100644 --- a/packages/TBC20/package.json +++ b/packages/TBC20/package.json @@ -5,7 +5,7 @@ "private": true, "type": "module", "devDependencies": { - "@types/bitcoin-computer__lib": "0.15.0", + "@types/bitcoin-computer__lib": "^0.17.0", "@types/chai": "^4.3.1", "@types/expect": "^24.3.0", "@types/mocha": "^9.1.1", diff --git a/packages/TBC721/package.json b/packages/TBC721/package.json index 1cf758b4b..692aef637 100644 --- a/packages/TBC721/package.json +++ b/packages/TBC721/package.json @@ -25,7 +25,7 @@ "tslib": "~2.4.0" }, "devDependencies": { - "@types/bitcoin-computer__lib": "0.15.0", + "@types/bitcoin-computer__lib": "^0.17.0", "@types/chai": "^4.3.1", "@types/expect": "^24.3.0", "@types/mocha": "^9.1.1", diff --git a/packages/cra-template/package.json b/packages/cra-template/package.json index f753f54f5..ef8beb2ca 100644 --- a/packages/cra-template/package.json +++ b/packages/cra-template/package.json @@ -8,7 +8,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@types/bitcoin-computer__lib": "^0.10.0", + "@types/bitcoin-computer__lib": "^0.17.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.16", "@types/react": "^18.0.28", diff --git a/packages/explorer/package.json b/packages/explorer/package.json index b766baf0c..4a26dcb22 100644 --- a/packages/explorer/package.json +++ b/packages/explorer/package.json @@ -8,7 +8,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@types/bitcoin-computer__lib": "^0.10.0", + "@types/bitcoin-computer__lib": "^0.17.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.16", "@types/react": "^18.0.28", diff --git a/packages/nodejs-template/package.json b/packages/nodejs-template/package.json index 89b9ffe19..599390c68 100644 --- a/packages/nodejs-template/package.json +++ b/packages/nodejs-template/package.json @@ -15,7 +15,7 @@ "@bitcoin-computer/lib": "^0.17.1-beta.0" }, "devDependencies": { - "@types/bitcoin-computer__lib": "0.15.0", + "@types/bitcoin-computer__lib": "^0.17.0", "@types/mocha": "^9.1.1", "@types/node": "~18.0.0", "@typescript-eslint/eslint-plugin": "^5.10.0", diff --git a/packages/wallet/package.json b/packages/wallet/package.json index 38d34262a..13a62632c 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -7,7 +7,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@types/bitcoin-computer__lib": "^0.10.0", + "@types/bitcoin-computer__lib": "^0.17.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.16", "@types/react": "^18.0.28", From a29de8f507bc2b984ffd0c533e517cedcbf52ab9 Mon Sep 17 00:00:00 2001 From: jonty007 Date: Tue, 13 Feb 2024 19:08:51 +0530 Subject: [PATCH 6/9] Revert "Updated package.json" This reverts commit cf8590adaa0d6b79153c9f7aa6dd2e53c439e9e2. --- packages/TBC20/package.json | 2 +- packages/TBC721/package.json | 2 +- packages/cra-template/package.json | 2 +- packages/explorer/package.json | 2 +- packages/nodejs-template/package.json | 2 +- packages/wallet/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/TBC20/package.json b/packages/TBC20/package.json index fe8cfed09..6ff993a69 100644 --- a/packages/TBC20/package.json +++ b/packages/TBC20/package.json @@ -5,7 +5,7 @@ "private": true, "type": "module", "devDependencies": { - "@types/bitcoin-computer__lib": "^0.17.0", + "@types/bitcoin-computer__lib": "0.15.0", "@types/chai": "^4.3.1", "@types/expect": "^24.3.0", "@types/mocha": "^9.1.1", diff --git a/packages/TBC721/package.json b/packages/TBC721/package.json index 692aef637..1cf758b4b 100644 --- a/packages/TBC721/package.json +++ b/packages/TBC721/package.json @@ -25,7 +25,7 @@ "tslib": "~2.4.0" }, "devDependencies": { - "@types/bitcoin-computer__lib": "^0.17.0", + "@types/bitcoin-computer__lib": "0.15.0", "@types/chai": "^4.3.1", "@types/expect": "^24.3.0", "@types/mocha": "^9.1.1", diff --git a/packages/cra-template/package.json b/packages/cra-template/package.json index ef8beb2ca..f753f54f5 100644 --- a/packages/cra-template/package.json +++ b/packages/cra-template/package.json @@ -8,7 +8,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@types/bitcoin-computer__lib": "^0.17.0", + "@types/bitcoin-computer__lib": "^0.10.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.16", "@types/react": "^18.0.28", diff --git a/packages/explorer/package.json b/packages/explorer/package.json index 4a26dcb22..b766baf0c 100644 --- a/packages/explorer/package.json +++ b/packages/explorer/package.json @@ -8,7 +8,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@types/bitcoin-computer__lib": "^0.17.0", + "@types/bitcoin-computer__lib": "^0.10.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.16", "@types/react": "^18.0.28", diff --git a/packages/nodejs-template/package.json b/packages/nodejs-template/package.json index 599390c68..89b9ffe19 100644 --- a/packages/nodejs-template/package.json +++ b/packages/nodejs-template/package.json @@ -15,7 +15,7 @@ "@bitcoin-computer/lib": "^0.17.1-beta.0" }, "devDependencies": { - "@types/bitcoin-computer__lib": "^0.17.0", + "@types/bitcoin-computer__lib": "0.15.0", "@types/mocha": "^9.1.1", "@types/node": "~18.0.0", "@typescript-eslint/eslint-plugin": "^5.10.0", diff --git a/packages/wallet/package.json b/packages/wallet/package.json index 13a62632c..38d34262a 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -7,7 +7,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "@types/bitcoin-computer__lib": "^0.17.0", + "@types/bitcoin-computer__lib": "^0.10.0", "@types/jest": "^27.5.2", "@types/node": "^16.18.16", "@types/react": "^18.0.28", From e5cf5e34d4914fe8e43fcb1956aa1b0b1b1794da Mon Sep 17 00:00:00 2001 From: ltardivo Date: Tue, 13 Feb 2024 17:57:16 -0300 Subject: [PATCH 7/9] Updates monorepo package-lock.json with dependencies for cra-template --- package-lock.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index e9cd5660c..f71ab9270 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32448,6 +32448,7 @@ "name": "@bitcoin-computer/cra-template", "version": "0.17.1-beta.0", "dependencies": { + "@bitcoin-computer/components": "^0.17.1-beta.0", "@bitcoin-computer/lib": "^0.17.1-beta.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", @@ -32457,6 +32458,7 @@ "@types/node": "^16.18.16", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", + "flowbite": "^2.2.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-icons": "^4.8.0", From 8c89a88d15159deda871b6e25d687b2451bb350a Mon Sep 17 00:00:00 2001 From: ltardivo Date: Tue, 13 Feb 2024 17:57:45 -0300 Subject: [PATCH 8/9] Adds instructions to the cra-template README file --- packages/cra-template/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/cra-template/README.md b/packages/cra-template/README.md index 978edb3a1..ee2065a30 100644 --- a/packages/cra-template/README.md +++ b/packages/cra-template/README.md @@ -45,6 +45,12 @@ To start the application run the command below and open [http://localhost:3000]( # Move to the package cd packages/cra-template +# Install the dependencies for cra-template +npm install + +# Use the default environment variables +cp .env.example .env + # Start the app npm run start ``` From 9c81ebc57ba9b0121408c9771abd160c70e3c5bd Mon Sep 17 00:00:00 2001 From: ltardivo Date: Tue, 13 Feb 2024 17:57:55 -0300 Subject: [PATCH 9/9] Minor --- packages/cra-template/src/components/Counter.tsx | 2 ++ packages/cra-template/src/components/Navbar.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cra-template/src/components/Counter.tsx b/packages/cra-template/src/components/Counter.tsx index 3ac34e6e7..a7b34405c 100644 --- a/packages/cra-template/src/components/Counter.tsx +++ b/packages/cra-template/src/components/Counter.tsx @@ -68,6 +68,8 @@ function Counter() { > Increment +
+

{counter ? `Count: ${count}` : ""}

diff --git a/packages/cra-template/src/components/Navbar.tsx b/packages/cra-template/src/components/Navbar.tsx index 0dfe4eb03..d350ce5f2 100644 --- a/packages/cra-template/src/components/Navbar.tsx +++ b/packages/cra-template/src/components/Navbar.tsx @@ -230,7 +230,7 @@ export default function Navbar() { Bitcoin Computer Logo - TBC Explorer + TBC CRA template