post-review changes
@@ -801,7 +801,7 @@ This feature enables Blockscout Merits program. It requires that the [My account
|
||||
|
||||
| Variable | Type| Description | Compulsoriness | Default value | Example value | Version |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| NEXT_PUBLIC_REWARDS_SERVICE_API_HOST | `string` | API url | - | - | `https://example.com` | v1.36.0+ |
|
||||
| NEXT_PUBLIC_REWARDS_SERVICE_API_HOST | `string` | API URL | - | - | `https://example.com` | v1.36.0+ |
|
||||
|
||||
## External services configuration
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M10.229 6.946c.401 0 .727.329.727.735v.636a.731.731 0 0 1-.727.735h-.353a.731.731 0 0 0-.727.735v6.532a.731.731 0 0 1-.727.735h-.695A.731.731 0 0 1 7 16.32V9.787c0-.406.326-.735.727-.735h.353c.401 0 .727-.33.727-.736v-.635c0-.406.325-.735.727-.735h.694ZM14.54 6.946c.403 0 .728.329.728.735v.635c0 .407.326.736.727.736h.278c.401 0 .727.329.727.735v6.532a.731.731 0 0 1-.727.735h-.695a.731.731 0 0 1-.727-.735V9.787a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.735V7.68c0-.406.326-.735.727-.735h.695ZM12.362 10.977c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.736v-2.62c0-.407.326-.736.728-.736h.694Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.894 1.213a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 2 7.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 22 16.935v-9.87c0-.766-.428-1.466-1.106-1.808l-8-4.044ZM4 7.065l8-4.043 8 4.043v9.87l-8 4.043-8-4.043v-9.87Z" fill="currentColor"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" fill="none">
|
||||
<path d="M13.229 9.946c.401 0 .727.329.727.735v.636a.731.731 0 0 1-.727.735h-.353a.731.731 0 0 0-.727.735v6.532a.731.731 0 0 1-.727.735h-.695A.731.731 0 0 1 10 19.32v-6.532c0-.406.326-.735.727-.735h.352c.402 0 .728-.33.728-.736v-.635a.73.73 0 0 1 .727-.735h.694Zm4.311 0c.402 0 .728.329.728.735v.636c0 .405.326.735.727.735h.278c.401 0 .727.329.727.735v6.532a.731.731 0 0 1-.727.735h-.695a.731.731 0 0 1-.727-.735v-6.532a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.736v-.635c0-.406.326-.735.727-.735h.695Zm-2.178 4.031c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.735v-2.622c0-.406.326-.735.728-.735h.694Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.894 4.213a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 5 10.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 25 19.935v-9.87c0-.766-.428-1.466-1.106-1.808l-8-4.044ZM7 10.065l8-4.043 8 4.043v9.87l-8 4.043-8-4.043v-9.87Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" fill="none">
|
||||
<path d="M13.229 9.946c.401 0 .727.329.727.735v.636a.731.731 0 0 1-.727.735h-.353a.731.731 0 0 0-.727.735v6.532a.731.731 0 0 1-.727.735h-.695A.731.731 0 0 1 10 19.32v-6.532c0-.406.326-.735.727-.735h.352c.402 0 .728-.33.728-.736v-.635a.73.73 0 0 1 .727-.735h.694ZM17.54 9.946c.402 0 .728.329.728.735v.636c0 .405.326.735.727.735h.278c.401 0 .727.329.727.735v6.532a.731.731 0 0 1-.727.735h-.695a.731.731 0 0 1-.727-.735v-6.532a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.736v-.635c0-.406.326-.735.727-.735h.695ZM15.362 13.977c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.735v-2.622c0-.406.326-.735.728-.735h.694Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.894 4.213a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 5 10.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 25 19.935v-9.87c0-.766-.428-1.466-1.106-1.808l-8-4.044ZM7 10.065l8-4.043 8 4.043v9.87l-8 4.043-8-4.043v-9.87Z" fill="currentColor"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M10.229 6.946c.401 0 .727.329.727.735v.636a.731.731 0 0 1-.727.735h-.353a.731.731 0 0 0-.727.735v6.532a.731.731 0 0 1-.727.735h-.695A.731.731 0 0 1 7 16.32V9.787c0-.406.326-.735.727-.735h.353c.401 0 .727-.33.727-.736v-.635a.73.73 0 0 1 .727-.735h.694Zm4.311 0a.73.73 0 0 1 .728.735v.635c0 .407.326.736.727.736h.278c.401 0 .727.329.727.735v6.532a.731.731 0 0 1-.727.735h-.695a.731.731 0 0 1-.727-.735V9.787a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.735V7.68c0-.406.326-.735.727-.735h.695Zm-2.178 4.031c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.736v-2.62c0-.407.326-.736.728-.736h.694Z" fill="currentColor"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.894 1.213a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 2 7.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 22 16.935v-9.87c0-.766-.428-1.466-1.106-1.808l-8-4.044ZM4 7.065l8-4.043 8 4.043v9.87l-8 4.043-8-4.043v-9.87Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m16.133 2.85-3.239-1.637a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 2 7.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 22 16.935V8.9a5.022 5.022 0 0 1-2 0v8.035l-8 4.043-8-4.043v-9.87l8-4.043 4.123 2.083a5.02 5.02 0 0 1 .01-2.255Zm-5.177 4.83a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.635a.731.731 0 0 1-.727.736h-.353A.731.731 0 0 0 7 9.787v6.532c0 .406.326.735.727.735h.695c.401 0 .727-.329.727-.735V9.787c0-.406.326-.735.727-.735h.353c.401 0 .727-.33.727-.735V7.68Zm4.312 0a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.636c0 .406.326.735.727.735h.278c.401 0 .727.329.727.735v6.532c0 .406.326.735.727.735h.695c.401 0 .727-.329.727-.735V9.787a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.736v-.635Zm-2.906 3.297c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.736v-2.62c0-.407.326-.736.728-.736h.694Z" fill="currentColor"/>
|
||||
<circle cx="21" cy="4" r="3" fill="#E53E3E"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m19.133 5.85-3.239-1.637a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 5 10.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 25 19.935V11.9a5.022 5.022 0 0 1-2 0v8.035l-8 4.043-8-4.043v-9.87l8-4.043 4.123 2.083a5.02 5.02 0 0 1 .01-2.255Zm-5.177 4.83a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.636a.731.731 0 0 1-.728.735h-.352a.731.731 0 0 0-.727.735v6.532c0 .406.326.735.727.735h.695a.731.731 0 0 0 .727-.735v-6.532c0-.406.326-.735.727-.735h.353c.401 0 .727-.33.727-.736v-.635Zm4.312 0a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.636c0 .406.326.735.727.735h.278a.73.73 0 0 1 .727.735v6.532c0 .406.326.735.727.735h.695a.731.731 0 0 0 .727-.735v-6.532a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.736v-.635Zm-2.906 3.297c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.735v-2.622c0-.406.326-.735.728-.735h.694Z" fill="currentColor"/>
|
||||
<circle cx="24" cy="7" r="3" fill="#E53E3E"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m19.133 5.85-3.239-1.637a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 5 10.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 25 19.935V11.9a5.022 5.022 0 0 1-2 0v8.035l-8 4.043-8-4.043v-9.87l8-4.043 4.123 2.083a5.02 5.02 0 0 1 .01-2.255Zm-5.177 4.83a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.636a.731.731 0 0 1-.728.735h-.352a.731.731 0 0 0-.727.735v6.532c0 .406.326.735.727.735h.695c.401 0 .727-.329.727-.735v-6.532c0-.406.326-.735.727-.735h.353c.401 0 .727-.33.727-.736v-.635Zm4.312 0a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.636c0 .406.326.735.727.735h.278c.402 0 .727.329.727.735v6.532c0 .406.326.735.727.735h.695c.401 0 .727-.329.727-.735v-6.532a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.736v-.635Zm-2.906 3.297c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.735v-2.622c0-.406.326-.735.728-.735h.694Z" fill="currentColor"/>
|
||||
<circle cx="24" cy="7" r="3" fill="#E53E3E"/>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m16.133 2.85-3.239-1.637a1.98 1.98 0 0 0-1.788 0l-8 4.044A2.024 2.024 0 0 0 2 7.065v9.87c0 .766.428 1.466 1.106 1.808l8 4.044a1.981 1.981 0 0 0 1.788 0l8-4.044A2.024 2.024 0 0 0 22 16.935V8.9a5.022 5.022 0 0 1-2 0v8.035l-8 4.043-8-4.043v-9.87l8-4.043 4.123 2.083a5.02 5.02 0 0 1 .01-2.255Zm-5.177 4.83a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.635a.731.731 0 0 1-.727.736h-.353A.731.731 0 0 0 7 9.787v6.532c0 .406.326.735.727.735h.695a.731.731 0 0 0 .727-.735V9.787c0-.406.326-.735.727-.735h.353c.401 0 .727-.33.727-.735V7.68Zm4.312 0a.731.731 0 0 0-.727-.734h-.695a.731.731 0 0 0-.727.735v.636c0 .406.326.735.727.735h.278c.401 0 .727.329.727.735v6.532c0 .406.326.735.727.735h.695a.731.731 0 0 0 .727-.735V9.787a.731.731 0 0 0-.727-.735h-.278a.731.731 0 0 1-.727-.736v-.635Zm-2.906 3.297c.402 0 .727.33.727.735v2.622a.731.731 0 0 1-.727.735h-.694a.731.731 0 0 1-.728-.736v-2.62c0-.407.326-.736.728-.736h.694Z" fill="currentColor"/>
|
||||
<circle cx="21" cy="4" r="3" fill="#E53E3E"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -227,7 +227,7 @@ export function RewardsContextProvider({ children }: Props) {
|
||||
saveApiToken(loginResponse.token);
|
||||
return { isNewUser: loginResponse.created };
|
||||
} catch (_error) {
|
||||
errorToast(_error as ResourceError<{ message: string }>);
|
||||
errorToast(_error);
|
||||
throw _error;
|
||||
}
|
||||
}, [ apiFetch, address, signMessageAsync, errorToast, saveApiToken, checkUserQuery ]);
|
||||
@@ -242,7 +242,7 @@ export function RewardsContextProvider({ children }: Props) {
|
||||
},
|
||||
}) as RewardsUserDailyClaimResponse;
|
||||
} catch (_error) {
|
||||
errorToast(_error as ResourceError<{ message: string }>);
|
||||
errorToast(_error);
|
||||
throw _error;
|
||||
}
|
||||
}, [ apiFetch, errorToast, fetchParams ]);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { apos } from 'lib/html-entities';
|
||||
import DailyRewardClaimButton from 'ui/rewards/dashboard/DailyRewardClaimButton';
|
||||
import RewardsDashboardCard from 'ui/rewards/dashboard/RewardsDashboardCard';
|
||||
import RewardsDashboardCardValue from 'ui/rewards/dashboard/RewardsDashboardCardValue';
|
||||
import ReadOnlyInputWithCopy from 'ui/rewards/ReadOnlyInputWithCopy';
|
||||
import RewardsReadOnlyInputWithCopy from 'ui/rewards/RewardsReadOnlyInputWithCopy';
|
||||
import LinkExternal from 'ui/shared/links/LinkExternal';
|
||||
import PageTitle from 'ui/shared/Page/PageTitle';
|
||||
import useRedirectForInvalidAuthToken from 'ui/snippets/auth/useRedirectForInvalidAuthToken';
|
||||
@@ -107,13 +107,13 @@ const RewardsDashboard = () => {
|
||||
py={{ base: 4, md: 0 }}
|
||||
flexDirection={{ base: 'column', md: 'row' }}
|
||||
>
|
||||
<ReadOnlyInputWithCopy
|
||||
<RewardsReadOnlyInputWithCopy
|
||||
label="Referral link"
|
||||
value={ `https://eth.blockscout.com?ref=${ referralsQuery.data?.code }` }
|
||||
value={ referralsQuery.data?.link || '' }
|
||||
isLoading={ referralsQuery.isPending }
|
||||
flex={ 2 }
|
||||
/>
|
||||
<ReadOnlyInputWithCopy
|
||||
<RewardsReadOnlyInputWithCopy
|
||||
label="Referral code"
|
||||
value={ referralsQuery.data?.code || '' }
|
||||
isLoading={ referralsQuery.isPending }
|
||||
|
||||
@@ -50,7 +50,7 @@ const RewardsButton = ({ variant = 'header', size }: Props) => {
|
||||
}}
|
||||
>
|
||||
<IconSvg
|
||||
name={ dailyRewardQuery.data?.available ? 'merits_with_dot' : 'merits' }
|
||||
name={ dailyRewardQuery.data?.available ? 'merits_with_dot_slim' : 'merits_slim' }
|
||||
boxSize={ variant === 'hero' ? 6 : 5 }
|
||||
flexShrink={ 0 }
|
||||
/>
|
||||
|
||||
@@ -77,7 +77,7 @@ const RewardsNavLink = ({ isCollapsed, onClick }: Props) => {
|
||||
margin={ 0 }
|
||||
>
|
||||
<HStack spacing={ 0 } overflow="hidden">
|
||||
<NavLinkIcon item={{ icon: dailyRewardQuery.data?.available ? 'merits_with_dot_slim' : 'merits_slim' } as NavItem}/>
|
||||
<NavLinkIcon item={{ icon: dailyRewardQuery.data?.available ? 'merits_with_dot' : 'merits' } as NavItem}/>
|
||||
<Text { ...styleProps.textProps } as="span" ml={ 3 }>
|
||||
Merits
|
||||
</Text>
|
||||
|
||||
@@ -11,7 +11,7 @@ type Props = {
|
||||
isLoading?: boolean;
|
||||
};
|
||||
|
||||
const ReadOnlyInputWithCopy = ({ label, value, className, isLoading }: Props) => (
|
||||
const RewardsReadOnlyInputWithCopy = ({ label, value, className, isLoading }: Props) => (
|
||||
<FormControl variant="floating" id={ label } className={ className }>
|
||||
<Skeleton isLoaded={ !isLoading }>
|
||||
<InputGroup>
|
||||
@@ -36,4 +36,4 @@ const ReadOnlyInputWithCopy = ({ label, value, className, isLoading }: Props) =>
|
||||
</FormControl>
|
||||
);
|
||||
|
||||
export default chakra(ReadOnlyInputWithCopy);
|
||||
export default chakra(RewardsReadOnlyInputWithCopy);
|
||||
@@ -37,7 +37,7 @@ const DailyRewardClaimButton = () => {
|
||||
const formattedDate = dailyRewardQuery.data.reset_at.replace(' ', 'T').replace(' UTC', 'Z');
|
||||
const target = new Date(formattedDate).getTime();
|
||||
|
||||
let interval: ReturnType<typeof setTimeout>; // eslint-disable-line prefer-const
|
||||
let interval = 0;
|
||||
|
||||
const updateCountdown = (target: number) => {
|
||||
const now = new Date().getTime();
|
||||
@@ -55,7 +55,7 @@ const DailyRewardClaimButton = () => {
|
||||
|
||||
updateCountdown(target);
|
||||
|
||||
interval = setInterval(() => {
|
||||
interval = window.setInterval(() => {
|
||||
updateCountdown(target);
|
||||
}, SECOND);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useRewardsContext } from 'lib/contexts/rewards';
|
||||
import IconSvg from 'ui/shared/IconSvg';
|
||||
|
||||
import MeritsIcon from '../../MeritsIcon';
|
||||
import ReadOnlyInputWithCopy from '../../ReadOnlyInputWithCopy';
|
||||
import RewardsReadOnlyInputWithCopy from '../../RewardsReadOnlyInputWithCopy';
|
||||
|
||||
type Props = {
|
||||
isReferral: boolean;
|
||||
@@ -89,7 +89,7 @@ const CongratsStepContent = ({ isReferral }: Props) => {
|
||||
</Skeleton>
|
||||
{ ' ' }bonus on all merits earned by your referrals
|
||||
</Text>
|
||||
<ReadOnlyInputWithCopy
|
||||
<RewardsReadOnlyInputWithCopy
|
||||
label="Referral link"
|
||||
value={ refLink }
|
||||
isLoading={ referralsQuery.isLoading }
|
||||
|
||||