mirror of
https://github.com/cerc-io/mars-interface.git
synced 2024-12-22 04:07:44 +00:00
v1.3.1
### Updates ### New Features - Feat: Dockerfile enhanced to accept environmental arguments on build - Feat: added version number to the footer ### Fixes and Refactoring - Fix: APR endpoint for Apollo vaults - Fix: mobile farm table data
This commit is contained in:
parent
193bb0f2d6
commit
e65eb2ac64
32
.github/workflows/docker-image.yml
vendored
32
.github/workflows/docker-image.yml
vendored
@ -2,24 +2,24 @@ name: Docker Image CI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: marsprotocol/interface:latest
|
tags: marsprotocol/interface:latest, marsprotocol/interface:${{ github.run_number }}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "mars",
|
"name": "mars",
|
||||||
"homepage": "./",
|
"homepage": "./",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"private": false,
|
"private": false,
|
||||||
"license": "SEE LICENSE IN LICENSE FILE",
|
"license": "SEE LICENSE IN LICENSE FILE",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
@import 'src/styles/master';
|
@import 'src/styles/master';
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
@include padding(8, 0, 24);
|
@include padding(8, 0, 20);
|
||||||
background-color: $backgroundFooter;
|
background-color: $backgroundFooter;
|
||||||
display: grid;
|
display: grid;
|
||||||
place-content: center;
|
place-content: center;
|
||||||
@ -88,11 +88,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.version {
|
||||||
|
@include padding(0, 0, 4);
|
||||||
|
p {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: $bpMediumLow) {
|
@media only screen and (min-width: $bpMediumLow) {
|
||||||
.footer {
|
.footer {
|
||||||
@include padding(8, 0);
|
@include padding(8, 0, 0);
|
||||||
left: space(-4);
|
left: space(-4);
|
||||||
width: calc(100% + (8 * #{$spacingBase}px));
|
width: calc(100% + (8 * #{$spacingBase}px));
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next'
|
|||||||
import useStore from 'store'
|
import useStore from 'store'
|
||||||
import { DocURL } from 'types/enums/docURL'
|
import { DocURL } from 'types/enums/docURL'
|
||||||
|
|
||||||
|
import { version } from '../../../../package.json'
|
||||||
import styles from './Footer.module.scss'
|
import styles from './Footer.module.scss'
|
||||||
|
|
||||||
export const Footer = () => {
|
export const Footer = () => {
|
||||||
@ -209,6 +210,9 @@ export const Footer = () => {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles.version}>
|
||||||
|
<p className='faded xs'>Mars Protocol v{version}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
)
|
)
|
||||||
|
@ -10,6 +10,7 @@ import {
|
|||||||
import { Loading } from 'components/common'
|
import { Loading } from 'components/common'
|
||||||
import { VaultLogo, VaultName } from 'components/fields'
|
import { VaultLogo, VaultName } from 'components/fields'
|
||||||
import { FIELDS_TUTORIAL_KEY } from 'constants/appConstants'
|
import { FIELDS_TUTORIAL_KEY } from 'constants/appConstants'
|
||||||
|
import { getLiqBorrowValue, getMaxBorrowValue } from 'functions/fields'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
import useStore from 'store'
|
import useStore from 'store'
|
||||||
@ -56,6 +57,8 @@ export const ActiveVaultsTableMobile = () => {
|
|||||||
>
|
>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
{activeVaults.map((vault, i) => {
|
{activeVaults.map((vault, i) => {
|
||||||
|
const maxBorrowValue = getMaxBorrowValue(vault, vault.position)
|
||||||
|
|
||||||
const content = (
|
const content = (
|
||||||
<div key={`${vault.address}-${i}`} className={styles.grid}>
|
<div key={`${vault.address}-${i}`} className={styles.grid}>
|
||||||
<div className={styles.logo}>
|
<div className={styles.logo}>
|
||||||
@ -133,9 +136,9 @@ export const ActiveVaultsTableMobile = () => {
|
|||||||
<div className={styles.borrowCapacity}>
|
<div className={styles.borrowCapacity}>
|
||||||
<BorrowCapacity
|
<BorrowCapacity
|
||||||
showPercentageText={true}
|
showPercentageText={true}
|
||||||
max={10}
|
max={getLiqBorrowValue(vault, maxBorrowValue)}
|
||||||
limit={8}
|
limit={maxBorrowValue}
|
||||||
balance={7}
|
balance={vault.position.values.borrowed}
|
||||||
showTitle={false}
|
showTitle={false}
|
||||||
barHeight={'16px'}
|
barHeight={'16px'}
|
||||||
hideValues
|
hideValues
|
||||||
|
@ -158,15 +158,25 @@ export const vaultsSlice = (set: NamedSet<Store>, get: GetState<Store>): VaultsS
|
|||||||
const response = await fetch(networkConfig!.apolloAprUrl)
|
const response = await fetch(networkConfig!.apolloAprUrl)
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data: AprResponse[] = await response.json()
|
const data: FlatApr[] | NestedApr[] = await response.json()
|
||||||
|
|
||||||
const newAprs = data.map((aprData) => {
|
const newAprs = data.map((aprData) => {
|
||||||
const aprTotal = aprData.apr.reduce((prev, curr) => Number(curr.value) + prev, 0)
|
try {
|
||||||
const feeTotal = aprData.fees.reduce((prev, curr) => Number(curr.value) + prev, 0)
|
const apr = aprData as FlatApr
|
||||||
|
const aprTotal = apr.apr.reduce((prev, curr) => Number(curr.value) + prev, 0)
|
||||||
|
const feeTotal = apr.fees.reduce((prev, curr) => Number(curr.value) + prev, 0)
|
||||||
|
|
||||||
const finalApr = aprTotal + feeTotal
|
const finalApr = aprTotal + feeTotal
|
||||||
|
|
||||||
return { contractAddress: aprData.contract_address, apr: finalApr }
|
return { contractAddress: aprData.contract_address, apr: finalApr }
|
||||||
|
} catch {
|
||||||
|
const apr = aprData as NestedApr
|
||||||
|
const aprTotal = apr.apr.aprs.reduce((prev, curr) => Number(curr.value) + prev, 0)
|
||||||
|
const feeTotal = apr.apr.fees.reduce((prev, curr) => Number(curr.value) + prev, 0)
|
||||||
|
|
||||||
|
const finalApr = aprTotal + feeTotal
|
||||||
|
return { contractAddress: aprData.contract_address, apr: finalApr }
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
set({
|
set({
|
||||||
|
10
src/types/interfaces/fields.d.ts
vendored
10
src/types/interfaces/fields.d.ts
vendored
@ -100,12 +100,20 @@ interface AprData {
|
|||||||
apr: number
|
apr: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AprResponse {
|
interface FlatApr {
|
||||||
contract_address: string
|
contract_address: string
|
||||||
apr: { type: string; value: number | string }[]
|
apr: { type: string; value: number | string }[]
|
||||||
fees: { type: string; value: number | string }[]
|
fees: { type: string; value: number | string }[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface NestedApr {
|
||||||
|
contract_address: string
|
||||||
|
apr: {
|
||||||
|
aprs: { type: string; value: number | string }[]
|
||||||
|
fees: { type: string; value: number | string }[]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
interface VaultCapData {
|
interface VaultCapData {
|
||||||
address: string
|
address: string
|
||||||
vaultCap: {
|
vaultCap: {
|
||||||
|
Loading…
Reference in New Issue
Block a user