-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #931 from oraichain/develop
Develop
- Loading branch information
Showing
29 changed files
with
962 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.json-viewer { | ||
ul { | ||
background-color: transparent!important; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
import { JSONTree } from "react-json-tree"; | ||
import cn from "classnames/bind"; | ||
import styles from "./ReactJson.module.scss"; | ||
|
||
const cx = cn.bind(styles); | ||
|
||
const ReactJson = ({ style, name, theme, displayObjectSize, collapsed, displayDataTypes, src, sortKeys, quotesOnKeys }) => { | ||
return ( | ||
<div className={cx("json-viewer")} style={style}> | ||
<JSONTree | ||
data={src} | ||
hideRoot | ||
theme={theme} | ||
collectionLimit={displayObjectSize} | ||
shouldExpandNodeInitially={(keyPath, data, level) => { | ||
return !collapsed || level < collapsed; | ||
}} | ||
sortObjectKeys={sortKeys} | ||
valueRenderer={(_, raw) => { | ||
if (typeof raw === "string" && raw.match(/^https?:\/\//)) { | ||
return ( | ||
<a target='_blank' href={raw}> | ||
{raw} | ||
</a> | ||
); | ||
} | ||
return raw; | ||
}} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ReactJson; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { memo } from "react"; | ||
import classNames from "classnames/bind"; | ||
import { checkStatus } from "../NFTTable/NFTTable"; | ||
import { NavLink } from "react-router-dom"; | ||
import { _, reduceString, setAgoTime } from "src/lib/scripts"; | ||
import { formatOrai } from "src/helpers/helper"; | ||
import consts from "src/constants/consts"; | ||
import styles from "./NFTCard.module.scss"; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const NFTCard = memo(({ data = [], address }) => { | ||
if (!Array.isArray(data)) { | ||
return <></>; | ||
} | ||
const reduceStringAdress = (title, value, toHref = "") => { | ||
return ( | ||
<tr> | ||
<td> | ||
<div className={cx("item-title")}>{title}</div> | ||
</td> | ||
<td> | ||
{value ? ( | ||
<div className={cx("address-data-cell")}> | ||
<NavLink className={cx("address")} to={toHref}> | ||
{reduceString(value, 6, 6)} | ||
</NavLink> | ||
</div> | ||
) : ( | ||
<div className={cx("item-link")}>-</div> | ||
)} | ||
</td> | ||
</tr> | ||
); | ||
}; | ||
|
||
return ( | ||
<div className='nftToken-card-list'> | ||
{data.map(item => { | ||
return ( | ||
<div className={cx("nftToken-card-list-item")} key={"nftToken-card-list-item-" + item?.id}> | ||
<table> | ||
<tbody> | ||
{reduceStringAdress("TxHash", item?.tx_hash, `${consts.PATH.TXLIST}/${item.tx_hash}`)} | ||
<tr> | ||
<td> | ||
<div className={cx("item-title")}>NFT ID</div> | ||
</td> | ||
<td> | ||
<span className={cx("item-text")}>{item?.nft_id}</span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<div className={cx("item-title")}>NFT Name </div> | ||
</td> | ||
<td> | ||
<span className={cx("item-text")}>{item?.nft_name}</span> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<div className={cx("item-title")}>Creator Type</div> | ||
</td> | ||
<td> | ||
<span className={cx("item-text")}>{item?.creator_type.toUpperCase()}</span> | ||
</td> | ||
</tr> | ||
{reduceStringAdress("Creator", item?.creator, `${consts.PATH.TXLIST}/${item.creator}`)} | ||
{reduceStringAdress("Contract address", item?.contract_address, `${consts.PATH.TXLIST}/${item.contract_address}`)} | ||
{reduceStringAdress("Contract", item?.contract, `${consts.PATH.TXLIST}/${item.contract}`)} | ||
|
||
<tr> | ||
<td> | ||
<div className={cx("item-title")}>Time</div> | ||
</td> | ||
<td> | ||
<span className={cx("item-text")}>{setAgoTime(item?.timestamp)}</span> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
}); | ||
|
||
export default NFTCard; |
Oops, something went wrong.