From f7ebe14799f7681b2c0bc9fd8eb5ecd9d5bb3242 Mon Sep 17 00:00:00 2001 From: Teto Gomez Date: Wed, 22 Feb 2023 20:47:05 -0600 Subject: [PATCH 1/2] fix: fix issues related to delegator page --- public/locales/cn/common.json | 10 +++++-- public/locales/en/common.json | 10 +++++-- public/locales/es/common.json | 10 +++++-- public/locales/ko/common.json | 10 +++++-- src/components/AuthUAL/index.tsx | 9 ++---- src/components/CountdownTimer/index.tsx | 36 +++++++++++++++++++++--- src/components/CountdownTimer/styles.ts | 24 ++++++++++++++++ src/components/Sidebar/index.tsx | 4 ++- src/hooks/useCountdown/index.ts | 11 ++++++-- src/hooks/useUAL/index.tsx | 35 ++++++++++++++--------- src/pages/delegator/DelegatorActions.tsx | 31 ++++++++++++++++---- src/pages/delegator/styles.ts | 11 +++++++- src/utils/smart-proxy.ts | 11 ++++++-- 13 files changed, 166 insertions(+), 46 deletions(-) create mode 100644 src/components/CountdownTimer/styles.ts diff --git a/public/locales/cn/common.json b/public/locales/cn/common.json index b1e5a9a..84cbec2 100644 --- a/public/locales/cn/common.json +++ b/public/locales/cn/common.json @@ -11,6 +11,10 @@ "searchName": "按名称搜索", "buttonLabel": "委托票权", "buttonLabelDelegate": "委托", + "days": "days", + "hrs": "hrs", + "mins": "mins", + "secs": "secs", "routes": { "/": "主页", "voters": "投票成员", @@ -142,13 +146,15 @@ "yourRewards": "Your Rewards", "legend": "The reward isn't activated now. If you want to urge BPs to activate direct inflation reward, please indicate how much inflation should be dedicated system-wide none-vote-buy reward. Choose: 0%, 0.25%, 0.5%, 0.75%, 1%.", "delegateVoteMessage": "Vote Delegaded Successfully", + "undelegateVoteMessage": "Vote Undelegaded Successfully", "somethingWrong": "Something went wrong, try again.", "claimMessage": "Reward Claimed", "recipientMessage": "Recipient Changed", "account": "Account", "active": "Active", - "undelegate": "Undelegate", + "undelegated": "Undelegate", "signupMessage": "Your account needs one more step to access this page, please click on the validate button to continue.", - "distributionLabel": "Estimated time to next distribution" + "distributionLabel": "Estimated time to next distribution", + "close": "Close" } } diff --git a/public/locales/en/common.json b/public/locales/en/common.json index f758117..4640ccc 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -11,6 +11,10 @@ "searchName": "Search by name", "buttonLabel": "Delegate Vote", "buttonLabelDelegate": "Delegate", + "days": "days", + "hrs": "hrs", + "mins": "mins", + "secs": "secs", "routes": { "/": "Home", "voters": "Members", @@ -142,13 +146,15 @@ "yourRewards": "Your Rewards", "legend": "The reward isn't activated now. If you want to urge BPs to activate direct inflation reward, please indicate how much inflation should be dedicated system-wide none-vote-buy reward. Choose: 0%, 0.25%, 0.5%, 0.75%, 1%.", "delegateVoteMessage": "Vote Delegaded Successfully", + "undelegateVoteMessage": "Vote Undelegaded Successfully", "somethingWrong": "Something went wrong, try again.", "claimMessage": "Reward Claimed", "recipientMessage": "Recipient Changed", "account": "Account", "active": "Active", - "undelegate": "Undelegate", + "undelegated": "Undelegate", "signupMessage": "Your account needs one more step to access this page, please click on the validate button to continue.", - "distributionLabel": "Estimated time to next distribution" + "distributionLabel": "Estimated time to next distribution", + "close": "Close" } } diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 7d05702..e22ef73 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -11,6 +11,10 @@ "searchName": "Buscar por nombre", "buttonLabel": "Delegar voto", "buttonLabelDelegate": "Delegar", + "days": "días", + "hrs": "hrs", + "mins": "mins", + "secs": "segs", "routes": { "/": "Hogar", "voters": "Miembros", @@ -142,13 +146,15 @@ "yourRewards": "Tus recompensas", "legend": "La recompensa no está activada ahora. Si desea instar a los BP a activar la recompensa de inflación directa, indique cuánta inflación debe dedicarse a la recompensa de compra sin voto en todo el sistema. Elija: 0%, 0.25% , 0,5%, 0,75%, 1%.", "delegateVoteMessage": "Voto Delegado Exitosamente", + "undelegateVoteMessage": "Voto sin Delegar Exitosamente", "somethingWrong": "Algo salió mal, inténtalo de nuevo", "claimMessage": "Recompensa Reclamada", "recipientMessage": "Destinatario cambiado", "account": "Cuenta", "active": "Activo", - "undelegado": "Anular el delegado", + "undelegated": "Anular el delegado", "signupMessage": "Tu cuenta necesita un paso más para poder acceder a esta página, por favor has click en en boton de validar para poder continuar.", - "distributionLabel": "tiempo estimado para la siguiente distribución" + "distributionLabel": "tiempo estimado para la siguiente distribución", + "close": "Cerrar" } } diff --git a/public/locales/ko/common.json b/public/locales/ko/common.json index 3a63a96..b8ca26d 100644 --- a/public/locales/ko/common.json +++ b/public/locales/ko/common.json @@ -11,6 +11,10 @@ "searchName": "이름으로 찾기", "buttonLabel": "투표 위임", "buttonLabelDelegate": "투표", + "days": "days", + "hrs": "hrs", + "mins": "mins", + "secs": "secs", "routes": { "/": "메인", "voters": "투표자 조회", @@ -143,13 +147,15 @@ "yourRewards": "Your Rewards", "legend": "The reward isn't activated now. If you want to urge BPs to activate direct inflation reward, please indicate how much inflation should be dedicated system-wide none-vote-buy reward. Choose: 0%, 0.25%, 0.5%, 0.75%, 1%.", "delegateVoteMessage": "Vote Delegaded Successfully", + "undelegateVoteMessage": "Vote Undelegaded Successfully", "somethingWrong": "Something went wrong, try again.", "claimMessage": "Reward Claimed", "recipientMessage": "Recipient Changed", "account": "Account", "active": "Active", - "undelegate": "Undelegate", + "undelegated": "Undelegate", "signupMessage": "Your account needs one more step to access this page, please click on the validate button to continue.", - "distributionLabel": "Estimated time to next distribution" + "distributionLabel": "Estimated time to next distribution", + "close": "Close" } } diff --git a/src/components/AuthUAL/index.tsx b/src/components/AuthUAL/index.tsx index d8438aa..d3f16ef 100644 --- a/src/components/AuthUAL/index.tsx +++ b/src/components/AuthUAL/index.tsx @@ -1,6 +1,6 @@ -import { Button, Spinner } from '@edenia/ui-kit' +import { Button } from '@edenia/ui-kit' import { useTranslation } from 'next-i18next' -import { useState, useEffect } from 'react' +import { useEffect } from 'react' import useAuthUAL from './useAuthUAL.hook' import useStyles from './styles' @@ -10,19 +10,16 @@ const AuthButton: React.FC<{ setMessage(value: any): void }> = ({ btnLabel, setMessage }) => { const [{ state }, { login }] = useAuthUAL() - const [loader, setLoader] = useState(false) const { t } = useTranslation() const classes = useStyles() const handleLogin = async () => { - setLoader(true) await login('anchor') } useEffect(() => { if (state?.validUser === undefined || state?.validUser) return - setLoader(false) setMessage({ severity: 'warning', message: t('home.noEdenMember'), @@ -35,8 +32,6 @@ const AuthButton: React.FC<{ {!state?.ual?.activeUser && (