diff --git a/src/components/voting/VoteResultsPanel.tsx b/src/components/voting/VoteResultsPanel.tsx index 9d9f33be..5ed15629 100644 --- a/src/components/voting/VoteResultsPanel.tsx +++ b/src/components/voting/VoteResultsPanel.tsx @@ -1,4 +1,5 @@ import { + ActionIcon, Avatar, Box, Divider, @@ -19,8 +20,17 @@ import { getContestVoters } from '../../queries/getVoters'; import { VoteCard } from './VoteCard'; import { useQuery } from '@tanstack/react-query'; import { formatBalance } from '../../types/common'; - -export const VoteResultsPanel = ({ ships }: { ships: ShipsCardUI[] }) => { +import { IconArrowNarrowLeft } from '@tabler/icons-react'; + +export const VoteResultsPanel = ({ + ships, + isPeeking, + setSeeResults, +}: { + ships: ShipsCardUI[]; + isPeeking: boolean; + setSeeResults: (see: boolean) => void; +}) => { const { contest, userVotes, tokenData } = useVoting(); const theme = useMantineTheme(); @@ -77,7 +87,18 @@ export const VoteResultsPanel = ({ ships }: { ships: ShipsCardUI[] }) => { return ( - + {isPeeking ? ( + + setSeeResults(false)}> + + + + See Portfolios + + + ) : ( + + )} {hasUserVoted ? 'Your vote has been submitted!' : 'Voting is Complete!'} diff --git a/src/pages/Vote.tsx b/src/pages/Vote.tsx index d3afb265..e460a233 100644 --- a/src/pages/Vote.tsx +++ b/src/pages/Vote.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react'; import { MainSection, PageTitle } from '../layout/Sections'; import { + ActionIcon, Box, Button, Flex, @@ -10,6 +11,7 @@ import { Stack, Stepper, Text, + Tooltip, useMantineTheme, } from '@mantine/core'; import { useQuery } from '@tanstack/react-query'; @@ -37,7 +39,7 @@ import { PreVoting } from '../components/voting/PreVoting'; import { useGameManager } from '../hooks/useGameMangers'; import Logo from '../assets/Logo.svg?react'; -import { IconExclamationCircle } from '@tabler/icons-react'; +import { IconExclamationCircle, IconEye } from '@tabler/icons-react'; import { DashGrant } from '../resolvers/grantResolvers'; import { useAccount } from 'wagmi'; @@ -77,7 +79,7 @@ export const Vote = () => { queryKey: ['ships-page'], queryFn: bigVoteQuery, }); - + const [seeResults, setSeeResults] = useState(false); const { userVotes, votingStage, contestStatus } = useVoting(); const { currentRound } = useGameManager(); @@ -111,16 +113,24 @@ export const Vote = () => { return ; } - if (hasVotes || votingStage >= VotingStage.Closed) { - return ; + if (hasVotes || votingStage >= VotingStage.Closed || seeResults) { + return ( + + ); } - return ; + return ; }; const VotingOpen = ({ ships, + setSeeResults, }: { + setSeeResults: (value: boolean) => void; ships: { grants: DashGrant[] | null; recentRecord: PostedRecord | null; @@ -194,16 +204,25 @@ const VotingOpen = ({ {isConnected && } - + + + setSeeResults(true)} + > + + + + +