Skip to content

Commit 39ee50e

Browse files
authored
fix: mf-6576 share text for Solana redpacket (#12053)
* fix: mf-6576 share text for Solana redpacket * fix: mf-6571 adjust ui in redpacket history * fix: run codegen --------- Co-authored-by: swkatmask <[email protected]>
1 parent 343f4b8 commit 39ee50e

File tree

12 files changed

+248
-59
lines changed

12 files changed

+248
-59
lines changed

packages/plugins/RedPacket/src/SiteAdaptor/SolanaRedPacket/SolanaRedPacketCard.tsx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export const SolanaRedPacketCard = memo(function SolanaRedPacketCard({
9494
const source = usePostInfoDetails.source()
9595
const platform = source?.toLowerCase()
9696
const postUrl = usePostInfoDetails.url()
97-
const handle = usePostInfoDetails.handle()
9897
const link = postLink.toString() || postUrl?.toString()
9998

10099
// TODO payload.chainId is undefined on production mode
@@ -105,32 +104,24 @@ export const SolanaRedPacketCard = memo(function SolanaRedPacketCard({
105104
const promote_short = _(msg`🧧🧧🧧 Try sending Lucky Drop to your friends with Mask.io.`)
106105
const isOnTwitter = Sniffings.is_twitter_page
107106
const isOnFacebook = Sniffings.is_facebook_page
108-
const shareTextOption = {
109-
sender: payload.sender.name.replace(/^@/, ''),
110-
payload: link!,
111-
network: network?.name ?? 'Mainnet',
112-
account: isOnTwitter ? 'realMaskNetwork' : 'masknetwork',
113-
interpolation: { escapeValue: false },
114-
}
107+
const sender = payload.sender.name.replace(/^@/, '')
108+
const account = isOnTwitter ? 'realMaskNetwork' : 'masknetwork'
109+
115110
if (hasClaimed) {
116-
const claimed = _(
117-
msg`I just claimed a lucky drop from @${shareTextOption.sender} on ${shareTextOption.network} network.`,
118-
)
111+
const claimed = _(msg`I just claimed a lucky drop from @${sender} on Solana`)
119112
return isOnTwitter || isOnFacebook ?
120-
_(msg`${claimed} Follow @${shareTextOption.account} (mask.io) to claim lucky drops.`) +
121-
`\n${promote_short}\n#mask_io #LuckyDrop\n${shareTextOption.payload}`
122-
: `${claimed}\n${promote_short}\n${shareTextOption.payload}`
113+
_(msg`${claimed} Follow @${account} (mask.io) to claim lucky drops.`) +
114+
`\n${promote_short}\n#mask_io #LuckyDrop\n${link}`
115+
: `${claimed}\n${promote_short}\n${link}`
123116
}
124-
const head = _(
125-
msg`Hi friends, I just found a lucky drop sent by @${shareTextOption.sender} on ${shareTextOption.network} network.`,
126-
)
117+
const head = _(msg`Hi friends, I just found a lucky drop sent by @${sender} on Solana.`)
127118

128119
return isOnTwitter || isOnFacebook ?
129-
_(msg`${head} Follow @${shareTextOption.account} (mask.io) to claim lucky drops.`) +
130-
`\n${promote_short}\n#mask_io #LuckyDrop\n${shareTextOption.payload}`
131-
: `${head}\n${promote_short}\n${shareTextOption.payload}`
120+
_(msg`${head} Follow @${account} (mask.io) to claim lucky drops.`) +
121+
`\n${promote_short}\n#mask_io #LuckyDrop\n${link}`
122+
: `${head}\n${promote_short}\n${link}`
132123
},
133-
[payload, link, claimTxHash, network?.name, platform, handle, _],
124+
[payload, link, claimTxHash, network?.name, platform, _],
134125
)
135126
const claimedShareText = useMemo(() => getShareText(true), [getShareText])
136127

packages/plugins/RedPacket/src/SiteAdaptor/components/RedPacketRecord.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ const useStyles = makeStyles<{ background?: string; backgroundIcon?: string }>()
9393
color: theme.palette.maskColor.main,
9494
},
9595
},
96+
symbol: {
97+
width: '6ch',
98+
whiteSpace: 'nowrap',
99+
overflow: 'hidden',
100+
textOverflow: 'ellipsis',
101+
},
96102
message: {
97103
fontWeight: 700,
98104
lineHeight: '18px',
@@ -269,7 +275,9 @@ export const RedPacketRecord = memo(function RedPacketRecord({
269275
{formatTokenAmount(claim_amounts || 0, token_decimal, false)}/
270276
{formatTokenAmount(total_amounts || 0, token_decimal, false)}
271277
</b>
272-
<span>{tokenSymbol}</span>
278+
<TextOverflowTooltip title={token_symbol} as={ShadowRootTooltip}>
279+
<span className={classes.symbol}>{tokenSymbol}</span>
280+
</TextOverflowTooltip>
273281
</Trans>
274282
: null}
275283
{showDetailLink ?
@@ -285,13 +293,13 @@ export const RedPacketRecord = memo(function RedPacketRecord({
285293
{ state: { history } },
286294
)
287295
}}>
288-
<Trans>Claimed Details</Trans>
296+
<Trans>Details</Trans>
289297
</Typography>
290298
: null}
291299
</Typography>
292300
</div>
293301
</div>
294-
<TextOverflowTooltip title={rp_msg ? rp_msg : <Trans>Best Wishes!</Trans>} as={ShadowRootTooltip}>
302+
<TextOverflowTooltip title={rp_msg || <Trans>Best Wishes!</Trans>} as={ShadowRootTooltip}>
295303
<Typography className={classes.message}>{rp_msg ? rp_msg : <Trans>Best Wishes!</Trans>}</Typography>
296304
</TextOverflowTooltip>
297305
</div>

packages/plugins/RedPacket/src/locale/en-US.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/en-US.po

Lines changed: 27 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/ja-JP.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/ja-JP.po

Lines changed: 27 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)