Skip to content

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Sep 28, 2023
1 parent e228594 commit 269163b
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/proposals/components/proposal/ProposalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function ProposalPage({
);
}

if (!isVotingActive) {
if (isVotingActive) {
startVotersPolling(
proposal.data.id,
proposal.data.votingChainId,
Expand Down
34 changes: 21 additions & 13 deletions src/proposals/components/proposal/ProposalPayloads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,27 @@ function PayloadItem({
)}

{isPayloadReadyForExecution && !isExecuted && (
<SmallButton
disabled={tx?.status === 1}
loading={tx?.pending}
onClick={() => {
setSelectedPayloadForExecute({
chainId: payload.chainId,
payloadsController: payload.payloadsController,
id: payload.id,
});
store.setExecutePayloadModalOpen(true);
}}>
{texts.proposals.payloadsDetails.execute}
</SmallButton>
<>
{store.activeWallet?.isActive ? (
<SmallButton
disabled={tx?.status === 1}
loading={tx?.pending}
onClick={() => {
setSelectedPayloadForExecute({
chainId: payload.chainId,
payloadsController: payload.payloadsController,
id: payload.id,
});
store.setExecutePayloadModalOpen(true);
}}>
{texts.proposals.payloadsDetails.execute}
</SmallButton>
) : (
<PayloadItemStatusInfo>
{texts.proposals.payloadsDetails.execution}
</PayloadItemStatusInfo>
)}
</>
)}

{isExecuted && (
Expand Down
13 changes: 6 additions & 7 deletions src/transactions/components/ActionModalContent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Box, useTheme } from '@mui/system';
import React, { ReactNode } from 'react';

import LinkIcon from '/public/images/icons/link.svg';
import LinkIcon from '/public/images/icons/linkIcon.svg';

import { selectTxExplorerLink, WalletType } from '../../../lib/web3/src';
import { useStore } from '../../store';
Expand Down Expand Up @@ -157,15 +157,14 @@ export function ActionModalContent({
</Box>
<IconBox
sx={{
width: 10,
height: 10,
width: 12,
height: 12,
'> svg': {
width: 10,
height: 10,
width: 12,
height: 12,
},
ml: 3,
ml: 4,
position: 'relative',
bottom: 0.5,
}}>
<LinkIcon />
</IconBox>
Expand Down
46 changes: 44 additions & 2 deletions src/transactions/components/TransactionInfoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React from 'react';
import CheckIcon from '/public/images/icons/check.svg';
import CopyIcon from '/public/images/icons/copy.svg';
import CrossIcon from '/public/images/icons/cross.svg';
import LinkIcon from '/public/images/icons/linkIcon.svg';

import { selectTxExplorerLink } from '../../../lib/web3/src';
import { DelegatedText } from '../../delegate/components/DelegatedText';
Expand Down Expand Up @@ -73,21 +74,62 @@ export function TransactionInfoItem({ tx }: TransactionInfoItemProps) {
</Box>
)}
{tx.hash && (
<Box sx={{ display: 'inline-flex', alignItems: 'center' }}>
<Box
sx={{
display: 'inline-flex',
alignItems: 'center',
a: { lineHeight: 0 },
}}>
<Link
href={selectTxExplorerLink(
state,
chainInfoHelper.getChainParameters,
tx.hash,
)}
css={{
display: 'inline-flex',
color: '$textSecondary',
hover: { color: theme.palette.$text },
alignItems: 'center',
transition: 'all 0.2s ease',
hover: {
color: theme.palette.$text,
svg: {
path: {
'&:first-of-type': {
stroke: theme.palette.$text,
},
'&:last-of-type': {
fill: theme.palette.$text,
},
},
},
},
}}
inNewWindow>
<Box component="p" sx={{ typography: 'descriptor' }}>
{textCenterEllipsis(tx.hash, 5, 5)}
</Box>
<IconBox
sx={{
width: 10,
height: 10,
ml: 2,
'> svg': {
width: 10,
height: 10,
transition: 'all 0.2s ease',
path: {
'&:first-of-type': {
stroke: theme.palette.$textSecondary,
},
'&:last-of-type': {
fill: theme.palette.$textSecondary,
},
},
},
}}>
<LinkIcon />
</IconBox>
</Link>

<CopyToClipboard copyText={tx.hash}>
Expand Down
1 change: 1 addition & 0 deletions src/ui/components/SmallButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export function SmallButton({
'&:disabled': {
cursor: 'not-allowed',
'.SmallButton__inner': {
cursor: 'not-allowed',
borderTop: `1px solid transparent`,
borderRight: `1px solid transparent`,
backgroundColor: '$disabled',
Expand Down
1 change: 1 addition & 0 deletions src/ui/utils/texts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const texts = {
executedIn: 'Executed in',
execute: 'Execute',
executedAt: 'Executed at',
execution: 'Ready for execution',
cancelledAt: 'Cancelled at',
expired: 'Expired',
expiredIn: 'Expired in',
Expand Down

0 comments on commit 269163b

Please sign in to comment.