Skip to content

Commit

Permalink
post-review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxaleks committed Oct 30, 2024
1 parent 3451a0a commit 805ad3d
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/ENVS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions icons/merits.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions icons/merits_slim.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions icons/merits_with_dot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions icons/merits_with_dot_slim.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lib/contexts/rewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]);
Expand All @@ -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 ]);
Expand Down
8 changes: 4 additions & 4 deletions ui/pages/RewardsDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion ui/rewards/RewardsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
/>
Expand Down
2 changes: 1 addition & 1 deletion ui/rewards/RewardsNavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -36,4 +36,4 @@ const ReadOnlyInputWithCopy = ({ label, value, className, isLoading }: Props) =>
</FormControl>
);

export default chakra(ReadOnlyInputWithCopy);
export default chakra(RewardsReadOnlyInputWithCopy);
4 changes: 2 additions & 2 deletions ui/rewards/dashboard/DailyRewardClaimButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -55,7 +55,7 @@ const DailyRewardClaimButton = () => {

updateCountdown(target);

interval = setInterval(() => {
interval = window.setInterval(() => {
updateCountdown(target);
}, SECOND);

Expand Down
4 changes: 2 additions & 2 deletions ui/rewards/login/steps/CongratsStepContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 805ad3d

Please sign in to comment.