Skip to content

Commit

Permalink
Hotfix: Add weekly gauges (balancer#3329)
Browse files Browse the repository at this point in the history
* add of weekly gauges

* Update src/components/pool/branded-redirect/constants.ts

Co-authored-by: Gareth Fuller <[email protected]>

* adding gyro holder description

* chore: Fix gyro branded redirect

* chore: Bump version

* chore: Fix package-lock diff

---------

Co-authored-by: Gareth Fuller <[email protected]>
  • Loading branch information
zekraken-bot and garethfuller authored May 10, 2023
1 parent 45be7cc commit ef24651
Show file tree
Hide file tree
Showing 11 changed files with 1,284 additions and 232 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@balancer/frontend-v2",
"version": "1.100.12",
"version": "1.100.13",
"engines": {
"node": "=16",
"npm": ">=8"
Expand Down
29 changes: 29 additions & 0 deletions public/data/hardcoded-gauges.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,34 @@
"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0": "https://raw.githubusercontent.com/balancer/tokenlists/main/src/assets/images/tokens/0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0.png",
"0xae78736Cd615f374D3085123A210448E74Fc6393": "https://raw.githubusercontent.com/balancer/tokenlists/main/src/assets/images/tokens/0xae78736cd615f374d3085123a210448e74fc6393.png"
}
},
{
"address": "0xD103Dd49B8051A09B399A52E9A8aB629392dE2fb",
"network": 137,
"isKilled": false,
"addedTimestamp": 1663017781,
"relativeWeightCap": "null",
"pool": {
"id": "0xf0ad209e2e969eaaa8c882aac71f02d8a047d5c2000200000000000000000b49",
"address": "0xf0ad209e2e969EAAA8C882aac71f02D8a047d5c2",
"poolType": "ComposableStable",
"symbol": "ECLP-WMATIC-stMATIC",
"tokens": [
{
"address": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
"weight": "null",
"symbol": "WMATIC"
},
{
"address": "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4",
"weight": "null",
"symbol": "stMATIC"
}
]
},
"tokenLogoURIs": {
"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270": "https://raw.githubusercontent.com/balancer/tokenlists/main/src/assets/images/tokens/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270.png",
"0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4": "https://raw.githubusercontent.com/balancer/tokenlists/main/src/assets/images/tokens/0x3a58a54c066fdc0f2d55fc9c89f0415c92ebf3c4.png"
}
}
]
32 changes: 20 additions & 12 deletions src/components/pool/branded-redirect/BrandedRedirectCard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { BRANDED_REDIRECT_DATA } from './constants';
import xave from '@/assets/images/branded-redirect-logos/xave.png';
import { POOLS } from '@/constants/pools';
const props = defineProps<{
Expand All @@ -13,33 +12,42 @@ const redirectData = computed(() => {
return BRANDED_REDIRECT_DATA[brand];
});
function openRedirectLink() {
const link = redirectData.value?.link;
if (!link) return;
window.open(link, '_blank');
}
const hasBannerImage = computed<boolean>(() => {
return !!redirectData.value?.bannerPath;
});
const bannerSrc = computed<string>(() => {
if (!hasBannerImage.value) return '';
return new URL(redirectData.value?.bannerPath || '', import.meta.url).href;
});
</script>

<template>
<BalStack v-if="redirectData" vertical>
<BalCard shadow="2xl" noPad class="rounded-xl" growContent>
<div class="flex flex-col items-center">
<img class="mb-4" :src="xave" :alt="redirectData.title" />
<div class="px-6 pb-4">
<img v-if="hasBannerImage" :src="bannerSrc" :alt="redirectData.title" />
<div class="py-4 px-6 w-full">
<div class="mb-1.5 text-lg font-semibold">
{{ $t(redirectData.title) }}
</div>
<div class="mb-3">
{{ $t(redirectData.description) }}
</div>
<BalBtn
v-if="redirectData.link"
color="blue"
:label="$t(redirectData.btnText)"
block
@click="openRedirectLink"
/>
tag="a"
:href="redirectData.link"
target="_blank"
rel="noopener noreferrer"
>
{{ $t(redirectData.btnText) }}
<BalIcon name="arrow-up-right" size="sm" class="ml-2" />
</BalBtn>
</div>
</div>
</BalCard>
</BalStack>
</template>
</template>
9 changes: 9 additions & 0 deletions src/components/pool/branded-redirect/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface BrandedRedirectData {
description: string;
btnText: string;
link: string;
bannerPath?: string;
}

export const BRANDED_REDIRECT_DATA: Record<string, BrandedRedirectData> = {
Expand All @@ -13,5 +14,13 @@ export const BRANDED_REDIRECT_DATA: Record<string, BrandedRedirectData> = {
description: 'brandedRedirect.xave.description',
btnText: 'brandedRedirect.xave.btnText',
link: 'https://app.xave.co/',
bannerPath: '/src/assets/images/branded-redirect-logos/xave.png',
},
gyro: {
id: 'gyro',
title: 'brandedRedirect.gyro.title',
description: 'brandedRedirect.gyro.description',
btnText: 'brandedRedirect.gyro.btnText',
link: 'https://app.gyro.finance/',
},
};
Loading

0 comments on commit ef24651

Please sign in to comment.