Commit d4d9aa7b authored by tom's avatar tom

Merge branch 'main' of github.com:blockscout/frontend into release/v2-0-0

parents a00010bc 69e5efd3
...@@ -26,7 +26,7 @@ testWithAuth.beforeEach(async({ mockEnvs, mockApiResponse }) => { ...@@ -26,7 +26,7 @@ testWithAuth.beforeEach(async({ mockEnvs, mockApiResponse }) => {
await mockApiResponse('user_info', profileMock.withEmailAndWallet); await mockApiResponse('user_info', profileMock.withEmailAndWallet);
}); });
const testTab = (tab: 'tasks' | 'referrals' | 'resources') => const testTab = (tab: 'activity' | 'referrals' | 'resources') =>
testWithAuth(`${ tab } tab +@dark-mode +@mobile`, async({ page, render, mockApiResponse }, testInfo) => { testWithAuth(`${ tab } tab +@dark-mode +@mobile`, async({ page, render, mockApiResponse }, testInfo) => {
await mockApiResponse('rewards_user_balances', rewardsBalanceMock.base); await mockApiResponse('rewards_user_balances', rewardsBalanceMock.base);
await mockApiResponse('rewards_user_daily_check', dailyRewardMock.base); await mockApiResponse('rewards_user_daily_check', dailyRewardMock.base);
...@@ -42,7 +42,7 @@ const testTab = (tab: 'tasks' | 'referrals' | 'resources') => ...@@ -42,7 +42,7 @@ const testTab = (tab: 'tasks' | 'referrals' | 'resources') =>
}); });
}); });
testTab('tasks'); testTab('activity');
testTab('referrals'); testTab('referrals');
testTab('resources'); testTab('resources');
......
...@@ -10,9 +10,9 @@ import RoutedTabs from 'toolkit/components/RoutedTabs/RoutedTabs'; ...@@ -10,9 +10,9 @@ import RoutedTabs from 'toolkit/components/RoutedTabs/RoutedTabs';
import DailyRewardClaimButton from 'ui/rewards/dashboard/DailyRewardClaimButton'; import DailyRewardClaimButton from 'ui/rewards/dashboard/DailyRewardClaimButton';
import RewardsDashboardCard from 'ui/rewards/dashboard/RewardsDashboardCard'; import RewardsDashboardCard from 'ui/rewards/dashboard/RewardsDashboardCard';
import RewardsDashboardCardValue from 'ui/rewards/dashboard/RewardsDashboardCardValue'; import RewardsDashboardCardValue from 'ui/rewards/dashboard/RewardsDashboardCardValue';
import ActivityTab from 'ui/rewards/dashboard/tabs/ActivityTab';
import ReferralsTab from 'ui/rewards/dashboard/tabs/ReferralsTab'; import ReferralsTab from 'ui/rewards/dashboard/tabs/ReferralsTab';
import ResourcesTab from 'ui/rewards/dashboard/tabs/ResourcesTab'; import ResourcesTab from 'ui/rewards/dashboard/tabs/ResourcesTab';
import TasksTab from 'ui/rewards/dashboard/tabs/TasksTab';
import AdBanner from 'ui/shared/ad/AdBanner'; import AdBanner from 'ui/shared/ad/AdBanner';
import PageTitle from 'ui/shared/Page/PageTitle'; import PageTitle from 'ui/shared/Page/PageTitle';
import useRedirectForInvalidAuthToken from 'ui/snippets/auth/useRedirectForInvalidAuthToken'; import useRedirectForInvalidAuthToken from 'ui/snippets/auth/useRedirectForInvalidAuthToken';
...@@ -55,7 +55,7 @@ const RewardsDashboard = () => { ...@@ -55,7 +55,7 @@ const RewardsDashboard = () => {
<Link external href={ `https://merits.blockscout.com/?tab=users&utm_source=${ config.chain.id }&utm_medium=text-banner` }> <Link external href={ `https://merits.blockscout.com/?tab=users&utm_source=${ config.chain.id }&utm_medium=text-banner` }>
Explore the Merits Hub Explore the Merits Hub
</Link>{ ' ' } </Link>{ ' ' }
to learn more info about a program, spend your Merits, learn how to earn more, and much more. to earn, spend, and learn more about the program.
</span> </span>
) } ) }
/> />
...@@ -134,9 +134,9 @@ const RewardsDashboard = () => { ...@@ -134,9 +134,9 @@ const RewardsDashboard = () => {
w="full" w="full"
tabs={ [ tabs={ [
{ {
id: 'tasks', id: 'activity',
title: 'Tasks', title: 'Activity',
component: <TasksTab/>, component: <ActivityTab/>,
}, },
{ {
id: 'referrals', id: 'referrals',
......
...@@ -40,7 +40,7 @@ function getMaxAmount(rewards: Record<string, string> | undefined) { ...@@ -40,7 +40,7 @@ function getMaxAmount(rewards: Record<string, string> | undefined) {
return Math.max(...values); return Math.max(...values);
} }
export default function TasksTab() { export default function ActivityTab() {
const { apiToken, rewardsConfigQuery } = useRewardsContext(); const { apiToken, rewardsConfigQuery } = useRewardsContext();
const explorersModal = useDisclosure(); const explorersModal = useDisclosure();
const taskDetailsModal = useDisclosure(); const taskDetailsModal = useDisclosure();
...@@ -88,8 +88,8 @@ export default function TasksTab() { ...@@ -88,8 +88,8 @@ export default function TasksTab() {
const previousAmount = Number(previous?.amount || 0); const previousAmount = Number(previous?.amount || 0);
const currentPercentile = (current?.percentile || 0) * 100; const currentPercentile = (current?.percentile || 0) * 100;
const previousPercentile = (previous?.percentile || 0) * 100; const previousPercentile = (previous?.percentile || 0) * 100;
const amountDiff = currentAmount - previousAmount; const amountDiff = Number((currentAmount - previousAmount).toFixed(2));
const percentileDiff = currentPercentile - previousPercentile; const percentileDiff = Number((currentPercentile - previousPercentile).toFixed(2));
return { return {
amount: currentAmount, amount: currentAmount,
...@@ -135,11 +135,11 @@ export default function TasksTab() { ...@@ -135,11 +135,11 @@ export default function TasksTab() {
title: 'Contracts verification', title: 'Contracts verification',
description: ( description: (
<> <>
Log in to your Blockscout account and{ ' ' } Log in and{ ' ' }
<Link href={ route({ pathname: '/contract-verification' }) }> <Link href={ route({ pathname: '/contract-verification' }) }>
verify a smart contract verify a smart contract
</Link>{ ' ' } </Link>{ ' ' }
using Blockscout website to earn Merits. on the Blockscout explorer to earn Merits.
</> </>
), ),
percentile: activities.contracts?.percentile, percentile: activities.contracts?.percentile,
...@@ -167,7 +167,7 @@ export default function TasksTab() { ...@@ -167,7 +167,7 @@ export default function TasksTab() {
const labels = { const labels = {
period: { text: `Period: ${ period }`, hint: 'Current Merits period. All metrics reset weekly' }, period: { text: `Period: ${ period }`, hint: 'Current Merits period. All metrics reset weekly' },
performanceRank: { text: 'Performance rank', hint: 'Your rank across task groups compared to others. Higher rank = more Merits' }, performanceRank: { text: 'Performance rank', hint: 'Your rank within a task group compared to other users in the same period. Higher rank = more Merits.' },
meritsEarned: { text: 'Merits earned', hint: 'Estimated Merits based on your current rank. Final amount may change' }, meritsEarned: { text: 'Merits earned', hint: 'Estimated Merits based on your current rank. Final amount may change' },
}; };
...@@ -213,7 +213,7 @@ export default function TasksTab() { ...@@ -213,7 +213,7 @@ export default function TasksTab() {
pr={ 0 } pr={ 0 }
> >
<Flex flexDirection="column" p={{ base: 1.5, md: 0 }} pb={ 0 }> <Flex flexDirection="column" p={{ base: 1.5, md: 0 }} pb={ 0 }>
<Heading level="3" mb={ 2 }>Tasks</Heading> <Heading level="3" mb={ 2 }>Your activity</Heading>
<Text textStyle="sm" mb={{ base: 2, md: 4 }}> <Text textStyle="sm" mb={{ base: 2, md: 4 }}>
Use Blockscout and related products daily to earn Merits. Check each task for details and how to get started. Use Blockscout and related products daily to earn Merits. Check each task for details and how to get started.
</Text> </Text>
...@@ -245,7 +245,7 @@ export default function TasksTab() { ...@@ -245,7 +245,7 @@ export default function TasksTab() {
<IconSvg name="status/warning" boxSize={ 6 } color="gray.500"/> <IconSvg name="status/warning" boxSize={ 6 } color="gray.500"/>
<Text textStyle="sm"> <Text textStyle="sm">
<chakra.span fontWeight="600">Your current Merit count is not final!</chakra.span><br/> <chakra.span fontWeight="600">Your current Merit count is not final!</chakra.span><br/>
Merits are calculated based on the activity of all users and may increase or decrease by the end of the period. Merits are calculated based on the activity of all users and may increase or decrease by the end of the weekly period.
</Text> </Text>
</Flex> </Flex>
</Flex> </Flex>
......
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