Commit 5257188f authored by Kaylee George's avatar Kaylee George Committed by GitHub

fix: fix token details 'share to twitter' information (#4469)

add twitter correct link
parent 75992399
...@@ -62,6 +62,7 @@ const ShareAction = styled.div` ...@@ -62,6 +62,7 @@ const ShareAction = styled.div`
interface TokenInfo { interface TokenInfo {
tokenName: string tokenName: string
tokenSymbol: string tokenSymbol: string
tokenAddress: string
} }
export default function ShareButton(tokenInfo: TokenInfo) { export default function ShareButton(tokenInfo: TokenInfo) {
...@@ -76,7 +77,7 @@ export default function ShareButton(tokenInfo: TokenInfo) { ...@@ -76,7 +77,7 @@ export default function ShareButton(tokenInfo: TokenInfo) {
const shareTweet = () => { const shareTweet = () => {
toggleShare() toggleShare()
window.open( window.open(
`https://twitter.com/intent/tweet?text=Check%20out%20${tokenInfo.tokenName}%20(${tokenInfo.tokenSymbol})%20https://app.uniswap.org/%23/tokens/${tokenInfo.tokenSymbol}%20via%20@uniswap`, `https://twitter.com/intent/tweet?text=Check%20out%20${tokenInfo.tokenName}%20(${tokenInfo.tokenSymbol})%20https://app.uniswap.org/%23/tokens/${tokenInfo.tokenAddress}%20via%20@uniswap`,
'newwindow', 'newwindow',
`left=${positionX}, top=${positionY}, width=${TWITTER_WIDTH}, height=${TWITTER_HEIGHT}` `left=${positionX}, top=${positionY}, width=${TWITTER_WIDTH}, height=${TWITTER_HEIGHT}`
) )
......
...@@ -363,7 +363,9 @@ export default function LoadedTokenDetail({ address }: { address: string }) { ...@@ -363,7 +363,9 @@ export default function LoadedTokenDetail({ address }: { address: string }) {
)} )}
</TokenNameCell> </TokenNameCell>
<TokenActions> <TokenActions>
{tokenName && tokenSymbol && <ShareButton tokenName={tokenName} tokenSymbol={tokenSymbol} />} {tokenName && tokenSymbol && (
<ShareButton tokenName={tokenName} tokenSymbol={tokenSymbol} tokenAddress={address} />
)}
<ClickFavorited onClick={toggleFavorite}> <ClickFavorited onClick={toggleFavorite}>
<FavoriteIcon isFavorited={isFavorited} /> <FavoriteIcon isFavorited={isFavorited} />
</ClickFavorited> </ClickFavorited>
......
...@@ -86,7 +86,7 @@ export default function TokenDetails() { ...@@ -86,7 +86,7 @@ export default function TokenDetails() {
let tokenDetail let tokenDetail
if (!tokenAddress) { if (!tokenAddress) {
// TODO: handle no address / invalid address cases // TODO: handle no address / invalid address cases
tokenDetail = 'invalid token' tokenDetail = 'invalid token address'
} else if (loading) { } else if (loading) {
tokenDetail = <LoadingTokenDetail /> tokenDetail = <LoadingTokenDetail />
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment