Skip to content

Commit

Permalink
(govern) fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Atatakai authored and Atatakai committed Aug 1, 2024
1 parent e693e40 commit 1321d5b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
5 changes: 3 additions & 2 deletions apps/govern/components/Contracts/EditVotes/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ describe('<EditVotes />', () => {
expect(screen.getByText('My voting weight')).toBeInTheDocument();

expect(
screen.getByText(/Updated voting weights will take effect at the start of/),
screen.getByText(
/Updated voting weights will take effect at the start of next week \(according to Unix time\)./,
),
).toBeInTheDocument();
expect(screen.getByText(/next Unix time week./)).toBeInTheDocument();
});

describe('Voting contract row', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/govern/components/Contracts/EditVotes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { RETAINER_ADDRESS } from 'common-util/constants/addresses';
import { INVALIDATE_AFTER_UPDATE_KEYS } from 'common-util/constants/scopeKeys';
import { getBytes32FromAddress } from 'common-util/functions/addresses';
import { voteForNomineeWeights } from 'common-util/functions/requests';
import { NextWeekTooltip } from 'components/NextWeekTooltip';
import { queryClient } from 'context/Web3ModalProvider';
import { clearState } from 'store/govern';
import { useAppDispatch, useAppSelector } from 'store/index';
Expand Down Expand Up @@ -219,8 +218,7 @@ export const EditVotes = ({ allocations, setAllocations, setIsUpdating }: EditVo
/>

<Paragraph type="secondary" className="text-end">
Updated voting weights will take effect at the start of&nbsp;
<NextWeekTooltip hideDescription>next Unix time week.</NextWeekTooltip>
Updated voting weights will take effect at the start of next week (according to Unix time).
</Paragraph>
<Flex gap={12} justify="flex-end">
<Button size="large" onClick={onCancel}>
Expand Down
17 changes: 5 additions & 12 deletions apps/govern/components/NextWeekTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,17 @@ const { Text } = Typography;

const TOOLTIP_STYLE = { maxWidth: '350px' };

export const NextWeekTooltip = ({
children,
hideDescription = false,
}: {
children: ReactNode;
hideDescription?: boolean;
}) => {
export const NextWeekTooltip = ({ children }: { children: ReactNode }) => {
return (
<Tooltip
color={COLOR.WHITE}
overlayStyle={TOOLTIP_STYLE}
title={
<Space direction="vertical">
{!hideDescription && (
<Text>
Updated voting weights will take effect at the start of next Unix time week.
</Text>
)}
<Text>
Updated voting weights will take effect at the start of next week (according to Unix
time).
</Text>
<a
href={`https://etherscan.io/address/${
VOTE_WEIGHTING.addresses[mainnet.id]
Expand Down

0 comments on commit 1321d5b

Please sign in to comment.