Skip to content

Commit

Permalink
Merge branch 'develop' into AnotherDev/ui-feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Another-DevX authored Apr 29, 2024
2 parents 08d8f0b + 1e4c4d1 commit 709c634
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/components/_global/BalModal/BalModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ defineExpose({ hide });
shadow="lg"
:noPad="noPad"
:noContentPad="noContentPad"
class="dark:bg-refi-gray modal-card"
class="bg-white dark:bg-refi-gray modal-card"
noBorder
overflowYScroll
>
Expand Down
6 changes: 5 additions & 1 deletion src/components/heros/HomePageHero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ defineProps<Props>();
</div>
<p class="text-sm font-normal text-complementary">
There are currently {{ tokensAmount }} tokens listed.
<a class="underline underline-offset-2" href="#">View all tokens</a>
<a
class="underline underline-offset-2"
href="https://github.com/Kolektivo-Labs/regenerative-fi-tokenlist/blob/main/regenerative.tokenlist.json"
>View all tokens</a
>
or
<a class="underline underline-offset-2" href="#">
request a new token listing.
Expand Down
2 changes: 1 addition & 1 deletion src/components/navs/AppNav/AppNavNetworkSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const appNetworkSupported = computed((): boolean => {
const activeNetwork = computed((): NetworkOption | undefined =>
allNetworks.value.find(network => {
if (!appNetworkSupported.value && network.id === 'ethereum') return true;
if (!appNetworkSupported.value && network.id === 'celo') return true;
return isActive(network);
})
);
Expand Down
13 changes: 0 additions & 13 deletions src/components/tables/PoolsTable/PoolsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ function lockedUntil(lockEndDate?: number) {
}
function iconAddresses(pool: Pool) {
console.debug({ pool });
console.debug(
poolMetadata(pool.id)?.hasIcon
? [pool.address]
: orderedTokenAddresses(pool)
);
return poolMetadata(pool.id)?.hasIcon
? [pool.address]
: orderedTokenAddresses(pool);
Expand Down Expand Up @@ -318,13 +312,6 @@ function goToPoolPage(id: string) {
},
});
}
watch(
() => props.data,
() => {
console.debug(props.data[0].name);
}
);
</script>

