diff --git a/src/App.tsx b/src/App.tsx index f57f2453b..9176261ce 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,6 +15,7 @@ import './styles/mobile-optimizations.scss'; import { AppHeader } from './components/layout/app-header'; import { useSuperheroChainNames } from './hooks/useChainName'; import FeedbackButton from './components/FeedbackButton'; +import { parseXInviteCodeFromWindow, storeXInviteCode } from './utils/xInvite'; const CookiesDialog = React.lazy( () => import('./components/modals/CookiesDialog'), @@ -84,6 +85,13 @@ const App = () => { }; }, [activeAccount]); + useEffect(() => { + const parsedCode = parseXInviteCodeFromWindow(); + if (parsedCode) { + storeXInviteCode(parsedCode); + } + }, []); + return (
{t('messages.connectXHint')}
@@ -553,6 +569,10 @@ const ProfileEditModal = ({ if (!targetAddr) return; setConnectingX(true); try { + const ready = await reconnectWalletSession(targetAddr); + if (!ready) { + throw new Error('Wallet session is not ready. Please connect wallet and try again.'); + } const redirectUri = getXCallbackRedirectUri(); const state = generateOAuthState(); const codeVerifier = generateCodeVerifier(); diff --git a/src/features/trending/components/Invitation/CollectRewardsCard.tsx b/src/features/trending/components/Invitation/CollectRewardsCard.tsx index abb1c5de0..3e204a668 100644 --- a/src/features/trending/components/Invitation/CollectRewardsCard.tsx +++ b/src/features/trending/components/Invitation/CollectRewardsCard.tsx @@ -259,27 +259,28 @@ const CollectRewardsCard = () => { } if (!thresholdReached) return 'Not eligible yet'; if (accumulatedRewardsAe.lte(Decimal.ZERO)) return 'No rewards yet'; - return 'Collect rewards'; + return 'Collect affiliate rewards'; }, [collectingReward, thresholdReached, accumulatedRewardsAe]); return ( -- Rewards accumulate as your direct invitees participate in token sales. You can withdraw once + Affiliate rewards accumulate as your direct invitees participate in trading. + You can withdraw once {' '} {MIN_INVITEES} @@ -290,12 +291,13 @@ const CollectRewardsCard = () => { have each spent at least + {' '} {MIN_SPENT_AE} {' '} AE {' '} - (cumulative). + (cumulative). Affiliate payout rate is 0.5%.
Note: eligibility and rewards depend on on-chain activity and are not guaranteed. @@ -396,7 +398,7 @@ const CollectRewardsCard = () => { type="button" onClick={onCollectReward} disabled={collectingReward || !isEligibleForRewards} - className={`w-full p-4 md:p-5 lg:p-6 text-sm md:text-base font-bold uppercase tracking-wider break-words whitespace-normal min-h-12 rounded-xl transition-all duration-300 ${isEligibleForRewards + className={`w-full p-3 md:p-3.5 text-xs md:text-sm font-semibold uppercase tracking-wide break-words whitespace-normal min-h-10 rounded-xl transition-all duration-300 ${isEligibleForRewards ? 'bg-gradient-to-r from-pink-500 to-purple-500 text-white shadow-lg shadow-pink-500/30 hover:-translate-y-0.5 hover:shadow-xl hover:shadow-pink-500/40' : 'opacity-50 cursor-not-allowed bg-gray-600 transform-none' }`} diff --git a/src/features/trending/components/Invitation/InvitationList.tsx b/src/features/trending/components/Invitation/InvitationList.tsx index 1f0b828f5..e31a49fac 100644 --- a/src/features/trending/components/Invitation/InvitationList.tsx +++ b/src/features/trending/components/Invitation/InvitationList.tsx @@ -158,7 +158,7 @@ const InvitationList = () => { return (
- Create invite links by funding a one-time AE reward per invite. Each + Create affiliate links by funding a one-time AE reward per invite. Each link contains a secret code; when someone opens the link and claims it, they receive the funded reward and the invitation is marked as used.
You can generate multiple links at once and share them with friends - or your community. You can also revoke an invite before it’s claimed. + or your community. You can also revoke an affiliate invite before it’s claimed.
Important: save your links before closing the popup. The secret code @@ -155,7 +155,7 @@ const InviteAndEarnCard = ({ {/* Form - Right Side */}