Skip to content

Commit

Permalink
Merge pull request #928 from Magickbase/fix/page-display-account-is-u…
Browse files Browse the repository at this point in the history
…ndefined
  • Loading branch information
Keith-CY authored Apr 3, 2023
2 parents 703b622 + f5be983 commit fb5b6c3
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

class ErrorBoundary extends React.Component<{}, { hasError: boolean; message: string }> {
class ErrorBoundary extends React.Component<{ children: React.ReactNode }, { hasError: boolean; message: string }> {
constructor(props) {
super(props)
this.state = {
Expand Down
1 change: 1 addition & 0 deletions components/FilterMenu/AgeFilterMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ const AgeFilterMenu: React.FC<{ filterKeys: Array<string> }> = ({ filterKeys })
type={alert.type}
/>
<Popper
nonce={undefined}
{...bindPopper(popupState)}
onResize={undefined}
onResizeCapture={undefined}
Expand Down
10 changes: 2 additions & 8 deletions components/MultiTokenInventoryList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,7 @@ const MultiTokenInventoryList: React.FC<InventoryListProps> = ({ inventory, view
return (
<>
<div className={styles.container}>
{inventory.entries.map((item, idx) => {
const {
owner: {
account: { bit_alias, eth_address },
},
} = item

{inventory.entries?.map((item, idx) => {
return (
<div key={item.token_id + idx} className={styles.card}>
<NextLink href={`/multi-token-item/${item.contract_address_hash}/${item.token_id}`}>
Expand Down Expand Up @@ -158,7 +152,7 @@ const MultiTokenInventoryList: React.FC<InventoryListProps> = ({ inventory, view
{token_id ? (
<div className={styles.info}>
<span>{t('owner')}</span>
<Address address={eth_address} domain={bit_alias} />
<Address address={item.owner?.account?.eth_address} domain={item.owner?.account?.bit_alias} />
</div>
) : (
<div className={styles.info}>
Expand Down
8 changes: 4 additions & 4 deletions components/NFTActivityList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ const ActivityList: React.FC<
</thead>
<tbody>
{transfers?.metadata.total_count ? (
transfers.entries.map(item => {
const method = item.transaction.method_name || item.transaction.method_id
transfers.entries?.map(item => {
const method = item.transaction?.method_name || item.transaction?.method_id
const fromBitAlias = item.from_account?.bit_alias
const toBitAlias = item.to_account?.bit_alias

Expand Down Expand Up @@ -158,10 +158,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
6 changes: 5 additions & 1 deletion components/PageTitle/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { PropsWithChildren } from 'react'
import styles from './styles.module.scss'
interface Props {
children: React.ReactNode
}

const PageTitle: React.FC = ({ children }) => <h5 className={styles.container}>{children}</h5>
const PageTitle: React.FC<PropsWithChildren<Props>> = ({ children }) => <h5 className={styles.container}>{children}</h5>

export default PageTitle
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.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@types/node": "18.11.19",
"@types/phoenix": "1.5.4",
"@types/qrcode": "1.5.0",
"@types/react": "17.0.53",
"@types/react": "18.0.4",
"@types/react-dom": "18.0.11",
"@types/testing-library__jest-dom": "5.14.5",
"@types/testing-library__react": "10.2.0",
Expand All @@ -81,5 +81,8 @@
},
"lint-staged": {
"**/*": "npm run format"
},
"resolutions": {
"react-i18next": ">=11.16.4"
}
}
2 changes: 1 addition & 1 deletion pages/nft-collections/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const NftCollectionList = () => {

const orderedSorter = handleSorterArrayInOrder(clickedSorter ? sorterArrayFromPath : DEFAULT_SORTERS, clickedSorter)
for (const item of orderedSorter) {
searchParams.append(item.type, item.order)
searchParams.append(item?.type, item?.order)
}

return `${asPath.split('?')[0] ?? ''}?${searchParams}`
Expand Down

0 comments on commit fb5b6c3

Please sign in to comment.