mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-04-21 23:37:55 +00:00
fix: use wallet address in citizenship referral link
Replace ref_telegramId with SS58 wallet address in referral link. Share message now includes invitation text, auto-fill link, and wallet address for manual paste in the referrer field.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pezkuwi-telegram-miniapp",
|
||||
"version": "1.0.227",
|
||||
"version": "1.0.229",
|
||||
"type": "module",
|
||||
"description": "Pezkuwichain Telegram Mini App - Forum, Announcements, Rewards",
|
||||
"author": "Pezkuwichain Team",
|
||||
|
||||
@@ -100,7 +100,8 @@ const ar: Translations = {
|
||||
youAreActive: 'أنت نشط!',
|
||||
iAmActive: 'أنا نشط!',
|
||||
activatedAlert: 'أنت الآن نشط! انقر مجددًا بعد 24 ساعة.',
|
||||
shareText: 'Pezkuwichain - الدولة الرقمية لكردستان! انضم إلينا عبر رابطي:',
|
||||
shareText: 'صديقي العزيز، كردستان الرقمية تأسست، خذ مكانك!',
|
||||
referralInstruction: 'الصق هذا العنوان في حقل الإحالة:',
|
||||
copyAlert: 'تم النسخ',
|
||||
referralCount: '{count} إحالة (معتمدة KYC)',
|
||||
noReferrals: 'ليس لديك إحالات بعد',
|
||||
|
||||
@@ -101,7 +101,8 @@ const ckb: Translations = {
|
||||
youAreActive: 'تۆ چالاکیت!',
|
||||
iAmActive: 'من چالاکم!',
|
||||
activatedAlert: 'ئێستا چالاکیت! دوای ٢٤ کاتژمێر دووبارە کلیک بکە.',
|
||||
shareText: 'پێزکوێچەین - دەوڵەتی دیجیتاڵی کوردستان! لە ڕێگەی لینکەکەمەوە پەیوەستمان ببە:',
|
||||
shareText: 'هاوڕێی خۆشەویستم، کوردستانی دیجیتاڵ دامەزرا، تۆش شوێنی خۆت بگرە!',
|
||||
referralInstruction: 'ئەم ناونیشانە لە بەشی ڕیفێراڵ بلکێنە:',
|
||||
copyAlert: 'لەبەرگیرا',
|
||||
referralCount: '{count} بانگهێشتکراو (KYC پەسەندکراو)',
|
||||
noReferrals: 'هێشتا هیچ بانگهێشتکراوێکت نییە',
|
||||
|
||||
@@ -100,7 +100,8 @@ const en: Translations = {
|
||||
youAreActive: 'You are Active!',
|
||||
iAmActive: 'I am Active!',
|
||||
activatedAlert: 'You are now active! Click again after 24 hours.',
|
||||
shareText: 'Pezkuwichain - Digital State of Kurdistan! Join us through my link:',
|
||||
shareText: 'Dear friend, Digital Kurdistan has been established, take your place!',
|
||||
referralInstruction: 'Paste this address in the referral field:',
|
||||
copyAlert: 'Copied',
|
||||
referralCount: '{count} referrals (KYC approved)',
|
||||
noReferrals: 'You have no referrals yet',
|
||||
|
||||
@@ -100,7 +100,8 @@ const fa: Translations = {
|
||||
youAreActive: 'شما فعال هستید!',
|
||||
iAmActive: 'من فعال هستم!',
|
||||
activatedAlert: 'شما اکنون فعال هستید! پس از ۲۴ ساعت دوباره کلیک کنید.',
|
||||
shareText: 'Pezkuwichain - دولت دیجیتال کردستان! از طریق لینک من بپیوندید:',
|
||||
shareText: 'دوست عزیزم، کردستان دیجیتال تأسیس شد، جایگاهت را بگیر!',
|
||||
referralInstruction: 'این آدرس را در قسمت ارجاع بچسبانید:',
|
||||
copyAlert: 'کپی شد',
|
||||
referralCount: '{count} دعوت (KYC تأیید شده)',
|
||||
noReferrals: 'شما هنوز دعوتی ندارید',
|
||||
|
||||
@@ -104,7 +104,8 @@ const krd: Translations = {
|
||||
iAmActive: 'Ez Akt\u00eev im!',
|
||||
activatedAlert: 'Tu niha akt\u00eev \u00ee! 24 saet pa\u015f\u00ea d\u00eesa bikirt\u00eene.',
|
||||
shareText:
|
||||
'Pezkuwichain - Dewleta D\u00eej\u00eetal a Kurd! Bi l\u00eenka min ve tev li me bibe:',
|
||||
'Heval\u00ea min \u00ea h\u00eaja, Kurdistan\u00ea D\u00eej\u00eetal hat ava kirin, tu j\u00ee c\u00eeh\u00ea xwe bigire!',
|
||||
referralInstruction: 'V\u00ea navnî\u015fan\u00ea li beşa referral\u00ea bileq\u00eene:',
|
||||
copyAlert: 'Kop\u00ee b\u00fb',
|
||||
referralCount: '{count} referral (KYC pejirand\u00ee)',
|
||||
noReferrals: 'H\u00eaj referral\u00ean te tune ne',
|
||||
|
||||
@@ -100,7 +100,8 @@ const tr: Translations = {
|
||||
youAreActive: 'Aktifsiniz!',
|
||||
iAmActive: 'Aktifim!',
|
||||
activatedAlert: 'Artık aktifsiniz! 24 saat sonra tekrar tıklayın.',
|
||||
shareText: 'Pezkuwichain - Kürdistan Dijital Devleti! Bağlantımdan bize katılın:',
|
||||
shareText: 'Sevgili dostum, Dijital Kurdistan kuruldu, sen de yerini al!',
|
||||
referralInstruction: 'Referral kısmına bu adresi yapıştır:',
|
||||
copyAlert: 'Kopyalandı',
|
||||
referralCount: '{count} davet (KYC onaylı)',
|
||||
noReferrals: 'Henüz davetiniz yok',
|
||||
|
||||
@@ -103,6 +103,7 @@ export interface Translations {
|
||||
iAmActive: string;
|
||||
activatedAlert: string;
|
||||
shareText: string;
|
||||
referralInstruction: string;
|
||||
copyAlert: string;
|
||||
referralCount: string;
|
||||
noReferrals: string;
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
} from 'lucide-react';
|
||||
import { cn, formatAddress } from '@/lib/utils';
|
||||
import { useTelegram } from '@/hooks/useTelegram';
|
||||
import { useAuth } from '@/contexts/AuthContext';
|
||||
|
||||
import { useReferral } from '@/contexts/ReferralContext';
|
||||
import { useWallet } from '@/contexts/WalletContext';
|
||||
import { SocialLinks } from '@/components/SocialLinks';
|
||||
@@ -72,7 +72,7 @@ const ACTIVITY_DURATION_MS = 24 * 60 * 60 * 1000; // 24 hours
|
||||
|
||||
export function RewardsSection() {
|
||||
const { hapticImpact, hapticNotification, shareUrl, showAlert } = useTelegram();
|
||||
const { user: authUser } = useAuth();
|
||||
|
||||
const { stats, myReferrals, loading, refreshStats } = useReferral();
|
||||
const { isConnected, address, peopleApi, assetHubApi, keypair } = useWallet();
|
||||
const { t } = useTranslation();
|
||||
@@ -358,14 +358,19 @@ export function RewardsSection() {
|
||||
showAlert(t('rewards.activatedAlert'));
|
||||
};
|
||||
|
||||
// Telegram referral link (for sharing) - use authenticated user ID
|
||||
const referralLink = authUser?.telegram_id
|
||||
? `https://t.me/pezkuwichainBot?start=ref_${authUser.telegram_id}`
|
||||
// Citizenship referral link - wallet address in start param for auto-fill
|
||||
const referralLink = address
|
||||
? `https://t.me/pezkuwichainBot?start=${address}`
|
||||
: 'https://t.me/pezkuwichainBot';
|
||||
|
||||
// Full share message: invitation text + link + wallet address for manual paste
|
||||
const shareMessage = address
|
||||
? `${t('rewards.shareText')}\n${referralLink}\n\n${t('rewards.referralInstruction')}\n${address}`
|
||||
: `${t('rewards.shareText')}\n${referralLink}`;
|
||||
|
||||
const handleCopy = async () => {
|
||||
try {
|
||||
await window.navigator.clipboard.writeText(referralLink);
|
||||
await window.navigator.clipboard.writeText(shareMessage);
|
||||
setCopied(true);
|
||||
hapticNotification('success');
|
||||
setTimeout(() => setCopied(false), 2000);
|
||||
@@ -376,7 +381,12 @@ export function RewardsSection() {
|
||||
|
||||
const handleShare = () => {
|
||||
hapticImpact('medium');
|
||||
shareUrl(referralLink, t('rewards.shareText'));
|
||||
shareUrl(
|
||||
referralLink,
|
||||
address
|
||||
? `${t('rewards.shareText')}\n\n${t('rewards.referralInstruction')}\n${address}`
|
||||
: t('rewards.shareText')
|
||||
);
|
||||
};
|
||||
|
||||
const handleRefresh = () => {
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.0.227",
|
||||
"buildTime": "2026-02-27T23:03:36.173Z",
|
||||
"buildNumber": 1772233416174
|
||||
"version": "1.0.229",
|
||||
"buildTime": "2026-02-27T23:33:39.279Z",
|
||||
"buildNumber": 1772235219280
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user