Skip to content

Commit

Permalink
change Merits dashboard path (#2575)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxaleks authored Feb 17, 2025
1 parent c97e3f9 commit aeb5635
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/metadata/getPageOgType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const OG_TYPE_DICT: Record<Route['pathname'], OGPageType> = {
'/graphiql': 'Regular page',
'/search-results': 'Regular page',
'/auth/profile': 'Root page',
'/account/rewards': 'Regular page',
'/account/merits': 'Regular page',
'/account/watchlist': 'Regular page',
'/account/api-key': 'Regular page',
'/account/custom-abi': 'Regular page',
Expand Down
2 changes: 1 addition & 1 deletion lib/metadata/templates/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = {
'/graphiql': DEFAULT_TEMPLATE,
'/search-results': DEFAULT_TEMPLATE,
'/auth/profile': DEFAULT_TEMPLATE,
'/account/rewards': DEFAULT_TEMPLATE,
'/account/merits': DEFAULT_TEMPLATE,
'/account/watchlist': DEFAULT_TEMPLATE,
'/account/api-key': DEFAULT_TEMPLATE,
'/account/custom-abi': DEFAULT_TEMPLATE,
Expand Down
2 changes: 1 addition & 1 deletion lib/metadata/templates/title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = {
'/graphiql': 'GraphQL for %network_name% - %network_name% data query',
'/search-results': '%network_name% search result for %q%',
'/auth/profile': '%network_name% - my profile',
'/account/rewards': '%network_name% - rewards',
'/account/merits': '%network_name% - Merits',
'/account/watchlist': '%network_name% - watchlist',
'/account/api-key': '%network_name% - API keys',
'/account/custom-abi': '%network_name% - custom ABI',
Expand Down
2 changes: 1 addition & 1 deletion lib/mixpanel/getPageType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const PAGE_TYPE_DICT: Record<Route['pathname'], string> = {
'/graphiql': 'GraphQL',
'/search-results': 'Search results',
'/auth/profile': 'Profile',
'/account/rewards': 'Merits',
'/account/merits': 'Merits',
'/account/watchlist': 'Watchlist',
'/account/api-key': 'API keys',
'/account/custom-abi': 'Custom ABI',
Expand Down
2 changes: 1 addition & 1 deletion nextjs/nextjs-routes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare module "nextjs-routes" {
| StaticRoute<"/404">
| StaticRoute<"/account/api-key">
| StaticRoute<"/account/custom-abi">
| StaticRoute<"/account/rewards">
| StaticRoute<"/account/merits">
| StaticRoute<"/account/tag-address">
| StaticRoute<"/account/verified-addresses">
| StaticRoute<"/account/watchlist">
Expand Down
4 changes: 4 additions & 0 deletions nextjs/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const oldUrls = [
source: '/account/public-tags-request',
destination: '/public-tags/submit',
},
{
source: '/account/rewards',
destination: '/account/merits',
},

// TRANSACTIONS
{
Expand Down
2 changes: 1 addition & 1 deletion pages/account/rewards.tsx → pages/account/merits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const RewardsDashboard = dynamic(() => import('ui/pages/RewardsDashboard'), { ss

const Page: NextPage = () => {
return (
<PageNextJs pathname="/account/rewards">
<PageNextJs pathname="/account/merits">
<RewardsDashboard/>
</PageNextJs>
);
Expand Down
2 changes: 1 addition & 1 deletion ui/rewards/RewardsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const RewardsButton = ({ variant = 'header', size }: Props) => {
data-selected={ !isLoading && Boolean(apiToken) }
flexShrink={ 0 }
as={ apiToken ? LinkInternal : 'button' }
{ ...(apiToken ? { href: route({ pathname: '/account/rewards' }) } : {}) }
{ ...(apiToken ? { href: route({ pathname: '/account/merits' }) } : {}) }
onClick={ apiToken ? undefined : openLoginModal }
onFocus={ handleFocus }
fontSize="sm"
Expand Down
2 changes: 1 addition & 1 deletion ui/rewards/login/steps/CongratsStepContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const CongratsStepContent = ({ isReferral }: Props) => {
Explore your current Merits balance, find activities to boost your Merits,
and view your capybara NFT badge collection on the dashboard
</Text>
<Button mt={ 3 } as="a" href={ route({ pathname: '/account/rewards' }) }>
<Button mt={ 3 } as="a" href={ route({ pathname: '/account/merits' }) }>
Open
</Button>
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion ui/rewards/login/steps/LoginStepContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const LoginStepContent = ({ goNext, closeModal, openAuthModal }: Props) => {
goNext(isRefCodeUsed);
} else {
closeModal();
router.push({ pathname: '/account/rewards' }, undefined, { shallow: true });
router.push({ pathname: '/account/merits' }, undefined, { shallow: true });
}
}
} catch (error) {}
Expand Down
2 changes: 1 addition & 1 deletion ui/snippets/auth/useLogout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as mixpanel from 'lib/mixpanel';
const PROTECTED_ROUTES: Array<Route['pathname']> = [
'/account/api-key',
'/account/custom-abi',
'/account/rewards',
'/account/merits',
'/account/tag-address',
'/account/verified-addresses',
'/account/watchlist',
Expand Down
2 changes: 1 addition & 1 deletion ui/snippets/navigation/vertical/NavLinkRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const NavLinkRewards = ({ isCollapsed, onClick }: Props) => {
const router = useRouter();
const { openLoginModal, dailyRewardQuery, apiToken, isInitialized } = useRewardsContext();

const pathname = '/account/rewards';
const pathname = '/account/merits';
const nextRoute = { pathname } as Route;

const handleClick = useCallback((e: React.MouseEvent) => {
Expand Down

0 comments on commit aeb5635

Please sign in to comment.