diff --git a/app2/src/lib/transfer/normal/steps/IndexStep.svelte b/app2/src/lib/transfer/normal/steps/IndexStep.svelte index cefe76244a..d79b0c9776 100644 --- a/app2/src/lib/transfer/normal/steps/IndexStep.svelte +++ b/app2/src/lib/transfer/normal/steps/IndexStep.svelte @@ -8,6 +8,7 @@ import TransactionHashComponent from "$lib/components/model/TransactionHashCompo import ErrorComponent from "$lib/components/model/ErrorComponent.svelte" import SpinnerIcon from "$lib/components/icons/SpinnerIcon.svelte" import type { WaitForIndex } from "$lib/transfer/normal/steps/steps.ts" +import TwitterIcon from "$lib/components/icons/TwitterIcon.svelte" type Props = { newTransfer: () => void @@ -31,6 +32,18 @@ const handleRedirect = () => { transferHashStore.reset() } } + +const handleTweet = () => { + const packet = Option.isSome(transferHashStore.data) ? transferHashStore.data.value : "" + const transferUrl = `https://app.union.build/explorer/transfers${packet ? `/${packet}` : ""}` + + const tweets = [ + `Zkgm frens 🤠Just bridged using ${transferUrl} — smooth like butter on hot cornbread. Yeehaw!\n\nHop on the BTCfi wagon. Bridge your assets with @union_build, stack Union points, and ride into the future of trustless interoperability.` + ] + + const tweetText = encodeURIComponent(tweets[Math.floor(Math.random() * tweets.length)]) + window.open(`https://twitter.com/intent/tweet?text=${tweetText}`, "_blank") +}