Skip to content

Commit

Permalink
fix: contract overview detail + remove uppercase func name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Nov 16, 2022
1 parent c6b03ce commit 82ac9a5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 27 deletions.
58 changes: 36 additions & 22 deletions views/accounts/tabs/ContractCodeTab/Overview.tsx
Original file line number Diff line number Diff line change
@@ -1,35 +1,49 @@
import { useMobileLayout } from '@astraprotocol/astra-ui'
import clsx from 'clsx'
import Row from 'components/Grid/Row'
import styles from './style.module.scss'

interface Props {
contractCode: ContractCodeData
}
const ContractCodeOverview = ({ contractCode }: Props) => {
const { isMobile } = useMobileLayout()
return (
<div className={clsx(styles.overview, 'margin-bottom-xl md-wrap')}>
<div className="text text-sm contrast-color-30">
Contract Name: <div className="text text-base contrast-color-100">{contractCode.ContractName}</div>
<div className={clsx(styles.overview, 'margin-bottom-xl ')}>
<div className={isMobile ? 'col col-5' : 'col col-5 margin-right-xl'}>
<Row style={{ justifyContent: 'space-between' }}>
<span className="text text-sm contrast-color-30">Name: </span>
<span className="text text-base contrast-color-100">{contractCode.ContractName}</span>
</Row>
<Row style={{ justifyContent: 'space-between' }}>
<span className="text text-sm contrast-color-30">Compiler Version: </span>
<span className="text text-base contrast-color-100">{contractCode.CompilerVersion}</span>
</Row>
<Row style={{ justifyContent: 'space-between' }}>
<span className="text text-sm contrast-color-30">EVM Version:</span>
<span className="text text-base contrast-color-100">{contractCode.EVMVersion}</span>
</Row>
{contractCode.Verified && (
<Row style={{ justifyContent: 'space-between' }}>
<span className="text text-sm contrast-color-30">Verified At: </span>
<span className="text text-base contrast-color-100">{contractCode.VerifiedAt}</span>
</Row>
)}
</div>
<div className="text text-sm contrast-color-30">
Compiler Version:{' '}
<div className="text text-base contrast-color-100">{contractCode.CompilerVersion}</div>
<div className="col col-5">
<Row style={{ justifyContent: 'space-between' }}>
<span className="text text-sm contrast-color-30">Is Proxy:</span>
<span className="text text-base contrast-color-100">{contractCode.IsProxy}</span>
</Row>
<Row style={{ justifyContent: 'space-between' }}>
<span className="text text-sm contrast-color-30">Optimization enabled: </span>
<span className="text text-base contrast-color-100">{contractCode.OptimizationUsed}</span>
</Row>
<Row style={{ justifyContent: 'space-between' }}>
<span className="text text-sm contrast-color-30">Optimization runs: </span>
<span className="text text-base contrast-color-100">{contractCode.OptimizationRuns}</span>
</Row>
</div>
<div className="text text-sm contrast-color-30">
EVM Version: <div className="text text-base contrast-color-100">{contractCode.EVMVersion}</div>
</div>
<div className="text text-sm contrast-color-30">
Optimization enabled:{' '}
<div className="text text-base contrast-color-100">{contractCode.OptimizationUsed}</div>
</div>
<div className="text text-sm contrast-color-30">
Optimization runs:{' '}
<div className="text text-base contrast-color-100">{contractCode.OptimizationRuns}</div>
</div>
{contractCode.Verified && (
<div className="text text-sm contrast-color-30">
Verified At: <div className="text text-base contrast-color-100">{contractCode.VerifiedAt}</div>
</div>
)}
</div>
)
}
Expand Down
1 change: 0 additions & 1 deletion views/accounts/tabs/ContractCodeTab/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}
6 changes: 2 additions & 4 deletions views/transactions/TransactionBriefRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { LinkText } from 'components/Typography/LinkText'
import Tag from 'components/Typography/Tag'
import Image from 'next/image'
import { TransacionTypeEnum } from 'utils/enum'
import { capitalizeFirstLetter, ellipseBetweenText, LinkMaker } from 'utils/helper'
import { ellipseBetweenText, LinkMaker } from 'utils/helper'
import styles from './style.module.scss'

type TransactionBriefRowProps = {
Expand Down Expand Up @@ -96,9 +96,7 @@ export default function TransactionBriefRow({
>
{ellipseBetweenText(hash, 12, 12).toLowerCase()}
</Typography.LinkText>
{evmType && (
<Tag hasArrowRight={false} fontType="Titi" text={capitalizeFirstLetter(evmType)} />
)}
{evmType && <Tag hasArrowRight={false} fontType="Titi" text={evmType} />}
</Row>
<Timer updatedAt={updatedAt} />
</div>
Expand Down

0 comments on commit 82ac9a5

Please sign in to comment.