From 104bc8666402ad2af3cc1b9c3144c48b5f6b8386 Mon Sep 17 00:00:00 2001 From: hyifeng Date: Fri, 29 Mar 2024 12:52:48 +0800 Subject: [PATCH] Move external call to business tab, #3781 (#4066) * Move external call to business tab, #3781 * Update --- .../next-common/components/collective/call.jsx | 16 +--------------- .../hooks/useCouncilMotionBusinessData.jsx | 13 +++++++++++++ packages/next/components/motion/motionDetail.js | 5 +---- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/next-common/components/collective/call.jsx b/packages/next-common/components/collective/call.jsx index c66eb426cc..c0dfca553f 100644 --- a/packages/next-common/components/collective/call.jsx +++ b/packages/next-common/components/collective/call.jsx @@ -9,7 +9,7 @@ import { useChain } from "next-common/context/chain"; import { useDetailType } from "next-common/context/page"; import Copyable from "../copyable"; -export default function CollectiveCall({ call, externalProposals }) { +export default function CollectiveCall({ call }) { const motion = usePostOnChainData(); const chain = useChain(); const detailType = useDetailType(); @@ -19,20 +19,6 @@ export default function CollectiveCall({ call, externalProposals }) { [], ]; - (externalProposals || []).forEach((item) => { - if (!item?.preImage) { - return; - } - data.push([ - , - ]); - }); - if ( Chains.zeitgeist === chain && detailPageCategory.ADVISORY_MOTION === detailType diff --git a/packages/next-common/hooks/useCouncilMotionBusinessData.jsx b/packages/next-common/hooks/useCouncilMotionBusinessData.jsx index 9b7fd425a6..222a34c712 100644 --- a/packages/next-common/hooks/useCouncilMotionBusinessData.jsx +++ b/packages/next-common/hooks/useCouncilMotionBusinessData.jsx @@ -4,6 +4,7 @@ import Flex from "next-common/components/styled/flex"; import SymbolBalance from "next-common/components/values/symbolBalance"; import Copyable from "next-common/components/copyable"; import AddressUser from "next-common/components/user/addressUser"; +import Proposal from "next-common/components/proposal"; export function useCouncilMotionBusinessData() { const motion = usePostOnChainData(); @@ -100,6 +101,18 @@ export function useCouncilMotionBusinessData() { ["Hash", {external.proposalHash}], ["Threshold", external.voteThreshold], ]); + + if (external.preImage) { + business.push([ + [ + , + ], + ]); + } }); } diff --git a/packages/next/components/motion/motionDetail.js b/packages/next/components/motion/motionDetail.js index c26ce8c391..2b9ee1e367 100644 --- a/packages/next/components/motion/motionDetail.js +++ b/packages/next/components/motion/motionDetail.js @@ -151,10 +151,7 @@ export default function MotionDetail() { + ) } business={