From aeb5635cc52f8d14677120cd85d01642f347b82f Mon Sep 17 00:00:00 2001 From: Max Alekseenko Date: Mon, 17 Feb 2025 16:13:44 +0100 Subject: [PATCH] change Merits dashboard path (#2575) --- lib/metadata/getPageOgType.ts | 2 +- lib/metadata/templates/description.ts | 2 +- lib/metadata/templates/title.ts | 2 +- lib/mixpanel/getPageType.ts | 2 +- nextjs/nextjs-routes.d.ts | 2 +- nextjs/redirects.js | 4 ++++ pages/account/{rewards.tsx => merits.tsx} | 2 +- ui/rewards/RewardsButton.tsx | 2 +- ui/rewards/login/steps/CongratsStepContent.tsx | 2 +- ui/rewards/login/steps/LoginStepContent.tsx | 2 +- ui/snippets/auth/useLogout.ts | 2 +- ui/snippets/navigation/vertical/NavLinkRewards.tsx | 2 +- 12 files changed, 15 insertions(+), 11 deletions(-) rename pages/account/{rewards.tsx => merits.tsx} (90%) diff --git a/lib/metadata/getPageOgType.ts b/lib/metadata/getPageOgType.ts index 9c3dd6b2d5..28e9d653bb 100644 --- a/lib/metadata/getPageOgType.ts +++ b/lib/metadata/getPageOgType.ts @@ -28,7 +28,7 @@ const OG_TYPE_DICT: Record = { '/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', diff --git a/lib/metadata/templates/description.ts b/lib/metadata/templates/description.ts index 71cf38846b..6fd4c2a14f 100644 --- a/lib/metadata/templates/description.ts +++ b/lib/metadata/templates/description.ts @@ -31,7 +31,7 @@ const TEMPLATE_MAP: Record = { '/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, diff --git a/lib/metadata/templates/title.ts b/lib/metadata/templates/title.ts index 8042abdc77..37c4f0ee5a 100644 --- a/lib/metadata/templates/title.ts +++ b/lib/metadata/templates/title.ts @@ -28,7 +28,7 @@ const TEMPLATE_MAP: Record = { '/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', diff --git a/lib/mixpanel/getPageType.ts b/lib/mixpanel/getPageType.ts index 39052c6450..fcb6530013 100644 --- a/lib/mixpanel/getPageType.ts +++ b/lib/mixpanel/getPageType.ts @@ -26,7 +26,7 @@ export const PAGE_TYPE_DICT: Record = { '/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', diff --git a/nextjs/nextjs-routes.d.ts b/nextjs/nextjs-routes.d.ts index f54eca7356..ffd01fcf72 100644 --- a/nextjs/nextjs-routes.d.ts +++ b/nextjs/nextjs-routes.d.ts @@ -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"> diff --git a/nextjs/redirects.js b/nextjs/redirects.js index a5908dc12f..d995fb3957 100644 --- a/nextjs/redirects.js +++ b/nextjs/redirects.js @@ -52,6 +52,10 @@ const oldUrls = [ source: '/account/public-tags-request', destination: '/public-tags/submit', }, + { + source: '/account/rewards', + destination: '/account/merits', + }, // TRANSACTIONS { diff --git a/pages/account/rewards.tsx b/pages/account/merits.tsx similarity index 90% rename from pages/account/rewards.tsx rename to pages/account/merits.tsx index 422ce4c90f..42414e9d1b 100644 --- a/pages/account/rewards.tsx +++ b/pages/account/merits.tsx @@ -8,7 +8,7 @@ const RewardsDashboard = dynamic(() => import('ui/pages/RewardsDashboard'), { ss const Page: NextPage = () => { return ( - + ); diff --git a/ui/rewards/RewardsButton.tsx b/ui/rewards/RewardsButton.tsx index 1120f2f240..09fbebfedd 100644 --- a/ui/rewards/RewardsButton.tsx +++ b/ui/rewards/RewardsButton.tsx @@ -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" diff --git a/ui/rewards/login/steps/CongratsStepContent.tsx b/ui/rewards/login/steps/CongratsStepContent.tsx index aca25de227..4b065f2e30 100644 --- a/ui/rewards/login/steps/CongratsStepContent.tsx +++ b/ui/rewards/login/steps/CongratsStepContent.tsx @@ -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 - diff --git a/ui/rewards/login/steps/LoginStepContent.tsx b/ui/rewards/login/steps/LoginStepContent.tsx index 2d933c630b..fedbf91b8a 100644 --- a/ui/rewards/login/steps/LoginStepContent.tsx +++ b/ui/rewards/login/steps/LoginStepContent.tsx @@ -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) {} diff --git a/ui/snippets/auth/useLogout.ts b/ui/snippets/auth/useLogout.ts index 849f701293..d33fe44301 100644 --- a/ui/snippets/auth/useLogout.ts +++ b/ui/snippets/auth/useLogout.ts @@ -14,7 +14,7 @@ import * as mixpanel from 'lib/mixpanel'; const PROTECTED_ROUTES: Array = [ '/account/api-key', '/account/custom-abi', - '/account/rewards', + '/account/merits', '/account/tag-address', '/account/verified-addresses', '/account/watchlist', diff --git a/ui/snippets/navigation/vertical/NavLinkRewards.tsx b/ui/snippets/navigation/vertical/NavLinkRewards.tsx index eb92ba5a42..57df3ea027 100644 --- a/ui/snippets/navigation/vertical/NavLinkRewards.tsx +++ b/ui/snippets/navigation/vertical/NavLinkRewards.tsx @@ -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) => {