Skip to content

Commit

Permalink
fix: safari dark mode bug and voters polling
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Sep 27, 2023
1 parent 0727cd3 commit b8420ea
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/proposals/components/VoteLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ export function VoteLine({
}: VoteLineProps) {
return (
<Box
className="VoteLine"
sx={(theme) => ({
display: 'inline-flex',
alignItems: 'center',
position: 'relative',
height: 11,
height: 8,
width: width,
backgroundColor: '$mainLight',
borderColor: `${theme.palette.$mainElements} !important`,
borderStyle: 'solid',
borderWidth: '1px',
borderTopWidth: 3,
borderRightWidth: 3,
borderTopWidth: 2,
borderRightWidth: 2,
[theme.breakpoints.up('lg')]: {
height: 10,
borderTopWidth: 3,
Expand Down
16 changes: 9 additions & 7 deletions src/proposals/components/proposal/ProposalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ export function ProposalPage({

useEffect(() => {
const { forVotes, againstVotes } = formatProposal(proposalData.proposal);
const { isVotingActive } = getProposalStepsAndAmounts({
proposalData: proposal.data,
quorum: proposal.config.quorum,
differential: proposal.config.differential,
precisionDivider: proposal.precisionDivider,
cooldownPeriod: proposal.timings.cooldownPeriod,
executionPayloadTime: proposal.timings.executionPayloadTime,
});

const startBlock =
proposalData.proposal.data.votingMachineData.createdBlock;
Expand All @@ -89,12 +97,6 @@ export function ProposalPage({

const totalVotes = forVotes + againstVotes;

const isFinished =
proposalData.proposal.state === ProposalState.Executed ||
proposalData.proposal.state === ProposalState.Defeated ||
proposalData.proposal.state === ProposalState.Canceled ||
proposalData.proposal.state === ProposalState.Expired;

if (startBlock > 0) {
if (totalVotes > 0 && !proposal.data.prerender) {
getVoters(
Expand All @@ -106,7 +108,7 @@ export function ProposalPage({
);
}

if (!isFinished) {
if (!isVotingActive) {
startVotersPolling(
proposal.data.id,
proposal.data.votingChainId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ export function ActiveProposalListItem({
if (!isForHelpModal) {
setIsClicked(true);
}
}}
sx={{
'&:visited': {
'.VoteLine': {
borderColor: `${theme.palette.$mainElements} !important`,
},
},
}}>
<ProposalListItemWrapper
isVotingActive={isVotingActive}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ export function ProposalListItemWrapper({
disabled?: boolean;
}) {
const sm = useMediaQuery(media.sm);
const md = useMediaQuery(media.md);
const theme = useTheme();

return (
<BoxWith3D
disabled={disabled}
disabled={md && disabled}
alwaysWithBorders={isForHelpModal}
withActions={!sm || !isForHelpModal}
borderSize={10}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { chainInfoHelper } from './configs';

export const isForIPFS = process.env.NEXT_PUBLIC_DEPLOY_FOR_IPFS === 'true';

export const coreName: CoreNetworkName = 'mainnet';
export const coreName: CoreNetworkName = 'sepolia';
export const WC_PROJECT_ID = 'e6ed0c48443e54cc875462bbaec6e3a7'; // https://docs.walletconnect.com/2.0/cloud/relay

// @ts-ignore
Expand Down

0 comments on commit b8420ea

Please sign in to comment.