<template>
Expand Down
5 changes: 3 additions & 2 deletions src/composables/useNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const NETWORK_ID =
urlNetworkId ||
localStorageNetworkId ||
(Number(import.meta.env.VITE_NETWORK) as Network) ||
Network.MAINNET;
Network.CELO;
if (windowAvailable) localStorage.setItem('networkId', NETWORK_ID.toString());
export const networkSlug = config[NETWORK_ID].slug;
export const networkConfig = config[NETWORK_ID];
Expand Down Expand Up @@ -125,12 +125,13 @@ export function handleNetworkSlug(
) {
const networkFromUrl = networkFromSlug(networkSlug);
const localStorageNetwork = networkFor(
localStorage.getItem('networkId') ?? '1'
localStorage.getItem('networkId') ?? '42220'
);
if (!networkFromUrl) {
// missing or incorrect network name -> next() withtout network change
return noNetworkChangeCallback();
}

if (localStorageNetwork === networkFromUrl) {
// if on the correct network -> next()
return noNetworkChangeCallback();
Expand Down
19 changes: 9 additions & 10 deletions src/lib/config/celo/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ const pools: Pools = {
DynamicFees: {
Gauntlet: [],
},
BlockList: [''],
IncludedPoolTypes: ['Weighted'],
BlockList: [
'0xac95f160947a68d222f70760f0c6d40a7aa639cd000200000000000000000002',
'0x518282155ff9d72dfb2c6d205a402ebd86625999000200000000000000000003',
'0xeb1aa80b91f8b7146e15cc6ab1939f579cac32bc000200000000000000000001',
'0x0bb36015d267708ffda79c9d71c8820238358017000200000000000000000004',
],
IncludedPoolTypes: ['Weighted', 'Stable', 'ComposableStable'],
Stable: {
AllowList: [],
},
Expand All @@ -27,18 +32,12 @@ const pools: Pools = {
// Only effective after given timestamp here: usePool.ts#createdAfterTimestamp
// see useDisabledJoinPool.ts#nonAllowedWeightedPoolAfterTimestamp for logic.
AllowList: [
'0xac95f160947a68d222f70760f0c6d40a7aa639cd000200000000000000000002',
'0x518282155ff9d72dfb2c6d205a402ebd86625999000200000000000000000003',
'0xeb1aa80b91f8b7146e15cc6ab1939f579cac32bc000200000000000000000001',
'0x0bb36015d267708ffda79c9d71c8820238358017000200000000000000000004',
'0xd218f56d30a3699c9de4c82cd37e23a6dfefe479000200000000000000000005',
],
},
Factories: {
'0xeb1055c017a1427726f01368c8247649c5a79bf9': 'weightedPool', // Weighted v4
// '0x8ea89804145c007e7d226001a96955ad53836087': 'composableStablePool', // ComposableStable V4
// '0x956ccab09898c0af2aca5e6c229c3ad4e93d9288': 'composableStablePool',
// '0x6b1da720be2d11d95177ccfc40a917c2688f396c': 'erc4626Linear', // ERC4626 LinearPool
// '0x5d56ea1b2595d2dbe4f5014b967c78ce75324f0c': 'gyroE',
'0xA66501F277e27fEB17f653174954590e319404c4': 'composableStablePool', // ComposableStable V4
},
Stakable: {
VotingGaugePools: [],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/config/celo/tokenlists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TokenListURLMap } from '@/types/TokenList';
const tokenlists: TokenListURLMap = {
Balancer: {
Allowlisted:
'https://raw.githubusercontent.com/fabianschu/tokenlists/main/generated/balancer.tokenlist.json',
'https://raw.githubusercontent.com/Kolektivo-Labs/regenerative-fi-tokenlist/main/regenerative.tokenlist.json',
},
External: [],
};
Expand Down
12 changes: 11 additions & 1 deletion src/plugins/router/nav-guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ function applyNetworkSubdomainRedirect(router: Router): Router {
*/
function applyNetworkPathRedirects(router: Router): Router {
router.beforeEach((to, from, next) => {
const networkSlugFromUrl = to.params.networkSlug?.toString() ?? '';

if (
networkSlugFromUrl !== config[Network.CELO].slug &&
networkSlugFromUrl !== config[Network.ALFAJORES].slug
) {
console.debug(networkSlugFromUrl, config[Network.CELO].slug);
router.push({ path: `/${config[Network.CELO].slug}${to.fullPath}` });
}
if (redirecting.value) {
next();
} else {
Expand All @@ -106,6 +115,7 @@ function applyNetworkPathRedirects(router: Router): Router {
'/risks',
];
const routerHandledRedirects = ['not-found', 'trade-redirect'];

if (
to.redirectedFrom?.fullPath &&
to.redirectedFrom?.fullPath.includes('/pool')
Expand All @@ -121,7 +131,7 @@ function applyNetworkPathRedirects(router: Router): Router {
} else {
const newPath = to.redirectedFrom?.fullPath ?? to.fullPath;
const newNetwork = newPath.includes('/pool')
? config[Network.MAINNET].slug
? config[Network.CELO].slug
: networkSlug;
router.push({ path: `/${newNetwork}${newPath}` });
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/router/route-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export interface RouteTo {

export function resolveRoute(to: RouteTo) {
if (!to?.name) throw new Error(`Provided route (${to}) must have name`);
return router.resolve({ name: to.name, params: { networkSlug: 'ethereum' } })
return router.resolve({ name: to.name, params: { networkSlug: 'celo' } })
.matched[0].components?.default;
}

0 comments on commit 709c634

Please sign in to comment.