Commit 6547a4f3 authored by Max Alekseenko's avatar Max Alekseenko

fix number and replace ref link

parent e2f6f62c
...@@ -16,9 +16,11 @@ type Props = { ...@@ -16,9 +16,11 @@ type Props = {
const CongratsStepContent = ({ isReferral }: Props) => { const CongratsStepContent = ({ isReferral }: Props) => {
const { referralsQuery, rewardsConfigQuery } = useRewardsContext(); const { referralsQuery, rewardsConfigQuery } = useRewardsContext();
const registrationReward = rewardsConfigQuery.data?.rewards.registration; const registrationReward = rewardsConfigQuery.data?.rewards.registration || 0;
const referralReward = Number(rewardsConfigQuery.data?.rewards.registration_with_referral) - Number(rewardsConfigQuery.data?.rewards.registration); const registrationWithReferralReward = rewardsConfigQuery.data?.rewards.registration_with_referral || 0;
const refLink = `https://eth.blockscout.com?ref=${ referralsQuery.data?.code }`; const referralReward = Number(registrationWithReferralReward) - Number(registrationReward);
const refLink = referralsQuery.data?.link || '';
const shareText = `Just signed up for @blockscoutcom Merits program and got ${ registrationReward } merits!\n\nUse my referral link to get extra ${ referralReward } merits: ${ refLink }`; // eslint-disable-line max-len const shareText = `Just signed up for @blockscoutcom Merits program and got ${ registrationReward } merits!\n\nUse my referral link to get extra ${ referralReward } merits: ${ refLink }`; // eslint-disable-line max-len
const textColor = useColorModeValue('blue.700', 'blue.100'); const textColor = useColorModeValue('blue.700', 'blue.100');
......
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