diff --git a/src/components/global/Breadcrumbs.jsx b/src/components/global/Breadcrumbs.jsx new file mode 100644 index 00000000..1e94ed30 --- /dev/null +++ b/src/components/global/Breadcrumbs.jsx @@ -0,0 +1,30 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; + +/** + * Simple breadcrumb navigation + * @param {Array<{label: string, to?: string}>} items + */ +const Breadcrumbs = ({ items = [] }) => { + if (!items.length) return null; + return ( + + ); +}; + +export default Breadcrumbs; + diff --git a/src/components/governance/AddressList.jsx b/src/components/governance/AddressList.jsx index 1ee61213..12b6e5bb 100644 --- a/src/components/governance/AddressList.jsx +++ b/src/components/governance/AddressList.jsx @@ -181,9 +181,12 @@ const AddressList = ({proposal, vote, onAfterVote}) => { // }) }) .catch(err => { + const message = (voteData === 'Invalid network version') + ? 'Invalid network version' + : (err?.response?.data?.message || err?.message || 'Unknown error'); addressErrorVote.push({ name: address.name, - err: (voteData === 'Invalid network version') ? 'Invalid network version' : err.response.data.message + err: message }) }); } @@ -233,9 +236,12 @@ const AddressList = ({proposal, vote, onAfterVote}) => { > ) : ( <> - { - loadingAddress &&
Loading...
- } + {loadingAddress && ( +You don't have a voting address please add one
} diff --git a/src/components/governance/ProposalCard.jsx b/src/components/governance/ProposalCard.jsx index f360b6fc..dc02e39b 100644 --- a/src/components/governance/ProposalCard.jsx +++ b/src/components/governance/ProposalCard.jsx @@ -1,9 +1,10 @@ -import React, { useEffect, useState } from "react"; +import React, { useEffect, useState, useRef } from "react"; import { useTranslation } from "react-i18next"; import { Collapse } from "react-collapse"; import swal from "sweetalert2"; import { useUser } from "../../context/user-context"; +import { VOTE_OUTCOME } from "../../constants/votes"; import ProposalCardInfo from "./ProposalCardInfo"; import CustomModal from "../global/CustomModal"; import AddressList from "./AddressList"; @@ -35,6 +36,9 @@ function ProposalCard({ proposal, enabled, userInfo, onLoadProposals }) { const [month_remaining, setMonth_remaining] = useState(0); const [payment_type, setPayment_type] = useState(""); const [vote, setVote] = useState(""); + const titleButtonRef = useRef(null); + const touchStartX = useRef(null); + const touchStartY = useRef(null); /** * UseEffect that calculates the approx payment dates of the current proposal @@ -74,6 +78,8 @@ function ProposalCard({ proposal, enabled, userInfo, onLoadProposals }) { }; }, [proposal]); + + /** * Function that receives a string of a number with , as separator and returns it without it * @function @@ -157,7 +163,7 @@ function ProposalCard({ proposal, enabled, userInfo, onLoadProposals }) { }; return ( -