import React, { useState } from "react"; import { TezosToolkit } from "@taquito/taquito"; import "./App.css"; import ConnectButton from "./components/ConnectWallet"; import DisconnectButton from "./components/DisconnectWallet"; import qrcode from "qrcode-generator"; import Records from "./components/Records"; import Transfers from "./components/Transfers"; enum BeaconConnection { NONE = "", LISTENING = "Listening to P2P channel", CONNECTED = "Channel connected", PERMISSION_REQUEST_SENT = "Permission request sent, waiting for response", PERMISSION_REQUEST_SUCCESS = "Wallet is connected" } const App = () => { const [Tezos, setTezos] = useState( new TezosToolkit("https://api.tez.ie/rpc/granadanet") ); const [contract, setContract] = useState(undefined); const [publicToken, setPublicToken] = useState(""); const [wallet, setWallet] = useState(null); const [userAddress, setUserAddress] = useState(""); const [userBalance, setUserBalance] = useState(0); const [storage, setStorage] = useState({dates: []}); const [copiedPublicToken, setCopiedPublicToken] = useState(false); const [beaconConnection, setBeaconConnection] = useState(false); const [activeTab, setActiveTab] = useState("transfer"); // Granadanet Memoir contract const contractAddress: string = "KT1T4idqQZpt1Ayn9SRNqCo7PsiBreT5YsMB"; const generateQrCode = (): { __html: string } => { const qr = qrcode(0, "L"); qr.addData(publicToken || ""); qr.make(); return { __html: qr.createImgTag(4) }; }; if (publicToken && (!userAddress || isNaN(userBalance))) { return (

MyMedMemoir

Try the Taquito Boilerplate App!

  Connecting to your wallet

{copiedPublicToken ? ( ) : ( { if (publicToken) { navigator.clipboard.writeText(publicToken); setCopiedPublicToken(true); setTimeout(() => setCopiedPublicToken(false), 2000); } }} > )} Public token: {publicToken}

Status: {beaconConnection ? "Connected" : "Disconnected"}

); } else if (userAddress && !isNaN(userBalance)) { return (

Memoir

setActiveTab("transfer")} > Wallet
setActiveTab("contract")} > New Report
setActiveTab("reports")} > Reports
{activeTab === "transfer" &&

Make a transfer

  {contractAddress}

  {userAddress}

  {(userBalance / 1000000).toLocaleString("en-US")} ęś©

} {activeTab === "contract" &&
} {activeTab === "reports" &&

{storage.dates.map((val: boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined) =>
{val}
)}

}
); } else if (!publicToken && !userAddress && !userBalance) { return (

MyMedMemoir

Welcome to MyMedMemoir!

Hello!

Go forth and Tezos!

); } else { return
An error has occurred
; } }; export default App;