diff --git a/examples/buddybook/src/App.tsx b/examples/buddybook/src/App.tsx index 3361086..f74a514 100644 --- a/examples/buddybook/src/App.tsx +++ b/examples/buddybook/src/App.tsx @@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button" import { type LightNode } from "@waku/sdk" import { useWaku } from "@waku/react" import { Loader2 } from "lucide-react" -import { Routes, Route, Navigate, Link } from 'react-router-dom' +import { Routes, Route, Navigate, Link, useParams } from 'react-router-dom' import { BlockPayload, getMessagesFromStore, subscribeToFilter } from './lib/waku' import TelemetryOptIn from './components/TelemetryOptIn'; import TelemetryPage from './components/TelemetryPage'; diff --git a/examples/buddybook/src/components/Chain/SignChain.tsx b/examples/buddybook/src/components/Chain/SignChain.tsx index a018fbd..6bbfeb2 100644 --- a/examples/buddybook/src/components/Chain/SignChain.tsx +++ b/examples/buddybook/src/components/Chain/SignChain.tsx @@ -139,7 +139,7 @@ const SignChain: React.FC = ({ block, chainsData, onSuccess }) =

{block.title}

{block.description}

- + {error &&

{error}

} diff --git a/examples/buddybook/src/components/Chain/View/ChainList.tsx b/examples/buddybook/src/components/Chain/View/ChainList.tsx index cf1bfca..cbdd84e 100644 --- a/examples/buddybook/src/components/Chain/View/ChainList.tsx +++ b/examples/buddybook/src/components/Chain/View/ChainList.tsx @@ -23,7 +23,7 @@ const ChainList: React.FC = ({ chainsData, onChainUpdate, isLoad const childBlocks = chainsData.filter(b => b.parentBlockUUID === block.blockUUID); const totalSignatures = block.signatures.length + childBlocks.reduce((acc, child) => acc + child.signatures.length, 0); - const shareUrl = `${window.location.origin}/sign/${block.chainUUID}/${block.blockUUID}`; + const shareUrl = `${window.location.origin}/sign/${block.chainUUID ?? block.blockUUID}/${block.blockUUID}`; return (
  • @@ -66,7 +66,16 @@ const ChainList: React.FC = ({ chainsData, onChainUpdate, isLoad Share this chain with others to collect their signatures. - +
    + +

    {shareUrl}

    + +
    diff --git a/examples/buddybook/src/components/QRCode.tsx b/examples/buddybook/src/components/QRCode.tsx index f25f948..3184d4e 100644 --- a/examples/buddybook/src/components/QRCode.tsx +++ b/examples/buddybook/src/components/QRCode.tsx @@ -4,29 +4,27 @@ import { Button } from "@/components/ui/button"; import { Check, Copy } from "lucide-react"; interface QRCodeProps { - data?: any; - text?: string; + text: string; width?: number; height?: number; } -const QRCode: React.FC = ({ data, text, width = 256, height = 256 }) => { +const QRCode: React.FC = ({ text, width = 256, height = 256 }) => { const [copied, setCopied] = useState(false); - const shareUrl = text || (data ? `${window.location.origin}/sign/${data.chainUUID}/${data.blockUUID}` : ''); const handleCopy = async () => { - await navigator.clipboard.writeText(shareUrl); + await navigator.clipboard.writeText(text); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return (
    - +