mac
6 months ago
8 changed files with 107 additions and 19 deletions
-
1env.md
-
19public/index.html
-
BINpublic/qrcode.png
-
6src/contract/index.ts
-
2src/language/hk.json
-
9src/pages/invitation/index.tsx
-
5src/router/layout/index.tsx
-
64src/utils/share.ts
After Width: 1200 | Height: 600 | Size: 18 KiB |
@ -0,0 +1,64 @@ |
|||||
|
export type LanguageType = 'en' | 'zh' | 'hk' |
||||
|
|
||||
|
export const shareTG = async (language: LanguageType, address: string) => { |
||||
|
const text = shareText(language, address) |
||||
|
const url = process.env.REACT_APP_SHARE_URL as string |
||||
|
|
||||
|
const tg = `https://t.me/share/url?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}` |
||||
|
window.open(tg) |
||||
|
} |
||||
|
|
||||
|
export const shareTW = async (language: LanguageType, address: string) => { |
||||
|
const text = shareText(language, address) |
||||
|
const url = process.env.REACT_APP_SHARE_URL as string |
||||
|
const tw = `https://twitter.com/intent/tweet?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}` |
||||
|
window.open(tw) |
||||
|
} |
||||
|
|
||||
|
export const shareLK = async (language: LanguageType, address: string) => { |
||||
|
const text = shareText(language, address) |
||||
|
const url = process.env.REACT_APP_SHARE_URL as string |
||||
|
const linkedinShareUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`; |
||||
|
window.open(linkedinShareUrl) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
const shareText = (language: LanguageType, address: string) => { |
||||
|
const ts = { |
||||
|
'en': `
|
||||
|
Join me to stake $FIL on SOFIL with my referral code to earn up to 16.23% APY ! |
||||
|
SOFIL is a DeFi platform offering stake-to-earn opportunities to crypto holders. |
||||
|
|
||||
|
My referral code: ${address} |
||||
|
You can insert my referral code before you stake. |
||||
|
|
||||
|
Come and explore more with me on SOFIL by scanning the following QR code or directly visit app.sofil.io on your MetaMask |
||||
|
|
||||
|
SOFIL Official Website: https://sofil.io
|
||||
|
`,
|
||||
|
|
||||
|
'hk': |
||||
|
`
|
||||
|
使用我的推薦碼在 SOFIL 上質押 $FIL,即可賺取高達 16.23% 年利率!\n |
||||
|
SOFIL 是一個去中心金融平台,為加密貨幣持有者提供質押賺取的機會。\n |
||||
|
我的推薦碼:${address} \n |
||||
|
您可以在質押前輸入我的推薦碼。\n |
||||
|
掃描以下二維碼或直接在 MetaMask 上瀏覽 app.sofil.io,與我一起探索 SOFIL 的更多內容!\n |
||||
|
SOFIL官方網站:https://sofil.io
|
||||
|
`,
|
||||
|
|
||||
|
'zh': `
|
||||
|
使用我的推荐码在 SOFIL 上质押 $FIL,即可赚取高达 16.23% 年利率! |
||||
|
SOFIL 是一个去中心金融平台,为加密货币持有者提供质押赚取的机会。 |
||||
|
|
||||
|
我的推荐码:${address} |
||||
|
您可以在质押前输入我的推荐码。 |
||||
|
|
||||
|
扫描以下二维码或直接在 MetaMask 上浏览 app.sofil.io,与我一起探索 SOFIL 的更多内容! |
||||
|
|
||||
|
SOFIL官方网站:https://sofil.io
|
||||
|
`
|
||||
|
} as { [key: string]: string } |
||||
|
return ts[language] |
||||
|
} |
||||
|
// https://t.me/share/url?url=https://baidu.com&text=sdasdasdasdasd\nasdkahdkashdkajshd
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue