Skip to content

Commit

Permalink
Merge pull request #767 from Conflux-Chain/dev
Browse files Browse the repository at this point in the history
feat: release v2.12.0
  • Loading branch information
0x74616e67 authored May 30, 2022
2 parents 4d6393a + 52a1303 commit 1d7bf8c
Show file tree
Hide file tree
Showing 23 changed files with 534 additions and 492 deletions.
1 change: 0 additions & 1 deletion src/app/components/Charts/StockChartTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ export function StockChartTemplate({
tooltip: {
split: false,
useHTML: true,
xDateFormat: '%a %e, %b %Y (UTC)',
headerFormat: `<table>
<tr>
<th colspan="2" style="font-weight: normal;">{point.key}</th>
Expand Down
74 changes: 55 additions & 19 deletions src/app/components/NFTPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import audioPause from './audio-pause.svg';
import audioPlay from './audio-play.svg';
import Link from '@zeit-ui/react-icons/link';
import { Link as ALink } from 'app/components/Link/Loadable';
import { formatString } from 'utils';
import { Tag } from '@cfxjs/antd';

const epiKProtocolKnowledgeBadge =
'cfx:acev4c2s2ttu3jzxzsd4a2hrzsa4pfc3f6f199y5mk';
Expand Down Expand Up @@ -181,10 +183,14 @@ export const NFTPreview = React.memo(
contractAddress,
tokenId,
type = 'preview',
amount = 0,
owner = '',
}: {
contractAddress?: string;
tokenId?: number | string;
type?: 'preview' | 'card' | 'primary';
amount?: number;
owner?: string;
}) => {
const { t, i18n } = useTranslation();
const lang = i18n.language.includes('zh') ? 'zh' : 'en';
Expand Down Expand Up @@ -226,28 +232,35 @@ export const NFTPreview = React.memo(
return (
<NFTCard>
<Spin spinning={loading}>
{imageUri ? (
contractAddress === epiKProtocolKnowledgeBadge ? (
<div className="ant-image">
<iframe title={imageName} src={imageUri} />
</div>
<div className="nft-container">
{imageUri ? (
contractAddress === epiKProtocolKnowledgeBadge ? (
<div className="ant-image">
<iframe title={imageName} src={imageUri} />
</div>
) : (
<NFTCardInfo
imageUri={imageUri}
tokenId={tokenId}
width={500}
/>
)
) : isFirstTime ? (
<Skeleton.Image />
) : (
<NFTCardInfo
imageUri={imageUri}
tokenId={tokenId}
<Image
width={500}
src={NotFoundIcon}
alt={'not found'}
fallback={tokenIdNotFound}
/>
)
) : isFirstTime ? (
<Skeleton.Image />
) : (
<Image
width={500}
src={NotFoundIcon}
alt={'not found'}
fallback={tokenIdNotFound}
/>
)}
)}
{!!amount && (
<Tooltip title={t(translations.nftChecker.amount)}>
<Tag className="nft-amount">x{amount}</Tag>
</Tooltip>
)}
</div>
<div className="info">
<div className="info-name">
<Tooltip title={imageName}>
Expand All @@ -268,6 +281,17 @@ export const NFTPreview = React.memo(
<ALink href={`/nft/${contractAddress}/${tokenId}`}>
{t(translations.general.table.token.view)}
</ALink>
{owner && (
<>
<br></br>
<Tooltip title={owner}>
{t(translations.nftChecker.owner)}:{' '}
<ALink href={`/address/${owner}`}>
{formatString(owner, 'address')}
</ALink>{' '}
</Tooltip>
</>
)}
</div>
</div>
</Spin>
Expand Down Expand Up @@ -483,6 +507,18 @@ const NFTCard = styled.div`
}
}
.nft-container {
position: relative;
.nft-amount {
position: absolute;
top: 5px;
right: 5px;
margin: 0;
padding: 0 5px;
}
}
.info {
padding: 8px 10px 10px;
font-size: 12px;
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/StatsCard/NetworkPie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export function NetworkPie({ data }) {
title: {
text: '',
},
credits: {
enabled: false,
},
height: 9 / 21 / 100 + '%',
tooltip: {
outside: true,
Expand Down
4 changes: 2 additions & 2 deletions src/app/containers/Charts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PageHeader } from 'app/components/PageHeader/Loadable';
import { useTranslation } from 'react-i18next';
import { translations } from 'locales/i18n';
import styled from 'styled-components/macro';
import dayjs from 'dayjs';
import moment from 'moment';

import { BlockTime } from './BlockTime';
import { TPS } from './TPS';
Expand All @@ -25,7 +25,7 @@ export function NewChart() {
const iszh = i18n.language.includes('zh');

const format = iszh ? 'YYYY MMMDD' : 'DD MMM YYYY';
const current = dayjs().subtract(1, 'day');
const current = moment().subtract(1, 'day');
const oneMonthBefore = current.subtract(30, 'day');

return (
Expand Down
3 changes: 0 additions & 3 deletions src/app/containers/Footer/Language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import styled from 'styled-components/macro';
import Globe from '@zeit-ui/react-icons/globe';
import { trackEvent } from '../../../utils/ga';
import { ScanEvent } from '../../../utils/gaConstants';
import dayjs from 'dayjs';

export function Language() {
const { i18n } = useTranslation();
Expand All @@ -19,15 +18,13 @@ export function Language() {
label: 'en',
});
i18n.changeLanguage('en');
dayjs.locale('en');
} else {
trackEvent({
category: ScanEvent.preference.category,
action: ScanEvent.preference.action.changeLang,
label: 'zh-CN',
});
i18n.changeLanguage('zh-CN');
dayjs.locale('zh-cn');
}
};
const options = [
Expand Down
3 changes: 0 additions & 3 deletions src/app/containers/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { useGlobalData, GlobalDataType } from 'utils/hooks/useGlobal';
import { getNetwork, gotoNetwork } from 'utils';
import { NETWORK_TYPE, NETWORK_TYPES } from 'utils/constants';
import { Notices } from 'app/containers/Notices/Loadable';
import dayjs from 'dayjs';

import logo from 'images/logo.svg';
import logoTest from 'images/logo-test.svg';
Expand Down Expand Up @@ -566,7 +565,6 @@ export const Header = memo(() => {
menuClick();
if (iszh) {
i18n.changeLanguage('en');
dayjs.locale('en');
}
},
isMatchedFn: () => !iszh,
Expand All @@ -583,7 +581,6 @@ export const Header = memo(() => {
menuClick();
if (!iszh) {
i18n.changeLanguage('zh-CN');
dayjs.locale('zh-cn');
}
},
isMatchedFn: () => iszh,
Expand Down
8 changes: 5 additions & 3 deletions src/app/containers/HomePage/BlockchainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export function BlockchainInfo({ timestamp = 1 }: { timestamp?: number }) {
<Link to="/charts/tps" className="info-link">
{t(translations.charts.tps.title)}
</Link>,
plotData.tps,
lodash.isNil(plotData.tps) ? '--' : plotData.tps,
)}
</Grid>
<Grid xs={24} sm={24} md={4}>
Expand All @@ -178,15 +178,17 @@ export function BlockchainInfo({ timestamp = 1 }: { timestamp?: number }) {
<Link to="/charts/blocktime" className="info-link">
{t(translations.charts.blockTime.title)}
</Link>,
plotData.blockTime + 's',
lodash.isNil(plotData.blockTime)
? '--'
: plotData.blockTime + 's',
)}
</Grid>
<Grid xs={24} sm={24} md={4}>
{Info(
<Link to="/charts/hashrate" className="info-link">
{t(translations.charts.hashRate.title)}
</Link>,
plotData.hashRate,
lodash.isNil(plotData.hashRate) ? '--' : plotData.hashRate,
)}
</Grid>
</Grid.Container>
Expand Down
Loading

0 comments on commit 1d7bf8c

Please sign in to comment.