From 9612b7817fdc2ca9165723c3bf4a3a01bcff2fda Mon Sep 17 00:00:00 2001 From: "Hong Jing (Jingles)" Date: Mon, 11 Nov 2024 13:33:57 +0800 Subject: [PATCH] attempt fix og title --- .../src/components/site/metatags.tsx | 16 ++-- apps/playground/src/pages/_app.tsx | 2 - apps/playground/src/pages/about/index.tsx | 2 + apps/playground/src/pages/home/index.tsx | 85 ++++++++++--------- packages/mesh-provider/src/blockfrost.ts | 10 --- 5 files changed, 56 insertions(+), 59 deletions(-) diff --git a/apps/playground/src/components/site/metatags.tsx b/apps/playground/src/components/site/metatags.tsx index 9bfb2de3..c5270fe8 100644 --- a/apps/playground/src/components/site/metatags.tsx +++ b/apps/playground/src/components/site/metatags.tsx @@ -15,14 +15,14 @@ export default function Metatags({ description = "Intuitive and easy-to-use Web3 development framework to build amazing applications on Cardano."; } + if (keywords === undefined) { keywords = "developer, tools, cardano, blockchain, sdk, plutus, crypto, web3, metaverse, gaming, ecommerce, nfts, apis, aiken"; } - let _title = title; if (title === undefined) { - _title = "Mesh JS - Cardano Web3 TypeScript SDK & Off-Chain Framework"; + title = "Mesh JS - Cardano Web3 TypeScript SDK & Off-Chain Framework"; } else { title = title + " - Mesh JS"; } @@ -32,12 +32,12 @@ export default function Metatags({ - {title ? title : _title} + {title && {title}} - - + {title && } + {title && } {image && ( @@ -49,11 +49,11 @@ export default function Metatags({ content={`https://meshjs.dev/api/og?title=${title}`} /> )} - + {title && } - + {title && } {image && ( @@ -65,7 +65,7 @@ export default function Metatags({ content={`https://meshjs.dev/api/og?title=${title}`} /> )} - + {title && } -
diff --git a/apps/playground/src/pages/about/index.tsx b/apps/playground/src/pages/about/index.tsx index 580c41c8..c0d2c690 100644 --- a/apps/playground/src/pages/about/index.tsx +++ b/apps/playground/src/pages/about/index.tsx @@ -1,3 +1,4 @@ +import Metatags from "~/components/site/metatags"; import AboutHero from "./about-us/hero"; import AboutIncorporation from "./about-us/incorporation"; import AboutMeeting from "./about-us/meeting"; @@ -8,6 +9,7 @@ import AboutWhatWorkingOn from "./about-us/what-working-on"; export default function AboutPage() { return ( <> + diff --git a/apps/playground/src/pages/home/index.tsx b/apps/playground/src/pages/home/index.tsx index 9628ba66..826378b2 100644 --- a/apps/playground/src/pages/home/index.tsx +++ b/apps/playground/src/pages/home/index.tsx @@ -3,6 +3,7 @@ import { DocumentCheckIcon } from "@heroicons/react/24/solid"; import Link from "~/components/link"; import HeroTwoSections from "~/components/sections/hero-two-sections"; +import Metatags from "~/components/site/metatags"; export default function HomePage() { const [isSSR, setIsSSR] = useState(true); @@ -11,44 +12,50 @@ export default function HomePage() { }, []); return ( -
- - {!isSSR ? ( - - ) : ( - <> - mockup - mockup dark - - )} -
- } - children={ - - Catalyst Proposals - - - } - /> -
+ <> + +
+ + {!isSSR ? ( + + ) : ( + <> + mockup + mockup dark + + )} +
+ } + children={ + + Catalyst Proposals + + + } + /> + + ); } diff --git a/packages/mesh-provider/src/blockfrost.ts b/packages/mesh-provider/src/blockfrost.ts index 15f50ab8..2a662109 100644 --- a/packages/mesh-provider/src/blockfrost.ts +++ b/packages/mesh-provider/src/blockfrost.ts @@ -473,16 +473,6 @@ export class BlockfrostProvider } } - async fetchUTxO(hash: string, index?: number): Promise { - try { - const utxos = await this.fetchUTxOs(hash); - const utxo = utxos.find((utxo) => utxo.input.outputIndex === index); - return utxo; - } catch (error) { - throw parseHttpError(error); - } - } - async fetchUTxOs(hash: string, index?: number): Promise { try { const { data, status } = await this._axiosInstance.get(