diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx index a36a89f8f..a282b9e74 100644 --- a/govtool/frontend/src/App.tsx +++ b/govtool/frontend/src/App.tsx @@ -34,7 +34,7 @@ import { useGetDRepInfo, useWalletConnectionListener } from "./hooks"; import { RegisterAsSoleVoter } from "./pages/RegisterAsSoleVoter"; export default function App() { - const { enable, setDRep, setIsDrepLoading } = useCardano(); + const { enable, setVoter, setIsDrepLoading } = useCardano(); const navigate = useNavigate(); const { data } = useGetDRepInfo(); const { modal, openModal, modals } = useModal(); @@ -47,11 +47,11 @@ export default function App() { useEffect(() => { setIsDrepLoading(true); - setDRep(data); + setVoter(data); const timer = setTimeout(() => setIsDrepLoading(false), 1000); return () => clearTimeout(timer); - }, [data?.isRegistered]); + }, [data?.isRegisteredAsDRep, data?.isRegisteredAsSoleVoter]); const checkTheWalletIsActive = useCallback(() => { const hrefCondition = diff --git a/govtool/frontend/src/components/atoms/VotingPowerChips.tsx b/govtool/frontend/src/components/atoms/VotingPowerChips.tsx index 897ec0ce8..ad707be93 100644 --- a/govtool/frontend/src/components/atoms/VotingPowerChips.tsx +++ b/govtool/frontend/src/components/atoms/VotingPowerChips.tsx @@ -13,7 +13,7 @@ import { correctAdaFormat } from "@utils"; import { Tooltip } from "@atoms"; export const VotingPowerChips = () => { - const { dRep, stakeKey, isDrepLoading } = useCardano(); + const { voter, stakeKey, isDrepLoading } = useCardano(); const { dRepVotingPower, isDRepVotingPowerLoading } = useGetDRepVotingPowerQuery(); const { votingPower, powerIsLoading } = @@ -33,7 +33,7 @@ export const VotingPowerChips = () => { alignItems="center" maxHeight={isMobile ? undefined : 48} > - {dRep?.isRegistered && ( + {voter?.isRegisteredAsDRep && ( { {t("votingPower")} )} - {(dRep?.isRegistered && isDRepVotingPowerLoading) || - (!dRep?.isRegistered && powerIsLoading) || + {(voter?.isRegisteredAsDRep && isDRepVotingPowerLoading) || + (!voter?.isRegisteredAsDRep && powerIsLoading) || isDrepLoading ? ( ) : ( @@ -67,7 +67,7 @@ export const VotingPowerChips = () => { sx={{ whiteSpace: "nowrap" }} > ₳{" "} - {dRep?.isRegistered + {voter?.isRegisteredAsDRep ? correctAdaFormat(dRepVotingPower) ?? 0 : correctAdaFormat(votingPower) ?? 0} diff --git a/govtool/frontend/src/components/molecules/DashboardActionCard.tsx b/govtool/frontend/src/components/molecules/DashboardActionCard.tsx index 90cfce5ca..48bd969ec 100644 --- a/govtool/frontend/src/components/molecules/DashboardActionCard.tsx +++ b/govtool/frontend/src/components/molecules/DashboardActionCard.tsx @@ -112,7 +112,7 @@ export const DashboardActionCard: FC = ({ ) : null} {inProgress && !isLoading ? ( - in progress + In Progress ) : null} {description ? ( diff --git a/govtool/frontend/src/components/molecules/VoteActionForm.tsx b/govtool/frontend/src/components/molecules/VoteActionForm.tsx index 3c1645bd2..211d6ad50 100644 --- a/govtool/frontend/src/components/molecules/VoteActionForm.tsx +++ b/govtool/frontend/src/components/molecules/VoteActionForm.tsx @@ -25,7 +25,7 @@ export const VoteActionForm = ({ const [isContext, setIsContext] = useState(false); const { isMobile, screenWidth } = useScreenDimension(); const { openModal } = useModal(); - const { dRep } = useCardano(); + const { voter } = useCardano(); const { t } = useTranslation(); const { @@ -142,7 +142,7 @@ export const VoteActionForm = ({ /> - {dRep?.isRegistered && ( + {voter?.isRegisteredAsDRep && (