Skip to content

Commit

Permalink
Merge pull request #762 from Conflux-Chain/s37
Browse files Browse the repository at this point in the history
fix: fixed bugs
  • Loading branch information
0x74616e67 authored May 26, 2022
2 parents d8263c9 + 22097d7 commit fa5eefd
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/app/components/NFTPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ export const NFTPreview = React.memo(
<br></br>
<Tooltip title={owner}>
{t(translations.nftChecker.owner)}:{' '}
{formatString(owner, 'address')}
<ALink href={`/address/${owner}`}>
{formatString(owner, 'address')}
</ALink>{' '}
</Tooltip>
</>
)}
Expand Down
6 changes: 5 additions & 1 deletion src/app/containers/Charts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ import { Contracts } from './Contracts';
export function NewChart() {
const { t, i18n } = useTranslation();
const iszh = i18n.language.includes('zh');
dayjs.locale(i18n.language.toLowerCase() as 'zh-cn' | 'en');

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

if (localStorage.getItem('test')) {
console.log(iszh, format);
console.log(oneMonthBefore.format(format), current.format(format));
}

return (
<StyledChartPreviewWrapper>
<PageHeader subtitle={t(translations.highcharts.preview.subtitle)}>
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
1 change: 1 addition & 0 deletions src/app/containers/NFTDetail/TransferModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export const TransferModal = ({
min={1}
max={NFT1155Quantity}
style={{ width: '100%' }}
precision={0}
/>
</Form.Item>
)}
Expand Down
16 changes: 16 additions & 0 deletions src/app/containers/NFTDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ export function NFTDetail(props) {
)}
</SkeletonContainer>
</Description>
{tokenType?.includes('721') && (
<Description title={t(translations.nftDetail.owner)}>
<SkeletonContainer shown={loading}>
{data.owner ? (
<>
<Link href={`/address/${data.owner}`}>
{data.owner}
</Link>{' '}
<CopyButton copyText={data.owner} />
</>
) : (
'--'
)}
</SkeletonContainer>
</Description>
)}
<Description title={t(translations.nftDetail.type)}>
<SkeletonContainer shown={loading}>
{tokenType ? tokenType : '--'}
Expand Down
2 changes: 1 addition & 1 deletion src/locales/zh_cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@
"tokenId": "代币 ID",
"plzSearch": "请搜索",
"plzSearchDesc": "请在上方输入地址以查看其拥有的 NFT",
"owner": "所有人",
"owner": "持有人",
"amount": "NFT 数量"
},
"pos": {
Expand Down

0 comments on commit fa5eefd

Please sign in to comment.