Skip to content

Commit

Permalink
fix: pr
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jul 27, 2023
1 parent 5d3f100 commit bf012e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const useGetSpecialAssetColumnInfo = ({
}
}

const isLockedCheque = status === 'withdraw-asset' && Date.now() < targetTime!
const isLockedCheque = status === 'withdraw-asset' && targetTime && Date.now() < targetTime
const isNFTTransferable = assetInfo.type === NFTType.NFT && assetInfo.data === 'transferable'
const isNFTClassOrIssuer = assetInfo.type === NFTType.NFTClass || assetInfo.type === NFTType.NFTIssuer

Expand Down
3 changes: 3 additions & 0 deletions packages/neuron-ui/src/utils/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ export const METHOD_NOT_FOUND = -32601

export const MAX_M_N_NUMBER = 255
export const MILLISECONDS = HOURS_PER_EPOCH * 60 * 60 * 1000

export const ADDRESS_MIN_LENGTH = 86
export const ADDRESS_HEAD_TAIL_LENGTH = 34
5 changes: 4 additions & 1 deletion packages/neuron-ui/src/widgets/InputSelect/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useRef, useState, useEffect, useCallback } from 'react'
import { useDidMount, useForceUpdate } from 'utils'
import { ADDRESS_MIN_LENGTH, ADDRESS_HEAD_TAIL_LENGTH } from 'utils/const'
import { ReactComponent as Arrow } from 'widgets/Icons/Arrow.svg'

import styles from './input-select.module.scss'
Expand Down Expand Up @@ -88,7 +89,9 @@ const Select = ({ value, options, placeholder, disabled, onChange, className, in
aria-selected={isSelected ? 'true' : 'false'}
aria-hidden="true"
>
{typeof label === 'string' && label?.length > 68 ? `${label.slice(0, 34)}...${label.slice(-34)}` : label}
{typeof label === 'string' && label?.length > ADDRESS_MIN_LENGTH
? `${label.slice(0, ADDRESS_HEAD_TAIL_LENGTH)}...${label.slice(-ADDRESS_HEAD_TAIL_LENGTH)}`
: label}
</div>
)
},
Expand Down

0 comments on commit bf012e1

Please sign in to comment.