forked from mito-systems/sol-mem-gen
Update tweet message
This commit is contained in:
parent
bce1719f7e
commit
af864b4670
@ -3,6 +3,7 @@
|
||||
import React, { useState } from 'react'
|
||||
import BN from 'bn.js';
|
||||
import Big from 'big.js';
|
||||
import dynamic from 'next/dynamic'
|
||||
|
||||
import TweetUrlForm from './TweetForm';
|
||||
|
||||
@ -93,23 +94,14 @@ const AIServiceCard: React.FC<AIServiceCardProps> = ({
|
||||
|
||||
const generateTwitterShareUrl = (imageUrl: string, transactionSignature: string): string => {
|
||||
const baseUrl = window.location.href;
|
||||
const ipfsImageUrl = imageUrl.split("/image/")[1];
|
||||
const memeUrl = `${baseUrl}memes/${ipfsImageUrl}`;
|
||||
const cid = imageUrl.split("/image/")[1];
|
||||
const memeUrl = `${baseUrl}memes/${cid}`;
|
||||
|
||||
return `https://twitter.com/intent/tweet?text=Check%20out%20this%20meme%20I%20generated!&url=${encodeURIComponent(memeUrl)}`;
|
||||
const tweetText = `Check out this meme that I generated! \n TX Hash: '${transactionSignature}' \n @${process.env.ACCOUNT_HANDLE} \n`;
|
||||
|
||||
return `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(memeUrl)}`;
|
||||
};
|
||||
|
||||
// const generateTwitterShareUrl = (imageUrl: string, transactionSignature: string): string => {
|
||||
// const baseUrl = window.location.href;
|
||||
// const ipfsImageUrl = imageUrl.split("/ipfs/")[1];
|
||||
// const memeUrl = `${baseUrl}/memes/${ipfsImageUrl}`;
|
||||
|
||||
// // Ensure the entire tweet text is properly URL-encoded
|
||||
// const tweetText = `Check out this meme that I generated! TX Hash: ${transactionSignature} @mark_2_market1`;
|
||||
|
||||
// return `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(memeUrl)}`;
|
||||
// };
|
||||
|
||||
return (
|
||||
<div className="w-full bg-gray-800/50 backdrop-blur-lg rounded-2xl shadow-xl border border-gray-700/50 mb-8">
|
||||
<div className="p-6">
|
||||
@ -177,4 +169,6 @@ const AIServiceCard: React.FC<AIServiceCardProps> = ({
|
||||
)
|
||||
}
|
||||
|
||||
export default AIServiceCard
|
||||
export default dynamic(() => Promise.resolve(AIServiceCard), {
|
||||
ssr: false
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user