diff --git a/packages/proposals/src/components/Proposal/RegisterToVote.tsx b/packages/proposals/src/components/Proposal/RegisterToVote.tsx deleted file mode 100644 index 9f104a7..0000000 --- a/packages/proposals/src/components/Proposal/RegisterToVote.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import { ParsedAccount } from '@oyster/common'; -import { Button, Col, Modal, Row, Slider } from 'antd'; -import React, { useState } from 'react'; -import { - TimelockConfig, - TimelockSet, - TimelockState, - TimelockStateStatus, - VotingEntryRule, -} from '../../models/timelock'; -import { LABELS } from '../../constants'; -import { depositSourceTokens } from '../../actions/depositSourceTokens'; -import { contexts, hooks } from '@oyster/common'; -import { ExclamationCircleOutlined } from '@ant-design/icons'; - -const { useWallet } = contexts.Wallet; -const { useConnection } = contexts.Connection; -const { useAccountByMint } = hooks; - -const { confirm } = Modal; -export function RegisterToVote({ - proposal, - state, - timelockConfig, -}: { - proposal: ParsedAccount; - state: ParsedAccount; - timelockConfig: ParsedAccount; -}) { - const wallet = useWallet(); - const connection = useConnection(); - const voteAccount = useAccountByMint(proposal.info.votingMint); - const yesVoteAccount = useAccountByMint(proposal.info.yesVotingMint); - const noVoteAccount = useAccountByMint(proposal.info.noVotingMint); - - const userTokenAccount = useAccountByMint(proposal.info.sourceMint); - const alreadyHaveTokens = - (voteAccount && voteAccount.info.amount.toNumber() > 0) || - (yesVoteAccount && yesVoteAccount.info.amount.toNumber() > 0) || - (noVoteAccount && noVoteAccount.info.amount.toNumber() > 0); - - const eligibleToView = - timelockConfig.info.votingEntryRule == VotingEntryRule.Anytime && - [TimelockStateStatus.Draft, TimelockStateStatus.Voting].includes( - state.info.status, - ); - - const [_, setTokenAmount] = useState(1); - return eligibleToView ? ( - - ) : null; -} diff --git a/packages/proposals/src/components/Proposal/Vote.tsx b/packages/proposals/src/components/Proposal/Vote.tsx deleted file mode 100644 index 24cbe0c..0000000 --- a/packages/proposals/src/components/Proposal/Vote.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { ParsedAccount } from '@oyster/common'; -import { Button, Col, Modal, Row, Slider, Switch } from 'antd'; -import React, { useState } from 'react'; -import { - TimelockConfig, - TimelockSet, - TimelockState, - TimelockStateStatus, -} from '../../models/timelock'; -import { LABELS } from '../../constants'; -import { vote } from '../../actions/vote'; -import { contexts, hooks } from '@oyster/common'; -import { - CheckOutlined, - CloseOutlined, - ExclamationCircleOutlined, -} from '@ant-design/icons'; - -const { useWallet } = contexts.Wallet; -const { useConnection } = contexts.Connection; -const { useAccountByMint } = hooks; - -const { confirm } = Modal; -export function Vote({ - proposal, - state, - timelockConfig, -}: { - proposal: ParsedAccount; - state: ParsedAccount; - timelockConfig: ParsedAccount; -}) { - const wallet = useWallet(); - const connection = useConnection(); - const voteAccount = useAccountByMint(proposal.info.votingMint); - const yesVoteAccount = useAccountByMint(proposal.info.yesVotingMint); - const noVoteAccount = useAccountByMint(proposal.info.noVotingMint); - const [mode, setMode] = useState(true); - const [_, setTokenAmount] = useState(1); - const eligibleToView = - voteAccount && - voteAccount.info.amount.toNumber() > 0 && - state.info.status === TimelockStateStatus.Voting; - return eligibleToView ? ( - - ) : null; -} diff --git a/packages/proposals/src/constants/labels.ts b/packages/proposals/src/constants/labels.ts index e03fe79..d05e8ee 100644 --- a/packages/proposals/src/constants/labels.ts +++ b/packages/proposals/src/constants/labels.ts @@ -68,11 +68,9 @@ export const LABELS = { EXECUTED: 'Executed.', WITHDRAWING_VOTING_TOKENS: 'Refunding voting tokens as Source Tokens', TOKENS_WITHDRAWN: 'Voting tokens refunded as Source Tokens', - REGISTER_TO_VOTE: 'Register to Vote', QUICK_VOTE: 'Quick Vote', CONFIRM: 'Confirm', CANCEL: 'Cancel', - ADD_MORE_VOTES: 'Add More Votes', REFUND_TOKENS: 'Refund My Tokens', REGISTER_GOVERNANCE: 'Register', PROGRAM: 'Program ID', diff --git a/packages/proposals/src/views/proposal/index.tsx b/packages/proposals/src/views/proposal/index.tsx index 4906e99..982058e 100644 --- a/packages/proposals/src/views/proposal/index.tsx +++ b/packages/proposals/src/views/proposal/index.tsx @@ -23,8 +23,6 @@ import { NewInstructionCard } from '../../components/Proposal/NewInstructionCard import SignButton from '../../components/Proposal/SignButton'; import AddSigners from '../../components/Proposal/AddSigners'; import MintSourceTokens from '../../components/Proposal/MintSourceTokens'; -import { Vote } from '../../components/Proposal/Vote'; -import { RegisterToVote } from '../../components/Proposal/RegisterToVote'; import { QuickVote } from '../../components/Proposal/QuickVote'; import { WithdrawTokens } from '../../components/Proposal/WithdrawTokens'; import './style.less'; @@ -297,11 +295,6 @@ function InnerProposalView({ timelockConfig.info.governanceMint.toBase58() } /> - -