diff --git a/components/groups/modals/voteDetailsModal.tsx b/components/groups/modals/voteDetailsModal.tsx index 8eae8f4a..34e7b37b 100644 --- a/components/groups/modals/voteDetailsModal.tsx +++ b/components/groups/modals/voteDetailsModal.tsx @@ -22,7 +22,7 @@ import { useTheme } from '@/contexts/theme'; import CountdownTimer from '../components/CountdownTimer'; import { useFeeEstimation } from '@/hooks'; -import { TrashIcon } from '@heroicons/react/24/outline'; +import { ShareIcon, TrashIcon, CheckIcon } from '@heroicons/react/24/outline'; const Chart = dynamic(() => import('react-apexcharts'), { ssr: false, }) as any; @@ -419,9 +419,18 @@ function VoteDetailsModal({ return { action: null, label: null }; }, [proposal, proposalClosed, userHasVoted, address]); + const [copied, setCopied] = useState(false); + + const copyProposalLink = () => { + const url = `${window.location.origin}/groups?policyAddress=${proposal?.group_policy_address}&proposalId=${proposal?.id}`; + navigator.clipboard.writeText(url); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }; + return ( -
+
-
-

SUMMARY

-
-

{proposal?.summary}

+ {proposal?.summary && ( +
+

SUMMARY

+
+

{proposal?.summary}

+
-
+ )}

MESSAGES

-
+
{proposal?.messages?.map((message: any, index: number) => { const messageType = message['@type']; const fieldsToShow = importantFields[messageType] || defaultFields; @@ -503,6 +514,21 @@ function VoteDetailsModal({

+
+ +
@@ -562,6 +588,21 @@ function VoteDetailsModal({

+
+ +
{getButtonState.action && (