Skip to content

Commit 9c38e67

Browse files
techgangbossclaude
andcommitted
feat: use speed OG card for swaps <= 4.1s, generic OG for slower
The branded speed card (Clonoid font, designer background) only shows for fast swaps. Slower swaps link to the main site which uses the generic Fast Protocol OG image. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b00f03f commit 9c38e67

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/swap/SwapToast.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,11 @@ export function SwapToast({ hash }: { hash: string }) {
465465

466466
const variants = secs < 1 ? fast : secs < 4 ? mid : slow
467467
const text = variants[Math.floor(Math.random() * variants.length)]
468-
// Twitter needs a URL in the tweet to render the OG card
469-
const shareUrl = `${window.location.origin}/share/preconfirm?time=${elapsedSec}`
468+
// Speed OG card for fast swaps, generic for slower ones
469+
const shareUrl =
470+
secs <= 4.1
471+
? `${window.location.origin}/share/preconfirm?time=${elapsedSec}`
472+
: `${window.location.origin}`
470473
window.open(
471474
`https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}&url=${encodeURIComponent(shareUrl)}`,
472475
"_blank"

0 commit comments

Comments
 (0)