Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

id target for sharing proposals #154

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/xgov-dapp/src/features/vote/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,11 @@ function Vote({ sort: sortProp = 'none' }: { sort?: 'ascending' | 'descending' |
.sort(sortQuestions)
.sort(pinPassedQuestions)
.map((question) => (
<div key={question.id} className="col-span-3 grid grid-cols-1 lg:grid-cols-3 gap-4 bg-white rounded-lg">
<div key={question.id} id={`proposal-${question.id}`} className="col-span-3 grid grid-cols-1 lg:grid-cols-3 gap-4 bg-white rounded-lg">
<div className="col-span-2">
{question.metadata && (
<ProposalCard
anchor={`https://xgov.algorand.foundation/vote/${voteId}#proposal-${question.id}`}
title={question.prompt}
description={question.description}
category={question.metadata.category}
Expand Down
4 changes: 4 additions & 0 deletions src/xgov-dapp/src/shared/ProposalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import LaunchIcon from '@mui/icons-material/Launch'
import { Chip, Collapse, LinearProgress, Link, Paper, Typography } from '@mui/material'
import { AbstainChip, CategoryChip, DidNotPassChip, MockProposalChip, PassedChip, VotesNeededToPassChip } from './Chips'
import { useOverflow } from './hooks/useOverflow'
import CopyToClipBoard from '../features/wallet/copyToClipBoard'

export type ProposalCardProps = {
link: string | undefined
Expand All @@ -15,9 +16,11 @@ export type ProposalCardProps = {
votesTally: number | undefined
hasClosed?: boolean
forcePass?: boolean
anchor?: string | any
}

export const ProposalCard = ({
anchor,
link,
title,
description,
Expand Down Expand Up @@ -97,6 +100,7 @@ export const ProposalCard = ({
{focus_area && <Chip className="rounded-lg mr-2" label={focus_area} />}
{category && <CategoryChip category={category} />}
</span>
{anchor && ( <CopyToClipBoard className="text-grey-light align-text-top ml-2 inline-block" valueToCopy={anchor} /> )}
<Link className="text-grey-light align-text-top ml-2 inline-block" href={link} target="_blank">
<LaunchIcon />
</Link>
Expand Down