Skip to content

Commit

Permalink
Merge pull request #940 from Magickbase/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY authored Apr 27, 2023
2 parents 25510ac + 3f71d5d commit 278c85c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 38 deletions.
5 changes: 4 additions & 1 deletion components/ContractInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ const ContractInfo: React.FC<{ address: string; contract: PolyjuiceContractProps
{contract_source_code ? (
<>
{Array.isArray(sourcify_metadata) ? (
sourcify_metadata.slice(1).map(code => {
sourcify_metadata.map(code => {
if (!code.name.endsWith('.sol')) {
return null
}
return (
<div className={styles.sourceCode} key={code.name}>
<div className={styles.title}>
Expand Down
18 changes: 9 additions & 9 deletions components/MultiTokenActivityList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,24 @@ const ActivityList: React.FC<
<tbody>
{transfers?.metadata.total_count ? (
transfers.entries.map(item => {
const method = item.transaction.method_name || item.transaction.method_id
const method = item.transaction?.method_name || item.transaction?.method_id
const fromBitAlias = item.from_account?.bit_alias
const toBitAlias = item.to_account?.bit_alias

const token_ids = Array.isArray(item.token_ids) ? item.token_ids : [item.token_id]
const amounts = Array.isArray(item.amounts) ? item.amounts : [item.amount]

return (
<tr key={item.transaction.eth_hash + item.log_index}>
<tr key={item.transaction?.eth_hash + item.log_index}>
<td>
<div className={styles.hash}>
<Tooltip title={item.transaction.eth_hash} placement="top">
<Tooltip title={item.transaction?.eth_hash} placement="top">
<span>
<NextLink href={`/tx/${item.transaction.eth_hash}`}>
<a className="mono-font">{`${item.transaction.eth_hash.slice(
<NextLink href={`/tx/${item.transaction?.eth_hash}`}>
<a className="mono-font">{`${item.transaction?.eth_hash.slice(
0,
8,
)}...${item.transaction.eth_hash.slice(-8)}`}</a>
)}...${item.transaction?.eth_hash.slice(-8)}`}</a>
</NextLink>
</span>
</Tooltip>
Expand All @@ -154,7 +154,7 @@ const ActivityList: React.FC<
<td>
{method ? (
<div
data-tooltip={item.transaction.method_id}
data-tooltip={item.transaction?.method_id}
className={`${styles.method} tooltip`}
title={method}
>
Expand All @@ -170,10 +170,10 @@ const ActivityList: React.FC<
</time>
</td>
<td>
<Address address={item.from_address} type={item.from_account.type} domain={fromBitAlias} />
<Address address={item.from_address} type={item.from_account?.type} domain={fromBitAlias} />
</td>
<td>
<Address address={item.to_address} type={item.to_account.type} domain={toBitAlias} />
<Address address={item.to_address} type={item.to_account?.type} domain={toBitAlias} />
</td>
{viewer ? (
<td>
Expand Down
12 changes: 6 additions & 6 deletions components/NFTActivityList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ const ActivityList: React.FC<
const toBitAlias = item.to_account?.bit_alias

return (
<tr key={item.transaction.eth_hash + item.log_index}>
<tr key={item.transaction?.eth_hash + item.log_index}>
<td>
<div className={styles.hash}>
<Tooltip title={item.transaction.eth_hash} placement="top">
<Tooltip title={item.transaction?.eth_hash} placement="top">
<span>
<NextLink href={`/tx/${item.transaction.eth_hash}`}>
<a className="mono-font">{`${item.transaction.eth_hash.slice(
<NextLink href={`/tx/${item.transaction?.eth_hash}`}>
<a className="mono-font">{`${item.transaction?.eth_hash.slice(
0,
8,
)}...${item.transaction.eth_hash.slice(-8)}`}</a>
)}...${item.transaction?.eth_hash.slice(-8)}`}</a>
</NextLink>
</span>
</Tooltip>
Expand All @@ -143,7 +143,7 @@ const ActivityList: React.FC<
</td>
<td>
{method ? (
<Tooltip title={item.transaction.method_id} placement="top">
<Tooltip title={item.transaction?.method_id} placement="top">
<div className={styles.method} title={method}>
{method}
</div>
Expand Down
15 changes: 2 additions & 13 deletions components/TruncatedAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,7 @@ const TruncatedAddress = ({
domain?: string
placement?: 'top' | 'bottom'
}) => {
if (address === ZERO_ADDRESS) {
return (
<Tooltip title={address} placement={placement} sx={sx}>
<Box sx={sx}>
<span className="mono-font" style={{ color: 'var(--primary-text-color)', userSelect: 'none' }}>
zero address
</span>
</Box>
</Tooltip>
)
}

const isZeroAddress = address === ZERO_ADDRESS
const addrDisplay = getAddressDisplay({
eth_address: address,
script_hash: address,
Expand Down Expand Up @@ -67,7 +56,7 @@ const TruncatedAddress = ({
) : (
<Tooltip title={address} placement={placement} sx={sx}>
<Box sx={sx}>
<HashLink label={label} href={`/account/${address}`} monoFont={monoFont} />
<HashLink label={isZeroAddress ? 'zero address' : label} href={`/account/${address}`} monoFont={monoFont} />
</Box>
</Tooltip>
)}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"qrcode": "1.5.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-i18next": "12.1.4",
"react-i18next": "12.2.2",
"react-query": "3.39.2",
"recharts": "2.3.2",
"wagmi": "0.10.6"
Expand Down Expand Up @@ -83,6 +83,6 @@
"**/*": "npm run format"
},
"resolutions": {
"react-i18next": ">=11.16.4"
"react-i18next": "12.2.2"
}
}

1 comment on commit 278c85c

@vercel
Copy link

@vercel vercel bot commented on 278c85c Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.