diff --git a/src/components/Header/MenusComp/arrow.svg b/src/components/Header/MenusComp/arrow.svg new file mode 100644 index 000000000..c96928be1 --- /dev/null +++ b/src/components/Header/MenusComp/arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Header/MenusComp/index.module.scss b/src/components/Header/MenusComp/index.module.scss new file mode 100644 index 000000000..17d666e00 --- /dev/null +++ b/src/components/Header/MenusComp/index.module.scss @@ -0,0 +1,44 @@ +.submenu { + padding: 4px 12px; + border-radius: 4px; + background: #fff; + color: #333; + box-shadow: 0 4px 4px 0 rgb(16 16 16 / 5%); + + .link { + display: block; + padding: 12px 0; + border-top: 1px solid #e5e5e5; + line-height: 1; + + &:first-child { + border-top: 0; + } + } +} + +.submenuTrigger { + gap: 4px; + + .icon { + transform: rotate(180deg); + transition: transform 0.1s; + } + + /* stylelint-disable-next-line selector-class-pattern */ + &:global(.ant-dropdown-open) { + .icon { + transform: rotate(0deg); + } + } +} + +.mobileSubmenuTrigger { + width: 100%; + justify-content: space-between; + + .icon { + transform: rotate(180deg); + transition: transform 0.1s; + } +} diff --git a/src/components/Header/MenusComp/index.tsx b/src/components/Header/MenusComp/index.tsx index e42f25242..b6348062a 100644 --- a/src/components/Header/MenusComp/index.tsx +++ b/src/components/Header/MenusComp/index.tsx @@ -1,8 +1,12 @@ import { Link } from 'react-router-dom' -import { memo } from 'react' +import { FC, memo } from 'react' import { useTranslation } from 'react-i18next' +import { Dropdown } from 'antd' +import classNames from 'classnames' import { MobileMenuItem, MobileMenuLink, HeaderMenuPanel } from './styled' import { isMainnet } from '../../../utils/chain' +import styles from './index.module.scss' +import { ReactComponent as ArrowIcon } from './arrow.svg' export enum LinkType { Inner, @@ -12,7 +16,8 @@ export enum LinkType { interface MenuData { type: LinkType name: string - url: string + url?: string + children?: MenuData[] } const useMenuDataList = () => { @@ -31,7 +36,18 @@ const useMenuDataList = () => { { type: LinkType.Inner, name: t('navbar.tokens'), - url: '/tokens', + children: [ + { + type: LinkType.Inner, + name: t('navbar.sUDT'), + url: '/tokens', + }, + { + type: LinkType.Inner, + name: t('navbar.inscription'), + url: '/inscriptions', + }, + ], }, { type: LinkType.Inner, @@ -59,29 +75,72 @@ const useMenuDataList = () => { return list } -const MenuItemLink = ({ menu }: { menu: MenuData }) => { - const { url, type, name } = menu +const SubmenuDropdown: FC<{ menu: MenuData }> = ({ children, menu }) => { return ( - - {name} - + + {menu.children?.map(menu => ( + + {menu.name} + + ))} + + } + mouseEnterDelay={0} + transitionName="" + > + {children} + ) } export default memo(({ isMobile }: { isMobile: boolean }) => { const menuList = useMenuDataList() + return isMobile ? ( {menuList .filter(menu => menu.name !== undefined) - .map(menu => ( - - ))} + .map(menu => + menu.children ? ( + + + {menu.name} + + + + ) : ( + + {menu.name} + + ), + )} ) : ( {menuList.map(menu => - menu.type === LinkType.Inner ? ( + // eslint-disable-next-line no-nested-ternary + menu.children ? ( + + {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} + + {menu.name} + + + + ) : menu.type === LinkType.Inner ? ( {menu.name} diff --git a/src/components/Search/SearchByNameResults.tsx b/src/components/Search/SearchByNameResults.tsx index 254470d4b..1d1ae6ed3 100644 --- a/src/components/Search/SearchByNameResults.tsx +++ b/src/components/Search/SearchByNameResults.tsx @@ -43,10 +43,13 @@ const EmptySearchByNameResult = () => { const SearchByNameResult = (props: { item: UDTQueryResult }) => { const { t } = useTranslation() const { item } = props - const { typeHash, fullName, symbol } = item + const { typeHash, fullName, symbol, udtType } = item const displayName = symbol ?? fullName return ( - + {displayName ?? t('udt.unknown_token')} {typeHash} diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 91b4562f2..6e7b450c9 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -73,7 +73,7 @@ const handleSearchById = async ( break case SearchResultType.UDT: - history.push(`/sudt/${query}`) + history.push(data.attributes.udtType === 'omiga_inscription' ? `/inscription/${query}` : `/sudt/${query}`) break default: diff --git a/src/locales/en.json b/src/locales/en.json index 9bf9e472a..e43b5bb02 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -166,6 +166,8 @@ "nervos_dao": "Nervos DAO", "faucet": "Faucet", "tokens": "Tokens", + "sUDT": "sUDT", + "inscription": "Inscription", "docs": "Docs", "search_placeholder": "Block/Transaction/Address/Lock Hash/Type Hash/Args", "search_by_name_placeholder": "Token Name", @@ -581,7 +583,15 @@ "view-transfer-txns": "View Transfer Txns", "view-burn-txns": "View Burn Txns", "address-or-hash": "Transaction Hash / Address", - "address": "Address" + "address": "Address", + "inscriptions": "Inscriptions", + "status": "Status", + "progress": "Progress", + "expected_supply": "Expected Supply", + "mint_limit": "Mint Limit", + "mint_status_minting": "Minting", + "mint_status_closed": "Closed", + "mint_status_rebase_start": "Rebase Start" }, "nft": { "nft_collection": "NFT Collection", diff --git a/src/locales/zh.json b/src/locales/zh.json index ac7d53456..672308145 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -166,6 +166,8 @@ "nervos_dao": "Nervos DAO", "faucet": "水龙头", "tokens": "代币", + "sUDT": "sUDT", + "inscription": "铭文", "docs": "文档", "search_placeholder": "区块/交易/地址/锁定脚本哈希/Type 脚本哈希/参数", "search_by_name_placeholder": "代币名称", @@ -582,7 +584,15 @@ "view-transfer-txns": "查看转帐交易", "view-burn-txns": "查看销毁交易", "address-or-hash": "交易哈希 / 地址", - "address": "地址" + "address": "地址", + "inscriptions": "铭文", + "status": "状态", + "progress": "进度", + "expected_supply": "预期供应量", + "mint_limit": "铸造限制", + "mint_status_minting": "铸造中", + "mint_status_closed": "已关闭", + "mint_status_rebase_start": "重铸开始" }, "nft": { "nft_collection": "NFT 藏品", diff --git a/src/models/UDT/index.ts b/src/models/UDT/index.ts index 40e5a49ff..489fba58c 100644 --- a/src/models/UDT/index.ts +++ b/src/models/UDT/index.ts @@ -16,4 +16,23 @@ export interface UDT { typeScript: Script displayName?: string uan?: string + // TODO: Not quite sure if there are only two types here, so add a string for now. + udtType: 'omiga_inscription' | 'sudt' | string +} + +export enum MintStatus { + Minting = 'minting', + Closed = 'closed', + RebaseStart = 'rebase_start', +} + +export interface OmigaInscriptionCollection extends UDT { + mintStatus: MintStatus + mintLimit: string + expectedSupply: string + inscriptionInfoId: string +} + +export function isOmigaInscriptionCollection(udt: UDT): udt is OmigaInscriptionCollection { + return 'mintStatus' in udt && 'mintLimit' in udt && 'expectedSupply' in udt && 'inscriptionInfoId' in udt } diff --git a/src/pages/Tokens/index.tsx b/src/pages/Tokens/index.tsx index 3ba0d6997..a9f54aa51 100644 --- a/src/pages/Tokens/index.tsx +++ b/src/pages/Tokens/index.tsx @@ -2,6 +2,8 @@ import { Tooltip } from 'antd' import { Link } from 'react-router-dom' import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' +import { FC } from 'react' +import BigNumber from 'bignumber.js' import Content from '../../components/Content' import Pagination from '../../components/Pagination' import SortButton from '../../components/SortButton' @@ -26,9 +28,22 @@ import styles from './styles.module.scss' import { useIsMobile, usePaginationParamsInPage, useSortParam } from '../../hooks' import { explorerService } from '../../services/ExplorerService' import { QueryResult } from '../../components/QueryResult' -import { UDT } from '../../models/UDT' +import { OmigaInscriptionCollection, UDT, isOmigaInscriptionCollection } from '../../models/UDT' -const TokenItem = ({ token, isLast }: { token: UDT; isLast?: boolean }) => { +const TokenProgress: FC<{ token: OmigaInscriptionCollection }> = ({ token }) => { + return ( + + + + ) +} + +const TokenItem = ({ token, isLast }: { token: UDT | OmigaInscriptionCollection; isLast?: boolean }) => { const { displayName, fullName, uan } = token const { t } = useTranslation() @@ -37,6 +52,19 @@ const TokenItem = ({ token, isLast }: { token: UDT; isLast?: boolean }) => { const defaultName = t('udt.unknown_token') const isMobile = useIsMobile() + const mintStatus = + isOmigaInscriptionCollection(token) && + (isMobile ? ( + + {`${t('udt.status')}:`} + {t(`udt.mint_status_${token.mintStatus}`)} + + ) : ( + <> + {t(`udt.mint_status_${token.mintStatus}`)} + + + )) const transactions = isMobile ? ( {`${t('udt.transactions')}:`} @@ -54,7 +82,7 @@ const TokenItem = ({ token, isLast }: { token: UDT; isLast?: boolean }) => { localeNumberString(token.addressesCount) ) - const isKnown = Boolean(name) && token.published + const isKnown = (Boolean(name) && token.published) || isOmigaInscriptionCollection(token) return ( @@ -64,25 +92,36 @@ const TokenItem = ({ token, isLast }: { token: UDT; isLast?: boolean }) => {
{isKnown ? ( - + {symbol} - {name} + {!isOmigaInscriptionCollection(token) && {name}} ) : ( - - {symbol} - {defaultName} - - )} - {!isKnown && ( - - token icon - + <> + + {symbol} + {defaultName} + + + token icon + + )} {token.description && !isMobile &&
{token.description}
}
+ {isOmigaInscriptionCollection(token) && ( + <> + {isMobile && } +
{mintStatus}
+ + )}
{transactions}
{addressCount}
{!isMobile && ( @@ -94,7 +133,7 @@ const TokenItem = ({ token, isLast }: { token: UDT; isLast?: boolean }) => { ) } -export default () => { +const Tokens: FC<{ isInscription?: boolean }> = ({ isInscription }) => { const isMobile = useIsMobile() const { t } = useTranslation() const { currentPage, pageSize: _pageSize, setPage } = usePaginationParamsInPage() @@ -106,7 +145,11 @@ export default () => { data: tokens, total, pageSize, - } = await explorerService.api.fetchTokens(currentPage, _pageSize, sort ?? undefined) + } = await explorerService.api[isInscription ? 'fetchOmigaInscriptions' : 'fetchTokens']( + currentPage, + _pageSize, + sort ?? undefined, + ) if (tokens.length === 0) { throw new Error('Tokens empty') } @@ -124,13 +167,19 @@ export default () => {
- {t('udt.tokens')} + {isInscription ? t('udt.inscriptions') : t('udt.tokens')} {t('udt.submit_token_info')}
{!isMobile && {t('udt.uan_name')}} + {isInscription && ( + + {t('udt.status')} + + + )} {t('udt.transactions')} @@ -166,3 +215,5 @@ export default () => {
) } + +export default Tokens diff --git a/src/pages/Tokens/styled.tsx b/src/pages/Tokens/styled.tsx index fb251d1c8..eb78d429d 100644 --- a/src/pages/Tokens/styled.tsx +++ b/src/pages/Tokens/styled.tsx @@ -66,6 +66,11 @@ export const TokensTableTitle = styled.div` text-align: right; } + > span:nth-child(5) { + flex: 1.8; + text-align: right; + } + @media (max-width: ${variables.largeBreakPoint}) { > span:nth-child(1) { flex: 3.4; @@ -163,6 +168,24 @@ export const TokensTableItem = styled.div` } } + .tokensItemMintStatus { + flex: 3; + display: flex; + align-items: center; + font-size: 14px; + text-align: right; + color: #000; + + @media (max-width: ${variables.largeBreakPoint}) { + flex: 2.5; + } + + @media (max-width: ${variables.mobileBreakPoint}) { + margin-left: 30px; + margin-top: 3px; + } + } + .tokensItemTransactions { flex: 1.8; font-size: 14px; diff --git a/src/pages/Tokens/styles.module.scss b/src/pages/Tokens/styles.module.scss index 2b328436f..b338ea00f 100644 --- a/src/pages/Tokens/styles.module.scss +++ b/src/pages/Tokens/styles.module.scss @@ -1,9 +1,36 @@ +@import '../../styles/variables.module'; + +.link { + display: flex; + align-items: center; +} + .name { margin-left: 0.25rem; font-size: smaller; color: #aaa; } +.progress { + width: 112px; + height: 8px; + border-radius: 8px; + background: #f5f5f5; + overflow: hidden; + + .block { + display: block; + height: 100%; + border-radius: 8px; + background: var(--primary-color); + } + + @media (width <= $mobileBreakPoint) { + margin-left: 30px; + margin-top: 3px; + } +} + .sortIcon { border: none; outline: none; @@ -25,3 +52,15 @@ fill: var(--primary-color); } } + +.mintStatus { + text-align: left; + width: 88px; +} + +.colStatus:not( + [_='This `:not` selector is used to increase the specificity of the selector and serves no other purpose.'][_=''] + ) { + flex: 3; + text-align: left; +} diff --git a/src/pages/SimpleUDT/SimpleUDTComp.tsx b/src/pages/UDT/UDTComp.tsx similarity index 61% rename from src/pages/SimpleUDT/SimpleUDTComp.tsx rename to src/pages/UDT/UDTComp.tsx index f429174f8..78ee536c0 100644 --- a/src/pages/SimpleUDT/SimpleUDTComp.tsx +++ b/src/pages/UDT/UDTComp.tsx @@ -1,14 +1,10 @@ import { Tooltip } from 'antd' import { Link } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { useState } from 'react' +import { FC, useState } from 'react' +import BigNumber from 'bignumber.js' import TransactionItem from '../../components/TransactionItem/index' -import { - SimpleUDTTransactionsPagination, - SimpleUDTTransactionsPanel, - TypeScriptController, - UDTNoResultPanel, -} from './styled' +import { UDTTransactionsPagination, UDTTransactionsPanel, TypeScriptController, UDTNoResultPanel } from './styled' import { parseUDTAmount } from '../../utils/number' import { ReactComponent as OpenInNew } from '../../assets/open_in_new.svg' import { deprecatedAddrToNewAddr } from '../../utils/util' @@ -17,7 +13,7 @@ import AddressText from '../../components/AddressText' import PaginationWithRear from '../../components/PaginationWithRear' import { CsvExport } from '../../components/CsvExport' import { Transaction } from '../../models/Transaction' -import { UDT } from '../../models/UDT' +import { OmigaInscriptionCollection, UDT, isOmigaInscriptionCollection } from '../../models/UDT' import { Card, CardCellInfo, CardCellsLayout, HashCardHeader } from '../../components/Card' import { useIsMobile } from '../../hooks' import SUDTTokenIcon from '../../assets/sudt_token.png' @@ -28,6 +24,7 @@ import ArrowDownIcon from '../../assets/arrow_down.png' import ArrowUpBlueIcon from '../../assets/arrow_up_blue.png' import ArrowDownBlueIcon from '../../assets/arrow_down_blue.png' import Script from '../../components/Script' +import Capacity from '../../components/Capacity' const typeScriptIcon = (show: boolean) => { if (show) { @@ -36,7 +33,7 @@ const typeScriptIcon = (show: boolean) => { return isMainnet() ? ArrowDownIcon : ArrowDownBlueIcon } -const useAddressContent = (address: string) => { +const IssuerContent: FC<{ address: string }> = ({ address }) => { const { t } = useTranslation() if (!address) { return t('address.unable_decode_address') @@ -64,7 +61,7 @@ const useAddressContent = (address: string) => { ) } -export const SimpleUDTOverviewCard = ({ typeHash, udt }: { typeHash: string; udt: UDT }) => { +export const UDTOverviewCard = ({ typeHash, udt }: { typeHash: string; udt: UDT | OmigaInscriptionCollection }) => { const { t } = useTranslation() const isMobile = useIsMobile() const { @@ -81,33 +78,71 @@ export const SimpleUDTOverviewCard = ({ typeHash, udt }: { typeHash: string; udt } = udt const [showType, setShowType] = useState(false) - const items: CardCellInfo<'left' | 'right'>[] = [ - { - title: t('udt.name'), - content: displayName || fullName, - }, - { - title: t('udt.issuer'), - contentWrapperClass: styles.addressWidthModify, - content: useAddressContent(issuerAddress), - }, - { - title: t('udt.holder_addresses'), - content: addressesCount, - }, - { - title: t(uan ? 'udt.uan' : 'udt.symbol'), - content: uan || symbol, - }, - { - title: t('udt.decimal'), - content: decimal, - }, - { - title: t('udt.total_amount'), - content: parseUDTAmount(totalAmount, decimal), - }, - ] + const items: CardCellInfo<'left' | 'right'>[] = !isOmigaInscriptionCollection(udt) + ? [ + { + title: t('udt.name'), + content: displayName || fullName, + }, + { + title: t('udt.issuer'), + contentWrapperClass: styles.addressWidthModify, + content: , + }, + { + title: t('udt.holder_addresses'), + content: addressesCount, + }, + { + title: t(uan ? 'udt.uan' : 'udt.symbol'), + content: uan || symbol, + }, + { + title: t('udt.decimal'), + content: decimal, + }, + { + title: t('udt.total_amount'), + content: parseUDTAmount(totalAmount, decimal), + }, + ] + : [ + { + title: t('udt.name'), + content: displayName || fullName || (None), + }, + { + title: t('udt.status'), + content: t(`udt.mint_status_${udt.mintStatus}`), + }, + { + title: t('udt.progress'), + content: `${parseUDTAmount(udt.totalAmount, decimal)}/${parseUDTAmount(udt.expectedSupply, decimal)}`, + }, + { + title: t('udt.holder_addresses'), + content: addressesCount, + }, + { + title: t('udt.expected_supply'), + content: ( + + ), + }, + { + title: t('udt.decimal'), + content: decimal, + }, + { + title: t('udt.mint_limit'), + content: parseUDTAmount(udt.mintLimit, decimal), + }, + ] // TODO: To be implemented. const modifyTokenInfo = false &&
Modify Token Info
@@ -123,7 +158,7 @@ export const SimpleUDTOverviewCard = ({ typeHash, udt }: { typeHash: string; udt ) return ( - + {/* When encountering more complex requirements, consider extracting the components within HashCardHeader into smaller components. Then, implement a completely new variant or freely assemble them externally. */} {isMobile && cardTitle} @@ -145,7 +180,7 @@ export const SimpleUDTOverviewCard = ({ typeHash, udt }: { typeHash: string; udt ) } -export const SimpleUDTComp = ({ +export const UDTComp = ({ currentPage, pageSize, transactions, @@ -153,6 +188,7 @@ export const SimpleUDTComp = ({ onPageChange, filterNoResult, id, + isInscription, }: { currentPage: number pageSize: number @@ -161,6 +197,7 @@ export const SimpleUDTComp = ({ onPageChange: (page: number) => void filterNoResult?: boolean id: string + isInscription?: boolean }) => { const { t } = useTranslation() const totalPages = Math.ceil(total / pageSize) @@ -174,7 +211,7 @@ export const SimpleUDTComp = ({ } return ( <> - + {transactions.map( (transaction: Transaction, index: number) => transaction && ( @@ -187,17 +224,18 @@ export const SimpleUDTComp = ({ /> ), )} - - + + } + // TODO: The backend has not yet implemented export support for Inscription (xUDT), so it is disabled for now. + rear={!isInscription && } /> - + ) } -export default SimpleUDTComp +export default UDTComp diff --git a/src/pages/SimpleUDT/index.tsx b/src/pages/UDT/index.tsx similarity index 82% rename from src/pages/SimpleUDT/index.tsx rename to src/pages/UDT/index.tsx index aecd233d8..7cf1efc5b 100644 --- a/src/pages/SimpleUDT/index.tsx +++ b/src/pages/UDT/index.tsx @@ -2,9 +2,10 @@ import { Link, useHistory, useLocation, useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { useQuery } from '@tanstack/react-query' import { Popover } from 'antd' +import { FC } from 'react' import Content from '../../components/Content' -import { SimpleUDTContentPanel, UDTTransactionTitlePanel } from './styled' -import SimpleUDTComp, { SimpleUDTOverviewCard } from './SimpleUDTComp' +import { UDTContentPanel, UDTTransactionTitlePanel } from './styled' +import UDTComp, { UDTOverviewCard } from './UDTComp' import { useIsMobile, usePaginationParamsInPage } from '../../hooks' import Filter from '../../components/Search/Filter' import { localeNumberString } from '../../utils/number' @@ -23,7 +24,7 @@ enum TransactionType { Burn = 'destruction', } -export const SimpleUDT = () => { +export const UDT: FC<{ isInscription?: boolean }> = ({ isInscription }) => { const { t } = useTranslation() const isMobile = useIsMobile() const { push } = useHistory() @@ -35,8 +36,10 @@ export const SimpleUDT = () => { const filter = query.get('filter') const type = query.get('type') - const querySimpleUDT = useQuery(['simple-udt'], () => explorerService.api.fetchSimpleUDT(typeHash)) - const udt = querySimpleUDT.data ?? defaultUDTInfo + const queryUDT = useQuery(['udt', isInscription], () => + isInscription ? explorerService.api.fetchOmigaInscription(typeHash) : explorerService.api.fetchSimpleUDT(typeHash), + ) + const udt = queryUDT.data ?? defaultUDTInfo const querySimpleUDTTransactions = useQuery( ['simple-udt-transactions', typeHash, currentPage, _pageSize, filter, type], @@ -45,7 +48,7 @@ export const SimpleUDT = () => { data: transactions, total, pageSize: resPageSize, - } = await explorerService.api.fetchSimpleUDTTransactions({ + } = await explorerService.api.fetchUDTTransactions({ typeHash, page: currentPage, size: pageSize, @@ -89,11 +92,12 @@ export const SimpleUDT = () => { ] const isFilteredByType = filterList.some(f => f.value === type) + const udtLinkPrefix = !isInscription ? '/sudt' : '/inscription' return ( - - + +
@@ -106,10 +110,10 @@ export const SimpleUDT = () => { showReset={!!filter} placeholder={t('udt.search_placeholder')} onFilter={filter => { - push(`/sudt/${typeHash}?${new URLSearchParams({ filter })}`) + push(`${udtLinkPrefix}/${typeHash}?${new URLSearchParams({ filter })}`) }} onReset={() => { - push(`/sudt/${typeHash}`) + push(`${udtLinkPrefix}/${typeHash}`) }} />
@@ -122,7 +126,7 @@ export const SimpleUDT = () => { {filterList.map(f => ( {f.title} @@ -141,7 +145,7 @@ export const SimpleUDT = () => { {data => ( - { onPageChange={setPage} filterNoResult={filterNoResult} id={typeHash} + isInscription={isInscription} /> )} - + ) } -export default SimpleUDT +export default UDT diff --git a/src/pages/SimpleUDT/state.ts b/src/pages/UDT/state.ts similarity index 53% rename from src/pages/SimpleUDT/state.ts rename to src/pages/UDT/state.ts index 89e1c867f..31bbb2fe5 100644 --- a/src/pages/SimpleUDT/state.ts +++ b/src/pages/UDT/state.ts @@ -1,4 +1,4 @@ -import { UDT } from '../../models/UDT' +import { UDT, OmigaInscriptionCollection, MintStatus } from '../../models/UDT' export const defaultUDTInfo: UDT = { symbol: '', @@ -18,4 +18,13 @@ export const defaultUDTInfo: UDT = { codeHash: '', hashType: '', }, + udtType: 'sudt', +} + +export const defaultOmigaInscriptionInfo: OmigaInscriptionCollection = { + ...defaultUDTInfo, + mintStatus: MintStatus.Closed, + mintLimit: '0', + expectedSupply: '0', + inscriptionInfoId: '', } diff --git a/src/pages/SimpleUDT/styled.tsx b/src/pages/UDT/styled.tsx similarity index 91% rename from src/pages/SimpleUDT/styled.tsx rename to src/pages/UDT/styled.tsx index e8d0da257..b22efbeda 100644 --- a/src/pages/SimpleUDT/styled.tsx +++ b/src/pages/UDT/styled.tsx @@ -15,7 +15,7 @@ export const SUDTContentPanel = styled.div` padding: 20px; } ` -export const SimpleUDTContentPanel = styled.div` +export const UDTContentPanel = styled.div` display: flex; flex-direction: column; align-items: center; @@ -28,7 +28,7 @@ export const SimpleUDTContentPanel = styled.div` } ` -export const SimpleUDTPendingRewardTitlePanel = styled.div` +export const UDTPendingRewardTitlePanel = styled.div` display: flex; flex-direction: row; @@ -54,7 +54,7 @@ export const SimpleUDTPendingRewardTitlePanel = styled.div` } ` -export const SimpleUDTLockScriptController = styled.div` +export const UDTLockScriptController = styled.div` font-size: 16px; font-weight: 600; margin-top: 15px; @@ -102,11 +102,11 @@ export const TypeScriptController = styled(SimpleButton)` } ` -export const SimpleUDTTransactionsPanel = styled.div` +export const UDTTransactionsPanel = styled.div` width: 100%; ` -export const SimpleUDTTransactionsPagination = styled.div` +export const UDTTransactionsPagination = styled.div` margin-top: 4px; width: 100%; ` diff --git a/src/pages/SimpleUDT/styles.module.scss b/src/pages/UDT/styles.module.scss similarity index 97% rename from src/pages/SimpleUDT/styles.module.scss rename to src/pages/UDT/styles.module.scss index ef8eb0d61..3c9a02ff8 100644 --- a/src/pages/SimpleUDT/styles.module.scss +++ b/src/pages/UDT/styles.module.scss @@ -1,6 +1,6 @@ @import '../../styles/variables.module'; -.simpleUDTOverviewCard:not( +.udtOverviewCard:not( [_='This `:not` selector is used to increase the specificity of the selector and serves no other purpose.'] ) { padding-bottom: 20px; @@ -47,6 +47,10 @@ } } +.noneName { + color: #999; +} + .openInNew { cursor: pointer; margin-left: 4px; diff --git a/src/routes/index.tsx b/src/routes/index.tsx index ff7e4c08e..d2766f2d8 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -12,7 +12,7 @@ const Transaction = lazy(() => import('../pages/Transaction')) const TransactionList = lazy(() => import('../pages/TransactionList')) const Address = lazy(() => import('../pages/Address')) const ScriptPage = lazy(() => import('../pages/Script')) -const SimpleUDT = lazy(() => import('../pages/SimpleUDT')) +const UDT = lazy(() => import('../pages/UDT')) const NftCollections = lazy(() => import('../pages/NftCollections')) const NftCollectionInfo = lazy(() => import('../pages/NftCollectionInfo')) const NftInfo = lazy(() => import('../pages/NftInfo')) @@ -94,7 +94,13 @@ const routes: RouteProps[] = [ }, { path: '/sudt/:hash', - component: SimpleUDT, + component: UDT, + }, + { + path: '/inscription/:hash', + render: routeProps => { + return + }, }, { path: '/nft-collections', @@ -116,6 +122,12 @@ const routes: RouteProps[] = [ path: '/tokens', component: Tokens, }, + { + path: '/inscriptions', + render: routeProps => { + return + }, + }, { path: '/charts', component: StatisticsChart, diff --git a/src/services/ExplorerService/fetcher.ts b/src/services/ExplorerService/fetcher.ts index 240b10a69..75081b631 100644 --- a/src/services/ExplorerService/fetcher.ts +++ b/src/services/ExplorerService/fetcher.ts @@ -12,7 +12,7 @@ import { Script } from '../../models/Script' import { Block } from '../../models/Block' import { Transaction } from '../../models/Transaction' import { Address } from '../../models/Address' -import { UDT } from '../../models/UDT' +import { OmigaInscriptionCollection, UDT } from '../../models/UDT' async function v1Get(...args: Parameters) { return requesterV1.get(...args).then(res => toCamelcase>(res.data)) @@ -172,7 +172,7 @@ export const apiFetcher = { | Response.Wrapper | Response.Wrapper | Response.Wrapper - | Response.Wrapper + | Response.Wrapper | Response.Wrapper