diff --git a/src/devhub/entity/trustee/approvals.jsx b/src/devhub/entity/trustee/approvals.jsx deleted file mode 100644 index c624c6e5f..000000000 --- a/src/devhub/entity/trustee/approvals.jsx +++ /dev/null @@ -1,223 +0,0 @@ -const { getRelativeTime } = VM.require( - "${REPL_DEVHUB}/widget/core.lib.timeUtils" -); - -getRelativeTime || (getRelativeTime = () => {}); -const treasuryDaoID = "${REPL_TREASURY_CONTRACT}"; -const resPerPage = 50; -const [currentPage, setPage] = useState(0); -const [expandSummaryIndex, setExpandSummary] = useState({}); -const proposals = Near.view(treasuryDaoID, "get_proposals", { - from_index: currentPage === 0 ? currentPage : (currentPage - 1) * resPerPage, - limit: resPerPage, -}); - -const lastProposalID = Near.view(treasuryDaoID, "get_last_proposal_id", {}); -if (proposals === null || lastProposalID === null) { - return <>>; -} - -const onPay = (id) => { - Near.call({ - contractName: treasuryDaoID, - methodName: "act_proposal", - args: { - id: id, - action: "VoteApprove", - memo: "", - }, - gas: Big(10).pow(14), - }); -}; - -const Container = styled.div` - font-size: 13px; - - .text-grey { - color: #b9b9b9 !important; - } - - .card-custom { - border-radius: 5px; - background-color: white; - } - - .text-size-2 { - font-size: 15px; - } - - .text-dark-grey { - color: #687076; - } - - .text-grey-100 { - background-color: #f5f5f5; - } - - td { - padding: 0.5rem; - color: inherit; - } - - .overflow { - overflow: auto; - } - - .max-w-100 { - max-width: 100%; - } - - button { - background-color: #04a46e; - color: white; - border: none; - font-weight: 600; - font-size: 14px; - } -`; - -// filter transfer proposals -const transferProposals = proposals.filter((item) => { - if (item.kind?.FunctionCall?.actions?.[0]?.method_name) { - return ( - item.kind.FunctionCall.actions[0].method_name === "ft_transfer" && - item.status === "InProgress" - ); - } - return false; -}); - -const ProposalsComponent = () => { - return ( -
- {transferProposals?.map((item, index) => { - // decode args - const actions = item.kind?.FunctionCall?.actions?.[0]; - const args = JSON.parse(atob(actions?.args ?? "")); - const isReceiverkycbVerified = true; - const isNEAR = true; - const address = item.token; - let ftMetadata = { - symbol: "NEAR", - decimals: 24, - }; - if (!isNEAR) { - ftMetadata = Near.view(address, "ft_metadata", {}); - if (ftMetadata === null) return null; - } - // let amount = amountWithDecimals; - // if (amountWithoutDecimals !== undefined) { - // amount = Big(amountWithoutDecimals) - // .div(Big(10).pow(ftMetadata.decimals)) - // .toString(); - // } - - return ( -ID | -PROPOSAL | -FROM | -TO | -KYC/B VERIFIED | -TOKEN | -AMOUNT | -CREATED | -PAY | -
ID | -PROPOSAL | -FROM | -TO | -KYC/B VERIFIED | -TOKEN | -AMOUNT | -APPROVER | -TRANSACTION | -WHEN | -
Balance
-- {convertYoctoToNear(res.body?.account[0]?.amount)} -
-Transactions
-{txns?.body?.txns?.[0]?.count}
-