Skip to content

Commit

Permalink
Proposal shouldn't be open on a new tab (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoncalves authored Jul 23, 2024
1 parent 04dd123 commit 76e64d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/app/proposals/LatestProposalsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { useFetchLatestProposals } from '@/app/proposals/hooks/useFetchLatestProposals'
import { useGetProposalVotes } from '@/app/proposals/hooks/useGetProposalVotes'
import { getEventArguments } from '@/app/proposals/shared/utils'
import { ComparativeProgressBar } from '@/components/ComparativeProgressBar/ComparativeProgressBar'
import { StatusColumn } from '@/app/proposals/StatusColumn'
import { Link } from '@/components/Link'
import { ComparativeProgressBar } from '@/components/ComparativeProgressBar/ComparativeProgressBar'
import { Popover } from '@/components/Popover'
import { Table } from '@/components/Table'
import { Header, Paragraph } from '@/components/Typography'
import { useRouter } from 'next/navigation'
import { useMemo } from 'react'

interface ProposalNameColumnProps {
name: string
proposalId: string
}

const ProposalNameColumn = ({ name, proposalId }: ProposalNameColumnProps) => (
<Link href={`/proposals/${proposalId}`}>{name}</Link>
)
const ProposalNameColumn = ({ name, proposalId }: ProposalNameColumnProps) => {
const router = useRouter()
return (
<button onClick={() => router.push(`/proposals/${proposalId}`)}>
<span className="underline">{name}</span>
</button>
)
}

const VotesColumn = ({ proposalId }: Omit<ProposalNameColumnProps, 'name'>) => {
const data = useGetProposalVotes(proposalId)
Expand Down
2 changes: 1 addition & 1 deletion src/app/proposals/hooks/useVotingPower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useVotingPower = () => {
isLoading,
votingPower: '-',
canCreateProposal: false,
threshold: undefined,
threshold: '',
}
}

Expand Down

0 comments on commit 76e64d0

Please sign in to comment.