Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Merits dashboard #2456

Merged
merged 10 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change text for sharing on x
  • Loading branch information
maxaleks committed Dec 10, 2024
commit 166b68e994b28441b1afde537cfc19d915db7e06
8 changes: 6 additions & 2 deletions ui/pages/RewardsDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import DailyRewardClaimButton from 'ui/rewards/dashboard/DailyRewardClaimButton'
import RewardsDashboardCard from 'ui/rewards/dashboard/RewardsDashboardCard';
import RewardsDashboardCardValue from 'ui/rewards/dashboard/RewardsDashboardCardValue';
import RewardsReadOnlyInputWithCopy from 'ui/rewards/RewardsReadOnlyInputWithCopy';
import useShareTextForStreak from 'ui/rewards/useShareTextForStreak';
import LinkExternal from 'ui/shared/links/LinkExternal';
import PageTitle from 'ui/shared/Page/PageTitle';
import useRedirectForInvalidAuthToken from 'ui/snippets/auth/useRedirectForInvalidAuthToken';

const RewardsDashboard = () => {
const { balancesQuery, apiToken, referralsQuery, rewardsConfigQuery, dailyRewardQuery, isInitialized } = useRewardsContext();
const shareText = useShareTextForStreak();

const [ isError, setIsError ] = useState(false);

Expand All @@ -35,6 +33,12 @@ const RewardsDashboard = () => {
return null;
}

let shareText = `Claim your free @blockscoutcom #Merits and start building your daily streak today! #Blockscout #Merits #IYKYK\n\nBoost your rewards instantly by using my referral code: ${ referralsQuery.data?.link }`; // eslint-disable-line max-len
if (Number(dailyRewardQuery.data?.streak) > 0) {
const days = `day${ Number(dailyRewardQuery.data?.streak) === 1 ? '' : 's' }`;
shareText = `I${ apos }ve claimed Merits ${ dailyRewardQuery.data?.streak } ${ days } in a row!\n\n` + shareText;
}

return (
<>
<PageTitle
Expand Down
20 changes: 0 additions & 20 deletions ui/rewards/useShareTextForStreak.tsx

This file was deleted.