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

Pixel qa fixes #460

Open
wants to merge 4 commits into
base: master
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: 1 addition & 2 deletions governance/ui/src/components/CouncilTabs/CouncilSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ export const CouncilsSelect = ({ activeCouncil }: { activeCouncil: CouncilSlugs
borderColor="gray.900"
alignItems="center"
data-cy="menu-button-flex-council-select"
w="100%"
>
<CouncilImage imageUrl={slugToImageUrl(activeCouncil)} mr="10px" />
<Text
fontFamily="heading"
fontSize={{ base: 'xs', md: 'md' }}
fontSize={{ base: 'sm', md: 'md' }}
lineHeight="28px"
fontWeight={700}
mr="12px"
Expand Down
6 changes: 4 additions & 2 deletions governance/ui/src/components/MyVoteRow/MyVoteRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ export default function MyVoteRow({
</Flex>

{hasVoted ? (
<Badge mr="2">Your Vote</Badge>
<Badge variant="outline" mr="2">
Your Vote
</Badge>
) : voteAddressState ? (
<Badge color="gray" mr="2" data-cy="selected-badge-my-row">
<Badge color="gray" variant="outline" mr="2" data-cy="selected-badge-my-row">
Selected
</Badge>
) : null}
Expand Down
4 changes: 2 additions & 2 deletions governance/ui/src/components/MyVotesBox/MyVotesBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export default function MyVotesBox({
<Fade in={true}>
<Flex
w="424px"
h="310px"
h="330px"
position="absolute"
bottom="-320px"
bottom="-340px"
right="0px"
border="1px solid"
borderColor="gray.900"
Expand Down
11 changes: 8 additions & 3 deletions governance/ui/src/components/MyVotesSummary/MyVotesSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const MyVotesSummary = ({
}}
rounded="base"
w="100%"
maxW={{ base: '220px', xl: '300px' }}
maxW={{ base: 'fit-content', xl: '300px' }}
borderColor={isInMyVotesPage ? 'cyan.500' : 'gray.900'}
borderWidth="1px"
py={2}
Expand All @@ -135,11 +135,16 @@ export const MyVotesSummary = ({
bg: 'linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.06) 100%), #0B0B22;',
}}
>
<Text fontSize="sm" fontWeight="bold" mr="auto" data-cy="my-votes-summary-text">
<Text
fontSize={{ base: 'sm', md: 'md', xl: 'sm' }}
fontWeight="bold"
mr="auto"
data-cy="my-votes-summary-text"
>
My Votes
</Text>
<Show above="md">
<Text fontSize="small" ml={8} fontWeight="bold">
<Text fontSize="sm" ml={8} fontWeight="bold">
{councilPeriod === '2' && (
<>
{Object.values(stateFromCouncils).filter((vote) => !!vote).length}/{councils.length}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export function UserProfileCard({
);

const isLoading = useDataLoading || councilPeriodLoading || isNominatedLoading;

return (
<Flex
flexDir="column"
Expand All @@ -55,7 +54,9 @@ export function UserProfileCard({
councilPeriod={councilPeriod}
walletAddress={walletAddress}
isOwn={isOwn}
isNominated={!!isNominated?.isNominated}
isNominated={
isNominated?.council.slug === activeCouncil ? !!isNominated?.isNominated : false
}
userData={userData}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CloseIcon, CopyIcon } from '@chakra-ui/icons';
import { Flex, IconButton, Button, Text, Tooltip, Box } from '@chakra-ui/react';
import { Badge } from '../Badge';
import { prettyString } from '@snx-v3/format';
import { Socials } from '../Socials';
import { GetUserDetails } from '../../queries/useGetUserDetailsQuery';
Expand Down Expand Up @@ -147,8 +148,8 @@ export const UserProfileDetails = ({
/>
)}
<ProfilePicture address={userData?.address} />
<Flex flexDir="column" w="100%" ml="2">
<Flex justifyContent="space-between">
<Flex flexDir="column" ml="2">
<Flex justifyContent="flex-start">
<Text
fontSize="16px"
fontWeight="700"
Expand All @@ -157,9 +158,47 @@ export const UserProfileDetails = ({
textOverflow="ellipsis"
whiteSpace="nowrap"
overflow="hidden"
mr="2"
>
{userData?.username ? userData.username : prettyString(userData?.address || '')}
</Text>
{isAlreadyVoted ? (
<Badge
color="cyan"
variant="outline"
lineHeight="14px"
h="fit-content"
w="fit-content"
alignSelf="center"
data-cy="your-vote-badge-table"
>
Your Vote
</Badge>
) : isSelected ? (
<Badge
color="gray"
variant="outline"
lineHeight="14px"
h="fit-content"
w="fit-content"
alignSelf="center"
data-cy="selected-badge-table"
>
Selected
</Badge>
) : isNominated ? (
<Badge
color="green"
variant="outline"
lineHeight="14px"
h="fit-content"
w="fit-content"
alignSelf="center"
data-cy="selected-badge-table"
>
Nominee
</Badge>
) : null}
</Flex>
<Text
fontSize="12px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export function UserProfileForm() {
flexDirection="column"
bg="navy.700"
minW="100%"
borderColor="cyan.500"
borderColor="gray.900"
borderWidth="1px"
borderStyle="solid"
rounded="base"
Expand All @@ -379,8 +379,8 @@ export function UserProfileForm() {
colorScheme="whiteAlpha"
color="white"
position="absolute"
top="10px"
right="10px"
top="16px"
right="16px"
/>
<Heading fontSize="md">You have unsaved changes</Heading>
<Text fontSize="sm" color="gray.500" mb="auto">
Expand Down
15 changes: 13 additions & 2 deletions governance/ui/src/components/UserTableView/UserTableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,22 @@ export default function UserTableView({
fontWeight={700}
>
{ballot?.votedCandidates.includes(user.address) ? (
<Badge w="fit-content" data-cy="your-vote-badge-table">
<Badge
variant="outline"
lineHeight="14px"
w="fit-content"
data-cy="your-vote-badge-table"
>
Your Vote
</Badge>
) : isSelectedForVoting ? (
<Badge color="gray" w="fit-content" data-cy="selected-badge-table">
<Badge
color="gray"
variant="outline"
lineHeight="14px"
w="fit-content"
data-cy="selected-badge-table"
>
Selected
</Badge>
) : null}
Expand Down
19 changes: 17 additions & 2 deletions governance/ui/src/pages/MyVotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import {
ModalOverlay,
Text,
useDisclosure,
IconButton,
} from '@chakra-ui/react';
import { CloseIcon } from '@chakra-ui/icons';
import councils, { CouncilSlugs } from '../utils/councils';
import { useNavigate } from 'react-router-dom';
import { WarningIcon } from '@chakra-ui/icons';
Expand Down Expand Up @@ -308,7 +310,7 @@ export default function MyVotes() {
flexDirection="column"
bg="navy.700"
minW="100%"
borderColor="cyan.500"
borderColor="gray.900"
borderWidth="1px"
borderStyle="solid"
rounded="base"
Expand All @@ -317,7 +319,20 @@ export default function MyVotes() {
h="500px"
gap="2"
>
<Heading fontSize="md">Your haven&apos;t complete your selection</Heading>
<IconButton
onClick={() => onClose()}
size="xs"
aria-label="close button"
icon={<CloseIcon />}
variant="ghost"
colorScheme="whiteAlpha"
color="white"
position="absolute"
top="16px"
right="16px"
/>

<Heading fontSize="md">You haven&apos;t completed your selection</Heading>
<Text color="gray.500" fontSize="sm">
You can now vote for multiple councils and cast all your votes in one unique
transaction:
Expand Down