From b610c8d76f5c207885b846fb1807987d75b30342 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Tue, 18 Jun 2024 12:00:24 +0700 Subject: [PATCH 1/4] update sort validators mobile --- .../ValidatorCardList/ValidatorCardList.js | 230 +++++++++--------- 1 file changed, 116 insertions(+), 114 deletions(-) diff --git a/src/components/ValidatorList/ValidatorCardList/ValidatorCardList.js b/src/components/ValidatorList/ValidatorCardList/ValidatorCardList.js index 790a8ea0..90efd807 100644 --- a/src/components/ValidatorList/ValidatorCardList/ValidatorCardList.js +++ b/src/components/ValidatorList/ValidatorCardList/ValidatorCardList.js @@ -1,13 +1,13 @@ // @ts-nocheck -import React, {memo, useMemo} from "react"; -import {NavLink} from "react-router-dom"; +import React, { memo, useMemo } from "react"; +import { NavLink } from "react-router-dom"; import classNames from "classnames/bind"; import consts from "src/constants/consts"; -import {formatPercentage, formatInteger, formatOrai} from "src/helpers/helper"; -import {computeTotalVotingPower} from "src/components/ValidatorList/ValidatorTable/ValidatorTable"; +import { formatPercentage, formatInteger, formatOrai, groupAndShuffle } from "src/helpers/helper"; +import { computeTotalVotingPower } from "src/components/ValidatorList/ValidatorTable/ValidatorTable"; import aiIcon from "src/assets/common/ai_ic.svg"; -import {logoBrand} from "src/constants/logoBrand"; -import {Progress} from "antd"; +import { logoBrand } from "src/constants/logoBrand"; +import { Progress } from "antd"; import Delegate from "src/components/common/Delegate"; import styles from "./ValidatorCardList.module.scss"; import "./style.css"; @@ -22,136 +22,138 @@ const getCumulativeShareCell = (previousValue, currentValue, totalValue) => { return (
-
-
+
+
{totalPercent} %
); }; -const ValidatorCardList = memo(({data = []}) => { +const ValidatorCardList = memo(({ data = [] }) => { const totalVotingPower = useMemo(() => computeTotalVotingPower(data), [data]); let previousVotingPower = 0; return (
- {data?.map((item, index) => { - let currentVotingPower = 0; - let votingPowerDataCell = ( -
-
-
-
- %
-
- ); - if (item?.voting_power && totalVotingPower > 0) { - currentVotingPower = parseFloat(item.voting_power); - votingPowerDataCell = ( + {groupAndShuffle(data, 5) + ?.flat() + ?.map((item, index) => { + let currentVotingPower = 0; + let votingPowerDataCell = (
- {formatInteger(currentVotingPower)} - {formatPercentage(currentVotingPower / totalVotingPower, 2)}% +
-
+
- %
); - } + if (item?.voting_power && totalVotingPower > 0) { + currentVotingPower = parseFloat(item.voting_power); + votingPowerDataCell = ( +
+ {formatInteger(currentVotingPower)} + {formatPercentage(currentVotingPower / totalVotingPower, 2)}% +
+ ); + } - const cumulativeShareDataCell = getCumulativeShareCell(previousVotingPower, currentVotingPower, totalVotingPower); - previousVotingPower += currentVotingPower; - const estAPR = item?.apr.toFixed(2); + const cumulativeShareDataCell = getCumulativeShareCell(previousVotingPower, currentVotingPower, totalVotingPower); + previousVotingPower += currentVotingPower; + const estAPR = item?.apr.toFixed(2); - const logoItem = logoBrand.find(it => item.operator_address === it.operatorAddress); - const logo = item?.image ? item?.image : logoItem; - const logoURL = logo ? (typeof logo === "object" ? logo.logo : logo) : false; - const validatorCardListItem = ( -
- - - - - - + const logoItem = logoBrand.find(it => item.operator_address === it.operatorAddress); + const logo = item?.image ? item?.image : logoItem; + const logoURL = logo ? (typeof logo === "object" ? logo.logo : logo) : false; + const validatorCardListItem = ( +
+
-
Rank
-
-
{item?.rank ?? "-"}
-
+ + + + + - - - - + + + + - - - + + + - - - + + + - - + - - + + + - - - - - -
+
Rank
+
+
{item?.rank ?? "-"}
+
-
Proposer
-
- {item?.moniker ? ( - - {logoURL && /} - {!logoURL &&
{item.moniker.substring(0, 3).toUpperCase()}
} - {item.moniker} -
- ) : ( -
-
- )} -
+
Proposer
+
+ {item?.moniker ? ( + + {logoURL && /} + {!logoURL &&
{item.moniker.substring(0, 3).toUpperCase()}
} + {item.moniker} +
+ ) : ( +
-
+ )} +
-
Voting power
- {votingPowerDataCell} -
+
Voting power
+ {votingPowerDataCell} +
-
Cumulative Share %
- {cumulativeShareDataCell} -
+
Cumulative Share %
+ {cumulativeShareDataCell} +
-
Uptime
-
-
{item?.uptime ? formatPercentage(item.uptime, 2) + "%" : "-"}
-
- {item?.uptime && ( - - )} +
+
Uptime
+
+
{item?.uptime ? formatPercentage(item.uptime, 2) + "%" : "-"}
+
+ {item?.uptime && ( + + )} +
- -
-
Commisson
-
{item?.commission_rate ? formatPercentage(item.commission_rate, 2) + "%" : "-"}
-
+
Commisson
+
{item?.commission_rate ? formatPercentage(item.commission_rate, 2) + "%" : "-"}
+
-
Self Bonded
-
- {formatOrai(item?.self_bonded)} - ORAI -
-
- -
-
- ); + + +
Self Bonded
+
+ {formatOrai(item?.self_bonded)} + ORAI +
+ + + + + + + +
+ ); - return validatorCardListItem; - })} + return validatorCardListItem; + })} ); }); From a4db42cc9593a7b945b88aa11f41fb94aaf63406 Mon Sep 17 00:00:00 2001 From: ledanghuy1811 Date: Wed, 19 Jun 2024 20:44:55 +0700 Subject: [PATCH 2/4] fix: change price usdc to usd-coin --- .npmrc | 1 + src/constants/priceBalance.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..6790ef2d --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +python = "/usr/bin/python3" \ No newline at end of file diff --git a/src/constants/priceBalance.js b/src/constants/priceBalance.js index 3fb64b53..44b22496 100644 --- a/src/constants/priceBalance.js +++ b/src/constants/priceBalance.js @@ -9997,7 +9997,7 @@ export const priceBalance = { urub: "urubit", urus: "urus-token", usdb: "usd-bancor", - usdc: "usd-coin-avalanche-bridged-usdc-e", + usdc: "usd-coin", usdcpo: "usd-coin-pos-wormhole", usdcso: "usd-coin-wormhole", usdcav: "usd-coin-wormhole-from-avalanche", From d5c565f51b694d6d7f0d6fcb0961b0524d094806 Mon Sep 17 00:00:00 2001 From: ledanghuy1811 Date: Thu, 20 Jun 2024 11:12:08 +0700 Subject: [PATCH 3/4] update footer update header update cupiee and defilens to ecosystem header --- src/components/Footer/Footer/Footer.js | 76 +++++++++++++++++---- src/components/Header/NavBar/NavBar.js | 91 ++++++++++++++------------ 2 files changed, 113 insertions(+), 54 deletions(-) diff --git a/src/components/Footer/Footer/Footer.js b/src/components/Footer/Footer/Footer.js index 1413f345..ad6a5381 100644 --- a/src/components/Footer/Footer/Footer.js +++ b/src/components/Footer/Footer/Footer.js @@ -55,7 +55,12 @@ const Footer = memo(() => { Token
  • - + + Contracts + +
  • +
  • + Get ORAI
  • @@ -65,8 +70,18 @@ const Footer = memo(() => {
  • - - Oraichain Wallet + + OWallet + +
  • +
  • + + OraiDex + +
  • +
  • + + OraiBridge
  • @@ -82,21 +97,26 @@ const Footer = memo(() => { Ecosystem
  • - - Network + + Mainnet
  • - - Oraichain VRF 2.0 + + Cupiee
  • - - OraiDEX + + DeFi Lens
  • + + Oraichain VRF 2.0 + +
  • + {/*
  • { target='_blank'> AI Marketplace -
  • + */}
  • aiRight
  • - + + Kawaiiverse + +
  • + +
  • + Other DApps
  • @@ -150,6 +176,16 @@ const Footer = memo(() => { Blog +
  • + + Support + +
  • +
  • + + Team + +
  • @@ -175,6 +211,22 @@ const Footer = memo(() => { CosmWasm IDE +
  • + + Accelerator Program + +
  • +
  • + + Careers + +
  • @@ -201,7 +253,7 @@ const Footer = memo(() => {
    - ©️ 2020 - 2023 Oraichain Foundation. All rights reserved.{" "} + ©️ 2020 - {new Date().getFullYear()} Oraichain Foundation. All rights reserved.{" "} Date: Wed, 26 Jun 2024 13:44:02 +0700 Subject: [PATCH 4/4] update header and footer with sign commit --- src/components/Footer/Footer/Footer.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/components/Footer/Footer/Footer.js b/src/components/Footer/Footer/Footer.js index ad6a5381..1a5e6deb 100644 --- a/src/components/Footer/Footer/Footer.js +++ b/src/components/Footer/Footer/Footer.js @@ -116,22 +116,6 @@ const Footer = memo(() => { Oraichain VRF 2.0 - {/*
  • - - Data Hub - -
  • -
  • - - AI Marketplace - -
  • */}
  • aiRight