Skip to content

Commit 6aa4b7e

Browse files
authored
Merge pull request #1775 from QuickSwap/dev2
Dev2
2 parents 0192eb6 + 88bc9ae commit 6aa4b7e

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

src/components/Toggle/VersionToggle.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@ 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(); // TODO: change default version in useAnalyticsVersion if it's needed to show total and v2
29+
const analyticsVersion = useAnalyticsVersion();
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 = isAnalyticsPage; // TODO: false to show v2. Set to false if isAnalyticsPage is true
39-
const hideTotal = true; // TODO: false to show total
40-
4137
useEffect(() => {
4238
updateIsV2(version === 'v2');
4339
updateIsLpLock(version === 'lpLocker');
@@ -71,7 +67,7 @@ const VersionToggle: React.FC = () => {
7167

7268
return (
7369
<Box className='version-toggle-container'>
74-
{!hideV2 && v2Available && (
70+
{v2Available && (
7571
<Box
7672
className={version === 'v2' ? 'version-toggle-active' : ''}
7773
onClick={() => {
@@ -147,16 +143,14 @@ const VersionToggle: React.FC = () => {
147143
<small>{t('liquidityHub')}</small>
148144
</Box>
149145
)}
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-
)}
146+
<Box
147+
className={version === 'total' ? 'version-toggle-active' : ''}
148+
onClick={() => {
149+
redirectWithVersion('total');
150+
}}
151+
>
152+
<small>{t('total')}</small>
153+
</Box>
160154
</>
161155
)}
162156
</Box>

src/hooks/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ 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';
137-
const defaultVersion = v2 && v3 ? 'v3' : v2 ? 'v2' : 'v3'; // default to v3 for now
136+
const defaultVersion = v2 && v3 ? 'total' : v2 ? 'v2' : 'v3';
138137
const params: any = useParams();
139138
const version = params && params.version ? params.version : defaultVersion;
140139
return version;

0 commit comments

Comments
 (0)