Skip to content

Commit 040ef1b

Browse files
committed
Hide v2 and total tab in analytics page
1 parent 1fca298 commit 040ef1b

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/components/Toggle/VersionToggle.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ const VersionToggle: React.FC = () => {
2626
const history = useHistory();
2727
const isAnalyticsPage = history.location.pathname.includes('/analytics');
2828
const isPoolPage = history.location.pathname.includes('/pools');
29-
const analyticsVersion = useAnalyticsVersion();
29+
const analyticsVersion = useAnalyticsVersion(); // TODO: change default version in useAnalyticsVersion if it's needed to show total and v2
3030
const version =
3131
params && params.version
3232
? params.version
3333
: isAnalyticsPage
3434
? analyticsVersion
3535
: 'v3';
3636

37+
// Hide v2 and total tab for now
38+
const hideV2 = true; // TODO: false to show v2
39+
const hideTotal = true; // TODO: false to show total
40+
3741
useEffect(() => {
3842
updateIsV2(version === 'v2');
3943
updateIsLpLock(version === 'lpLocker');
@@ -67,7 +71,7 @@ const VersionToggle: React.FC = () => {
6771

6872
return (
6973
<Box className='version-toggle-container'>
70-
{v2Available && (
74+
{!hideV2 && v2Available && (
7175
<Box
7276
className={version === 'v2' ? 'version-toggle-active' : ''}
7377
onClick={() => {
@@ -143,14 +147,16 @@ const VersionToggle: React.FC = () => {
143147
<small>{t('liquidityHub')}</small>
144148
</Box>
145149
)}
146-
<Box
147-
className={version === 'total' ? 'version-toggle-active' : ''}
148-
onClick={() => {
149-
redirectWithVersion('total');
150-
}}
151-
>
152-
<small>{t('total')}</small>
153-
</Box>
150+
{!hideTotal && (
151+
<Box
152+
className={version === 'total' ? 'version-toggle-active' : ''}
153+
onClick={() => {
154+
redirectWithVersion('total');
155+
}}
156+
>
157+
<small>{t('total')}</small>
158+
</Box>
159+
)}
154160
</>
155161
)}
156162
</Box>

src/hooks/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ export const useAnalyticsVersion = () => {
133133
const config = getConfig(chainIdToUse);
134134
const v2 = config['v2'];
135135
const v3 = config['v3'];
136-
const defaultVersion = v2 && v3 ? 'total' : v2 ? 'v2' : 'v3';
136+
// const defaultVersion = v2 && v3 ? 'total' : v2 ? 'v2' : 'v3';
137+
const defaultVersion = 'v3'; // default to v3 for now
137138
const params: any = useParams();
138139
const version = params && params.version ? params.version : defaultVersion;
139140
return version;

0 commit comments

Comments
 (0)