From 947178f96b569802d12130e77c3af7271af4cf57 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:36:48 +0900 Subject: [PATCH 1/6] chore(deps): update dependency @types/node to v16.18.66 (#160) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 479d51f86..6782e2332 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@types/echarts": "4.9.22", "@types/eslint": "8.44.6", "@types/jest": "26.0.24", - "@types/node": "16.18.61", + "@types/node": "16.18.66", "@types/react": "17.0.65", "@types/react-dom": "17.0.20", "@types/react-outside-click-handler": "^1.3.0", diff --git a/yarn.lock b/yarn.lock index 5e7e5be67..6cb496cb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5279,10 +5279,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-13.11.0.tgz#390ea202539c61c8fa6ba4428b57e05bc36dc47b" integrity sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ== -"@types/node@16.18.61": - version "16.18.61" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.61.tgz#5ea47e3018348bf3bbbe646b396ba5e720310be1" - integrity sha512-k0N7BqGhJoJzdh6MuQg1V1ragJiXTh8VUBAZTWjJ9cUq23SG0F0xavOwZbhiP4J3y20xd6jxKx+xNUhkMAi76Q== +"@types/node@16.18.66": + version "16.18.66" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.66.tgz#f59cc2ff96cc47f972a11a458a9b29bf0a209c34" + integrity sha512-sePmD/imfKvC4re/Wwos1NEcXYm6O96CAG5gQVY53nmDb8ePQ4qPku6uruN7n6TJ0t5FhcoUc2+yvE2/UZVDZw== "@types/node@^18.0.0": version "18.18.9" From 3261586b72d2236754d1cf054aff030344693c95 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:49:52 +0900 Subject: [PATCH 2/6] fix(deps): update dependency dayjs to v1.11.10 (#165) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6782e2332..157de3178 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "camelcase": "7.0.1", "camelcase-keys": "7.0.2", "classnames": "2.3.2", - "dayjs": "1.11.9", + "dayjs": "1.11.10", "default-passive-events": "2.0.0", "echarts": "4.9.0", "history": "5.3.0", diff --git a/yarn.lock b/yarn.lock index 6cb496cb1..44154d9c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8069,10 +8069,10 @@ date-fns@2.x: dependencies: "@babel/runtime" "^7.21.0" -dayjs@1.11.9: - version "1.11.9" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.9.tgz#9ca491933fadd0a60a2c19f6c237c03517d71d1a" - integrity sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA== +dayjs@1.11.10: + version "1.11.10" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0" + integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ== dayjs@1.x: version "1.11.8" From 2fa4b517812d05f57d36eb706e5ef84982d377c1 Mon Sep 17 00:00:00 2001 From: Chen Yu Date: Thu, 30 Nov 2023 19:21:16 +0900 Subject: [PATCH 3/6] ci: add an action to check spelling (#163) * ci: add an action to check spelling * fix: fix typos (#164) --- .github/workflows/check-spelling.yml | 13 +++++++++++++ _typos.toml | 6 ++++++ src/__tests__/utils/spore.test.ts | 6 +++--- src/__tests__/utils/util.test.ts | 4 ++-- src/components/Banner/HalvingBanner.tsx | 2 +- src/components/Banner/index.module.scss | 6 +++--- src/components/DecimalCapacity/index.tsx | 2 +- src/components/DecimalCapacity/styles.module.scss | 2 +- src/locales/en.json | 10 +++++----- src/locales/zh.json | 4 ++-- src/pages/Halving/index.tsx | 4 ++-- src/pages/Home/AverageBlockTimeChart/index.tsx | 4 ++-- src/pages/NftInfo/styles.module.scss | 2 +- .../mining/DifficultyUncleRateEpoch.tsx | 12 ++++++------ src/types/echarts.d.ts | 2 +- 15 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/check-spelling.yml create mode 100644 _typos.toml diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml new file mode 100644 index 000000000..1bef4852b --- /dev/null +++ b/.github/workflows/check-spelling.yml @@ -0,0 +1,13 @@ +name: Check spelling + +on: + - pull_request + - push + +jobs: + run: + name: Check spelling + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: crate-ci/typos@master diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 000000000..586c3b993 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,6 @@ +[default.extend-words] +# ordinal suffix +st='st' +nd='nd' +rd='rd' +th='th' diff --git a/src/__tests__/utils/spore.test.ts b/src/__tests__/utils/spore.test.ts index bde14e9e3..dfaf7778c 100644 --- a/src/__tests__/utils/spore.test.ts +++ b/src/__tests__/utils/spore.test.ts @@ -5,7 +5,7 @@ import { parseSporeCellData, parseSporeClusterData } from '../../utils/spore' const sporeCellData = '0xe80f0000100000001e000000c40f00000a000000696d6167652f77656270a20f0000524946469a0f000057454250565038208e0f0000f093009d012af40179033e9148a14ca5a423a220b37830b01209696ee177611fdd5d8d9e23e47f61f477b2bf8cfa63e41f313d8e7f57fc2fe607ce0ff87eaf7cc1bf5aba79f9a2fb60f742ff8ffb55efcbfb87a97ff53ff87d74de8bbe5c3ed2bfba5e9199cc1d7e7fb4e91af894bd9bfad4a7b5bcfef687c021e3f6817747cfa267caf7d023c5bf4cbf5d7a3a82093264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c993264c9937c576e7310bc993264c993264c99321abc0f7dc5dcea64c993264c993264c992cb00461e960075816f26376b0a40cb264c993264c993259679146f1b6bbaa281da07ad9f92661f3c365eae1c74dd5fd12cf3b3720ad36c1309b24d9b366cd9b366ced702977891486c8549ac9311be75400f15395915f0f8015d467fe0d03ac4cbb50d2529494a66d01b4be46fff17ae74fb74ff613ac993264c993264c9bfb851d938d29f4e65dfd5d67fa8a21dbc133b965bde881b6b8ff80014ddc0f295484fa6ec0da86f5d51ac363fab77d24d9b366cd9b366d2bab72642ba9ed77decbea69282dbd2343861ea4a868b5271f79c3e1b32722c43590e12593264c993264c9a66e3f7dcdf51a8aa883183eb5aa1502b76002c6fe694cf10204081020408106c2b468c05dbc8da26c5c01b238be5d655fb385f8fd2a3addfdd94ec7eab5d3e60c183060c183060c1678a3bf4a843b054c2a820709160e43807fee66d5e0a7cc8f38f2aa365b1e31f853060c183060c183060c1faeeecbf7af53706c58ae9942d48bbacbc75993264c993264c993264b334b55bfcb5770e882c5c5651a95772ed8f2a4f727d86593264c993264c993265367ee960c0c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c183060c18306020000feffbbfffed3349793bfe62eb886f5d06615c03397000000000000000000000000000000000000197bb417b920bd052626684a7c0a563e2db21e937b3cf8ea8db42dd018aefca15e02d299fca50ef632e933fafe540877cb265edaa3054b0e9ba49a5d255410e2fb84f804d27e0adf3941ee62bc604fe7bed44667ef2c7a41909a3606c8930f19c86b09f7f590b8ac324eeffa036341dcf5d4379370c07ef1b89c018ca23ff823bb0c8ff861bee056f275435a00609e4109b1dbe6403f86db242737be04ebbf578b35b9243b473fd55fed22d13537b7f4b4f9585e7d261497605a2c92f3148ca10cd7d0018a67681593711f11465da834bdd4ce68b4d2cfa3f961ba42ac90257fd5e6e5c32e245b133032575226a2abe61234cb120b8cbe83afd5df43f13c7e77e216b8dcdb7166067c4b9d7c61df829e8ff92d533ec78281d79a6b43200d2b40ca34a13a0f6841356483b3216531cb938080c9376083e57ab34eda445b13e514fcd55d93162bb95b57068feeed23e6e43b573a8626719f6172233040f389202c87d0188579d354ca8e3d49795c8f99019e81f1c5d153436cf7eab342bf4b1f6912647ae2a4ffd4bd19e280c0f375d0eae2357e9508a6f0cb90b139253300e5d2aeaf6a58883b669ed1622b33838678beb70c3175d44094094cfa77b5a0678fd8fdcbf3555a8410f5a1f79acffd7b6757bc722dd1e24204fefb40be730bc9dae88a1872a9c625dc262e0764921c70496e2b5e4d3e56c7d0b0b61ec6ff649896afbb0041530ae6f66a289c9ede4a9ecb823cf59f2812a78158906c2098ac7369fabe0ce4c693cc30514e674a1839f2538c7ff7bb5df7425ee5d81540c0063f7a3a003eb4b09ba96a8f175bcaa5a0e950def71f500a75b3705e8ee8ceb5620929971e1e858519e8daf4f13939382db96a3950534558f3e821e22f9108b73983466048b5e2b0eb36f4e268859135043f6abd9d9af5601432588f5f6ed400360df300ab445ff2b872624b38b137ba5ff36e18e47c3ab36021a74c528ea5d796d19af6b4150ac4145281df5a05eba81c58eec056ab91e64bf6e572f5c142935cf0067a5ef004bcf3239ad63712d02812f62ea00aeb6aee05593fba2924fdda809bdc9c25bfc19390b091ff3229ca9c6627e85634a4f3fb8f645d5e3b9c888648d764b6d73360721b2007a58f3a7e21cf766d21391a93afbc5e6d6431b6c9028c23ee87a08eb656784c0df6dcef937e5971b976f3dbcffbb6c95dca4fe921102e762002de1bdf655c31ec23fa1d12be397f1fa4f3309004e942a68b776a24878eda9ec6f1e9c9f02adc13663a8f30ff9646a1927f7b91eec2e22e984c6b5bee221ffc81df11431f85737b1ff253fa6b87278aac3f0d6419bac8a65ffeff3dfef94e91f12dd7ba62108def41ca194cfea5b88778f794557edd5372160006711107209182a2cce058731d2d130bb684d9c8c686c1d0678bbcf92ed2930bee90d0e9f2b31cf83749d39e2ed38a133e500521346dd1a424b71c77c7615a705d2b8a176f0711c25778081737829000e5a200887a98cba68f45d136e837e7c98eecc892e7b09458e9c67f98dab2d8503cbf019c694323f434ae7a65dba680e6efccff4e55f2095e222ceeeb543ed2adf8a2d847fa15543c8569496eaf01f622bf8c63a74d9f4c9da4d98464c3f0644f51e620af81a8cca480374b351aa81ae6d9045ef8ab1866e41db05ee63cc6930a86fbdf4b06fa0b56159e093ce657ec92802bf329c580ef0b32fafffe172abbd2abc6b4e6e85d3bc1e35f58fddd2441d9ae41c191322936c0b718f4c904a974b3b9804e08bf775f4320c89142386e57df3cb5726481ff31eb883bd38a8b925e590bb6ec7174000d8c3fe46dcbbed1e5d4f349dc0c0a8f6f1e5436190a297d886819d9cd9b4ba8ee89271c101af7b2bccd2d0cf7bd7added14e8d8564c79f6dbaec9335be745e8696cf8ceddee5fecfcb999336c6c62e37905e1b36fddfef3c56c71d3f2536bfb4af9f18e8ff1c9454cd23985f7e4f61d187f5975b961acd59427938687c4c49171daa3024b21fb21e61249ccda1d82ae47a15e08ac262322df9fc3578dedf45d4e8c82227ec25e7e91655e715f6a559e29e52e8142f4a7639f9726c2188371f2679ec4d5d8e190d6f36459f6727a0b761220309db15f66f3f0a97ff05c3fefcbef7b84b90a1f78fe8bae390b9176e500ffae04c13874d134299b3db846eb567e4d25f7901b50f8efa163acab7aaaa85d802bbbe50bb773a40154725cb8747da0946f694ecf07d35c2100aba16a25a0635648ce97a03c3acaa17a444c4e12369bcbe8bcf794dfb34b4d0fb45703b82c4ea3fd8abf20baa0314b3ed537dd2041b7e6fec124bd8374a74c8040d29ca6d38f706644ff70fda2cd2bd22d3d6f75869d4f51a1eaccf1b98ea7576b10050bad075ee6e4f6284ce90b1476b3d54471da0c5b943a9062aab5e88af3ed458c4ddcc64b32ed86c216a06da26f27e1ccae0169d91be70d54be97a37bd3d3d487875d50410c001462785b62e835926ec60c4efcc46adea5cabd59b660411ddd6ce4778094491981c0fa4aee0a407e55efd78ed157a3029c9099bbabd88e2db72f82b507b5a1b556b3dca0093c5b55610c397537f31861ecde3247743ba9dd37639966f6b171b436ca9fd672e93f3e1389af03d0deb3a3e8680350a1bb9577bb54f59a9ebb6cac18858f5cb66cf18102822adaf8e86b1339e747dc7e850ff343a8954b51b69e28128c8a75fdf38900fb62ab3176f2d1becd65571c486abdbd2995ac748468daa207196c224c50e24db82e2a31f03f539cfa52adc8750e4d1e654137922d6d4e7c576c5c681315b33baa2b0919b5d7b698cfa9d439623450f846f1fb8d16b21d3c202713301ea52a990e632875cc0f56dd814d680cad72ea3aa890c2772625a319626505f630002dc12605193c1151defb76642033b07cb9b9bde393cb453b19e7b8684fdf89b44bec535ac464237257f620ea7697f53cc000686a7aa2bf6eb060af962a852f19ba0b54989f49c9b3547b8b67cf9f71a0aacfd4f66f35f73cc707b47da10433795b45ad7dc97024e739fabf8010308c083e60fc7ce533249193a6177d898fb2870a03533cb438f1b029828ac61710468a5813ebc0418ae0b934ecbb277ec55f08a533fa94a33dce7e359d8ac55f88126db086efd09e7ff9c48d8cd178bc4e1b05ac88fec3657081ea75918420d32c76de12b953bb40266ae2968d91c94073f5b8cf246642e47f2be12119f0dd5723b03d956241f3dbdbb744712633086ca59ba9ea1846db47d500bc00807cff30c50e131f610b253be7b1106fb4c90fc0be0b5ad4325052cc9770202027c6add626247219ad1159d9aca331ff2f1f8557a26d6dfbdfc1e684f41252da56e9877bf3c29332f70abca1048240b644b574233c0d3dcd1e796a7854c3872cb01e7fdfec8d8cf9d0ad8d8bb55858786baab41622d6dbf9b6b008e64a85dd1ad28f7d5cda9da74f37ab07dcdaabe6e46fb4c46ab96fce29a5e47d4d6999d1f6b8f67848a0a4425b772c114e3ee4212e43fd18e30b95f1b80152d448d8a657d1a5c7e4f4829c8a2aaa238a45089f3c549cd2f212c05c19d122da2e892b07665cda16a4525736b5f43abd003238730fe0ee76f9cd87968c02bea0d3d21769e70b68b51240fbf79439887ea9cc57c3ce117e317e171d667cca8aab9e5ea731df36fb08f545daad20d5d080f38e8d04ec4c5ad1730b3fe15d63c2b0f1769873f2e3ba947f4ab3359076746f710384a086ce21b36805108c28fc23b74d933edf486f0c81818657db00c4da23722af61ed415e31085e0dfbad52287af1e6f3ebf9fdd755c8f62665290ad1865e309330553e4bd6085a27709223380000000000000000000000000000000000000000020000000d4d9d5b2ba21d63f0e6f9f4bb811397fceaf088722fd951b42b8a1642696724b' -// from existed create spore cluster trasaction: https://pudge.explorer.nervos.org/transaction/0xdd169db0980631ab796a49b3223cd1422425ea0964245ceaa0ca1e409ee6ce31 +// from existed create spore cluster transaction: https://pudge.explorer.nervos.org/transaction/0xdd169db0980631ab796a49b3223cd1422425ea0964245ceaa0ca1e409ee6ce31 const sporeClusterData = '0x270000000c0000001b0000000b000000434b424578706c6f72657208000000466f722054657374' describe('Parse Spore cell data', () => { @@ -17,14 +17,14 @@ describe('Parse Spore cell data', () => { globalThis.TextDecoder = undefined as any }) - it('pasre spore cell data', async () => { + it('parse spore cell data', async () => { const result = parseSporeCellData(sporeCellData) expect(result.contentType).toBe('image/webp') expect(result.clusterId).toBe('0xd4d9d5b2ba21d63f0e6f9f4bb811397fceaf088722fd951b42b8a164269672') }) - it('pasre spore cluster data', async () => { + it('parse spore cluster data', async () => { const result = parseSporeClusterData(sporeClusterData) expect(result.name).toBe('CKBExplorer') diff --git a/src/__tests__/utils/util.test.ts b/src/__tests__/utils/util.test.ts index 8d16fb3ca..8f643858c 100644 --- a/src/__tests__/utils/util.test.ts +++ b/src/__tests__/utils/util.test.ts @@ -1,7 +1,7 @@ import { toCamelcase, shannonToCkb, shannonToCkbDecimal, parseSince } from '../../utils/util' describe('Number methods tests', () => { - it('pasre simple object to camelcase', async () => { + it('parse simple object to camelcase', async () => { interface Data { dataName: string dataValue: string @@ -17,7 +17,7 @@ describe('Number methods tests', () => { }) }) - it('pasre complex object to camelcase', async () => { + it('parse complex object to camelcase', async () => { interface Data { dataName: string dataValue: { diff --git a/src/components/Banner/HalvingBanner.tsx b/src/components/Banner/HalvingBanner.tsx index 0195d8e39..b63a06798 100644 --- a/src/components/Banner/HalvingBanner.tsx +++ b/src/components/Banner/HalvingBanner.tsx @@ -61,7 +61,7 @@ export const HalvingBanner = () => { } if (countdown <= 3) { - return t('halving.comming_soon') + return t('halving.coming_soon') } return ( diff --git a/src/components/Banner/index.module.scss b/src/components/Banner/index.module.scss index 67da15ed9..c16ec9c5d 100644 --- a/src/components/Banner/index.module.scss +++ b/src/components/Banner/index.module.scss @@ -1,8 +1,8 @@ -$backgroudColor: #232323; +$backgroundColor: #232323; .root { width: 100%; - background-color: $backgroudColor; + background-color: $backgroundColor; height: 200px; position: relative; background-image: url('./ckb_explorer_banner.svg'); @@ -22,7 +22,7 @@ $backgroudColor: #232323; .halvingBannerWrapper { width: 100%; - background-color: $backgroudColor; + background-color: $backgroundColor; height: 200px; position: relative; background-repeat: no-repeat; diff --git a/src/components/DecimalCapacity/index.tsx b/src/components/DecimalCapacity/index.tsx index a45171cab..a86dea771 100644 --- a/src/components/DecimalCapacity/index.tsx +++ b/src/components/DecimalCapacity/index.tsx @@ -37,7 +37,7 @@ export default ({ return ( - {integer} + {integer} CoTA RDC", + "cota": "A kind of NFT protocol. A Compact Token Aggregator Standard for Extremely Low Cost NFTs and FTs. For more details, please check the CoTA RDC", "m_nft": "The NFT Type Scripts implement of RFC: Multi-purpose NFT Draft Spec on Nervos CKB. For more details, please check the CKB-NFT-Script", "nrc721": "NRC-721 is a token standard for non-fungible tokens (NFTs) on the Nervos CKB blockchain. It is similar to the ERC-721 token standard used on the Ethereum blockchain, and provides a common interface for creating, managing, and transferring unique digital assets on the CKB network. NRC-721 tokens are unique and non-interchangeable, which makes them ideal for representing assets such as collectibles, game items, and other unique digital assets.", "hash_rate": "Hash Rate is a measure of the computational power per second used when mining a cryptocurrency. It represents the number of hash operations that can be performed by a miner in a given period of time. In the context of blockchain, hash rate is used to measure the amount of work that is being done by the network to maintain the blockchain. A higher hash rate indicates that the network is more secure, as it becomes more difficult for a malicious actor to perform a 51% attack." @@ -327,7 +327,7 @@ }, "search": { "loading": "Loading...", - "empty_result": "Opps! Your search did not match any record. \n\nPlease make sure input contains only one of the following items:\n", + "empty_result": "Oops! Your search did not match any record. \n\nPlease make sure input contains only one of the following items:\n", "empty_result_items": "Block Number/ Block Hash/ Transaction Hash/ Address/ Lock Hash/ Type Hash", "address_type_testnet_error": "Testnet address detected,please goto", "address_type_mainnet_error": "Mainnet address detected,please goto", @@ -534,7 +534,7 @@ }, "error": { "maintain": "The site is temporarily down for maintenance. Please check back soon.", - "page_crashed_tip": "Opps! Some errors were encountered.", + "page_crashed_tip": "Oops! Some errors were encountered.", "back_home": "BACK HOME" }, "pagination": { diff --git a/src/locales/zh.json b/src/locales/zh.json index 752b7630c..c48092f68 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -45,11 +45,11 @@ "halving": { "congratulations": "恭喜", "the": "", - "actived": "生效于高度", + "activated": "生效于高度", "next": "下一次", "halving": "减半", "and": "和", - "comming_soon": "减半将在几秒钟内发生", + "coming_soon": "减半将在几秒钟内发生", "halving_countdown": "减半倒计时", "learn_more": "了解更多", "banner_congratulation": "CKB {{times}}减半生效", diff --git a/src/pages/Halving/index.tsx b/src/pages/Halving/index.tsx index 1d72f65f9..199c52b65 100644 --- a/src/pages/Halving/index.tsx +++ b/src/pages/Halving/index.tsx @@ -105,7 +105,7 @@ export const HalvingCountdownPage = () => { {t('symbol.char_space')} {t('halving.halving')} {t('symbol.char_space')} - {t('halving.actived')}{' '} + {t('halving.activated')}{' '} {getTargetBlockByHavingCount(halvingCount) ? ( {new BigNumber(getTargetBlockByHavingCount(halvingCount)!).toFormat()}. @@ -135,7 +135,7 @@ export const HalvingCountdownPage = () => { return (
- {t('halving.comming_soon')} + {t('halving.coming_soon')}
diff --git a/src/pages/Home/AverageBlockTimeChart/index.tsx b/src/pages/Home/AverageBlockTimeChart/index.tsx index f338ea72a..94f4a750e 100644 --- a/src/pages/Home/AverageBlockTimeChart/index.tsx +++ b/src/pages/Home/AverageBlockTimeChart/index.tsx @@ -119,8 +119,8 @@ export default memo(() => { const fullStatisticAverageBlockTimes = useMemo(() => query.data ?? [], [query.data]) const statisticAverageBlockTimes = useMemo(() => { - const last14Dyas = -336 - return fullStatisticAverageBlockTimes.slice(last14Dyas) + const last14Days = -336 + return fullStatisticAverageBlockTimes.slice(last14Days) }, [fullStatisticAverageBlockTimes]) if (query.isLoading || statisticAverageBlockTimes.length === 0) { diff --git a/src/pages/NftInfo/styles.module.scss b/src/pages/NftInfo/styles.module.scss index e12f50dc3..40188a96f 100644 --- a/src/pages/NftInfo/styles.module.scss +++ b/src/pages/NftInfo/styles.module.scss @@ -82,7 +82,7 @@ } .name, - .itmes { + .items { width: 440px; } } diff --git a/src/pages/StatisticsChart/mining/DifficultyUncleRateEpoch.tsx b/src/pages/StatisticsChart/mining/DifficultyUncleRateEpoch.tsx index a3f6a9373..f70605809 100644 --- a/src/pages/StatisticsChart/mining/DifficultyUncleRateEpoch.tsx +++ b/src/pages/StatisticsChart/mining/DifficultyUncleRateEpoch.tsx @@ -53,9 +53,9 @@ const useOption = ( } const COUNT_IN_THUMBNAIL = 90 - const epochNumberSerie = statisticChartData.map(data => data.epochNumber) - const epochTimeSerie = statisticChartData.map(data => parseHourFromMillisecond(data.epochTime)) - const epochLengthSerie = statisticChartData.map(data => data.epochLength) + const epochNumberSeries = statisticChartData.map(data => data.epochNumber) + const epochTimeSeries = statisticChartData.map(data => parseHourFromMillisecond(data.epochTime)) + const epochLengthSeries = statisticChartData.map(data => data.epochLength) const endValue = statisticChartData[statisticChartData.length - 1]?.epochNumber ?? '0' const startValue = Math.max(+endValue - COUNT_IN_THUMBNAIL, 0).toString() const parseTooltip = useTooltip() @@ -120,7 +120,7 @@ const useOption = ( nameGap: 30, type: 'category', boundaryGap: true, - data: isThumbnail ? epochNumberSerie.slice(-1 * COUNT_IN_THUMBNAIL) : epochNumberSerie, + data: isThumbnail ? epochNumberSeries.slice(-1 * COUNT_IN_THUMBNAIL) : epochNumberSeries, axisLabel: { formatter: (value: string) => value, }, @@ -188,7 +188,7 @@ const useOption = ( yAxisIndex: 0, symbol: isThumbnail ? 'none' : 'circle', symbolSize: 5, - data: isThumbnail ? epochTimeSerie.slice(-1 * COUNT_IN_THUMBNAIL) : epochTimeSerie, + data: isThumbnail ? epochTimeSeries.slice(-1 * COUNT_IN_THUMBNAIL) : epochTimeSeries, }, { name: t('block.epoch_length'), @@ -197,7 +197,7 @@ const useOption = ( yAxisIndex: 1, symbol: isThumbnail ? 'none' : 'circle', symbolSize: 5, - data: isThumbnail ? epochLengthSerie.slice(-1 * COUNT_IN_THUMBNAIL) : epochLengthSerie, + data: isThumbnail ? epochLengthSeries.slice(-1 * COUNT_IN_THUMBNAIL) : epochLengthSeries, }, ], } diff --git a/src/types/echarts.d.ts b/src/types/echarts.d.ts index 1f0a4c835..48b29b26f 100644 --- a/src/types/echarts.d.ts +++ b/src/types/echarts.d.ts @@ -22,7 +22,7 @@ declare namespace echarts { opacity?: number borderColor?: string dimensionNames?: DimensionName[] - encode?: DimensionUserOuputEncode + encode?: DimensionUserOutputEncode marker?: TooltipMarker status?: DisplayState dimensionIndex?: number From d391c5df773308ec0af803ebc1dec626555d2ab5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 05:10:25 +0000 Subject: [PATCH 4/6] chore(deps): bump @adobe/css-tools from 4.3.1 to 4.3.2 Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1 to 4.3.2. - [Changelog](https://github.com/adobe/css-tools/blob/main/History.md) - [Commits](https://github.com/adobe/css-tools/commits) --- updated-dependencies: - dependency-name: "@adobe/css-tools" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e7e5be67..c744131ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8,9 +8,9 @@ integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== "@adobe/css-tools@^4.0.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.3.1.tgz#abfccb8ca78075a2b6187345c26243c1a0842f28" - integrity sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg== + version "4.3.2" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.3.2.tgz#a6abc715fb6884851fca9dad37fc34739a04fd11" + integrity sha512-DA5a1C0gD/pLOvhv33YMrbf2FK3oUzwNl9oOJqE4XVjuEtt6XIakRcsd7eLiOSPkp1kTRQGICTA8cKra/vFbjw== "@ampproject/remapping@^2.1.0": version "2.2.0" From 8177a05f1ffcc97f52a802b0a3048690afbcfaf8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 17:44:15 +0900 Subject: [PATCH 5/6] chore(deps): update dependency @sentry/webpack-plugin to v2.10.2 (#166) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 71 +++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 58 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 157de3178..5884a066c 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "styled-components": "5.3.11" }, "devDependencies": { - "@sentry/webpack-plugin": "2.7.1", + "@sentry/webpack-plugin": "2.10.2", "@storybook/addon-essentials": "7.5.3", "@storybook/addon-interactions": "7.5.3", "@storybook/addon-links": "7.5.3", diff --git a/yarn.lock b/yarn.lock index 44154d9c7..3755dfb8e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3691,12 +3691,12 @@ "@sentry/utils" "7.65.0" tslib "^2.4.1 || ^1.9.3" -"@sentry/bundler-plugin-core@2.7.1": - version "2.7.1" - resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.7.1.tgz#60ca41f79393263911ae6bc5530f387cb1e48e47" - integrity sha512-ZC/B/7FzzgGpux2t54B2ioXudlq60MHMVPaUeuFzWwxmxiArrV4uBXcp18RMW5ns4biik5WBAD72vbsoloBfIQ== +"@sentry/bundler-plugin-core@2.10.2": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.10.2.tgz#d26f6a67b843eb757eb836020816e68472eee365" + integrity sha512-7IoekLtROlJZqTxtHQ3IhocBuf9dsEq+JjqlHMyZXoq+QKuvJFvMd/4T+r6KjZ15kMZOIkR+spK3V7duH201hw== dependencies: - "@sentry/cli" "^2.20.1" + "@sentry/cli" "^2.22.3" "@sentry/node" "^7.60.0" "@sentry/utils" "^7.60.0" dotenv "^16.3.1" @@ -3705,16 +3705,59 @@ magic-string "0.27.0" unplugin "1.0.1" -"@sentry/cli@^2.20.1": - version "2.20.5" - resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.20.5.tgz#255a5388ca24c211a0eae01dcc4ad813a7ff335a" - integrity sha512-ZvWb86eF0QXH9C5Mbi87aUmr8SH848yEpXJmlM2AoBowpE9kKDnewCAKvyXUihojUFwCSEEjoJhrRMMgmCZqXA== +"@sentry/cli-darwin@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.22.3.tgz#d81f6a1b2060d20adb1da7e65e1c57e050e8ffcc" + integrity sha512-A1DwFTffg3+fF68qujaJI07dk/1H1pRuihlvS5WQ9sD7nQLnXZGoLUht4eULixhDzZYinWHKkcWzQ6k40UTvNA== + +"@sentry/cli-linux-arm64@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.22.3.tgz#9bdd3f3a441017b82fdbf0986fdf3b2e19ceda0c" + integrity sha512-PnBPb4LJ+A2LlqLjtVFn4mEizcVdxBSLZvB85pEGzq9DRXjZ6ZEuGWFHTVnWvjd79TB/s0me29QnLc3n4B6lgA== + +"@sentry/cli-linux-arm@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.22.3.tgz#74ae1d9bf8a9334e155412fc66c770573b264d7c" + integrity sha512-mDtLVbqbCu/5b/v2quTAMzY/atGlJVvrqO2Wvpro0Jb/LYhn7Y1pVBdoXEDcnOX82/pseFkLT8PFfq/OcezPhA== + +"@sentry/cli-linux-i686@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.22.3.tgz#8e077d2f48c6c9a791e2db303c55bd4b3f47e2f8" + integrity sha512-wxvbpQ2hiw4hwJWfJMp7K45BV40nXL62f91jLuftFXIbieKX1Li57NNKNu2JUVn7W1bJxkwz/PKGGTXSgeJlRw== + +"@sentry/cli-linux-x64@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.22.3.tgz#c3d653032105043b5e72202812c2b85dbbfbabbb" + integrity sha512-0GxsYNO5GyRWifeOpng+MmdUFZRA64bgA1n1prsEsXnoeLcm3Zj4Q63hBZmiwz9Qbhf5ibohkpf94a7dI7pv3A== + +"@sentry/cli-win32-i686@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.22.3.tgz#836baaa8af96b5249c753d2f0b5c111d4c850e4a" + integrity sha512-YERPsd7ClBrxKcmCUw+ZrAvQfbyIZFrqh269hgDuXFodpsB7LPGnI33ilo0uzmKdq2vGppTb6Z3gf1Rbq0Hadg== + +"@sentry/cli-win32-x64@2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.22.3.tgz#c450136539e8860d46434a932383005cffd89136" + integrity sha512-NUh56xWvgJo2KuC9lI6o6nTPXdzbpQUB4qGwJ73L9NP3HT2P1I27jtHyrC2zlXTVlYE23gQZGrL3wgW4Jy80QA== + +"@sentry/cli@^2.22.3": + version "2.22.3" + resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.22.3.tgz#e28613885c30979f4760de7365e5d30d5a32d51d" + integrity sha512-VFHdtrHsMyTRSZhDLeMyXvit7xB4e81KugIEwMve95c7h5HO672bfmCcM/403CAugj4NzvQ+IR2NKF/2SsEPlg== dependencies: https-proxy-agent "^5.0.0" node-fetch "^2.6.7" progress "^2.0.3" proxy-from-env "^1.1.0" which "^2.0.2" + optionalDependencies: + "@sentry/cli-darwin" "2.22.3" + "@sentry/cli-linux-arm" "2.22.3" + "@sentry/cli-linux-arm64" "2.22.3" + "@sentry/cli-linux-i686" "2.22.3" + "@sentry/cli-linux-x64" "2.22.3" + "@sentry/cli-win32-i686" "2.22.3" + "@sentry/cli-win32-x64" "2.22.3" "@sentry/core@7.65.0": version "7.65.0" @@ -3779,12 +3822,12 @@ "@sentry/types" "7.65.0" tslib "^2.4.1 || ^1.9.3" -"@sentry/webpack-plugin@2.7.1": - version "2.7.1" - resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.7.1.tgz#f9475d24834a94cc6deba6c972afed28d491544e" - integrity sha512-YTlBFGVolXW7ZDoeg7cmLLCqIWNGvH9r3/q7FR1EBM5cDBf21juI+RVFM2mLf/bEu+Qf2uwt1tki8G1rfe7/0g== +"@sentry/webpack-plugin@2.10.2": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.10.2.tgz#72fa3e2f8d2a6d67df48a502473956249e8aec07" + integrity sha512-sA+oHgxoiLEaxZt3/o3fVsItyR37PIUWSiSkpdxcziekRZ6EM/h0BqW4qXi+46OmLE+ZiB8qtaqid+GUG9C9VA== dependencies: - "@sentry/bundler-plugin-core" "2.7.1" + "@sentry/bundler-plugin-core" "2.10.2" unplugin "1.0.1" uuid "^9.0.0" From a44f6e38c36e5f9748ed79e0e25c152a22538425 Mon Sep 17 00:00:00 2001 From: daryl Date: Fri, 1 Dec 2023 17:56:18 +0800 Subject: [PATCH 6/6] fix(script): script info tab overflow (#145) * fix(script): overflow * fix(script): change style of script info * fix(script): close medal missed * fix(script): close button position * feat(tab): move the css code to the styled components * fix(script): remove more icon --- src/index.css | 6 +- src/pages/Script/index.tsx | 56 ++++++++------ src/pages/Script/styled.tsx | 66 ++++++++++++++++ src/pages/Script/styles.module.scss | 57 -------------- .../TransactionCellScript/index.tsx | 75 ++++++++++++------- .../TransactionCellScript/styled.tsx | 48 ++++++++++-- 6 files changed, 194 insertions(+), 114 deletions(-) create mode 100644 src/pages/Script/styled.tsx diff --git a/src/index.css b/src/index.css index 9c467eb24..bf8003d92 100644 --- a/src/index.css +++ b/src/index.css @@ -2,7 +2,7 @@ body { --primary-color: #00cc9b; - --accent-color: #FA504F; + --accent-color: #fa504f; --primary-text-color: #333; --primary-hover-bg-color: #e8fff1; --primary-chiffon-color: #e6fcf7; @@ -27,11 +27,11 @@ body[data-chain-type='testnet'] { margin: 0; padding: 0; box-sizing: border-box; - font-family: Lato, sans-serif, Montserrat, "PingFang SC", -apple-system; + font-family: Lato, sans-serif, Montserrat, 'PingFang SC', -apple-system; } .monospace { - font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; } *[role]:focus { diff --git a/src/pages/Script/index.tsx b/src/pages/Script/index.tsx index 1a8ba0ad2..f6fed3894 100644 --- a/src/pages/Script/index.tsx +++ b/src/pages/Script/index.tsx @@ -1,7 +1,6 @@ import { useEffect, useState } from 'react' import { useHistory } from 'react-router' import { useParams } from 'react-router-dom' -import { Tabs } from 'antd' import { useQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import Content from '../../components/Content' @@ -19,6 +18,7 @@ import DecimalCapacity from '../../components/DecimalCapacity' import styles from './styles.module.scss' import { explorerService } from '../../services/ExplorerService' import type { ScriptInfo } from '../../services/ExplorerService/fetcher' +import { ScriptTab, ScriptTabPane, ScriptTabTitle } from './styled' const scriptDataList = isMainnet() ? MainnetContractHashTags : TestnetContractHashTags @@ -153,12 +153,12 @@ export const ScriptPage = () => { - { history.push(`/script/${codeHash}/${hashType}?page=${pageOfTransactions}&size=${pageSize}`) } }} - items={[ - { - label: `${t('transaction.transactions')} (${localeNumberString(countOfTransactions!)})`, - key: 'transactions', - children: , - }, - { - label: `${t('scripts.deployed_cells')} (${localeNumberString(countOfDeployedCells)})`, - key: 'deployed_cells', - children: , - }, - { - label: `${t('scripts.referring_cells')} (${localeNumberString(countOfReferringCells)})`, - key: 'referring_cells', - children: , - }, - ]} - /> + > + + {`${t('transaction.transactions')} (${localeNumberString(countOfTransactions!)})`} + + } + key="transactions" + > + + + + {`${t('scripts.deployed_cells')} (${localeNumberString(countOfDeployedCells)})`} + + } + key="deployed_cells" + > + + + + {`${t('scripts.referring_cells')} (${localeNumberString(countOfReferringCells)})`} + + } + key="referring_cells" + > + + + ) diff --git a/src/pages/Script/styled.tsx b/src/pages/Script/styled.tsx new file mode 100644 index 000000000..3c15a5889 --- /dev/null +++ b/src/pages/Script/styled.tsx @@ -0,0 +1,66 @@ +import { Tabs } from 'antd' +import TabPane from 'antd/lib/tabs/TabPane' +import styled from 'styled-components' + +export const ScriptTab = styled(Tabs)` + display: flex; + flex-direction: column; + justify-content: center; + width: 100%; + background-color: #fff; + border-radius: 6px 6px 0 0; + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-nav-list { + padding-left: 40px; + } + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-tab.ant-tabs-tab-active { + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-tab-btn { + color: var(--primary-color); + } + } + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-tab-active { + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-tab-btn { + color: #333; + } + } + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-tab-btn { + color: #333; + font-weight: 400; + font-size: 20px; + line-height: 23px; + margin-bottom: 0; + + &[aria-selected='true'] { + font-weight: 500; + } + } + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-nav .ant-tabs-ink-bar { + background: linear-gradient( + to right, + transparent 30%, + var(--primary-color) 30%, + var(--primary-color) 70%, + transparent 70% + ); + height: 3px; + bottom: 3px; + } +` +export const ScriptTabTitle = styled.span` + font-size: 20px; +` + +export const ScriptTabPane = styled(TabPane)` + color: #333; +` diff --git a/src/pages/Script/styles.module.scss b/src/pages/Script/styles.module.scss index 19940b69a..29079d941 100644 --- a/src/pages/Script/styles.module.scss +++ b/src/pages/Script/styles.module.scss @@ -16,63 +16,6 @@ } } -.scriptTabs { - display: flex; - flex-direction: column; - justify-content: center; - width: 100%; - background-color: #fff; - border-radius: 6px 6px 0 0; - - :global { - /* stylelint-disable-next-line selector-class-pattern */ - .ant-tabs-nav { - &::before { - border-bottom-width: 4px; - } - } - - /* stylelint-disable-next-line selector-class-pattern */ - .ant-tabs-nav-list { - padding-left: 40px; - } - - /* stylelint-disable-next-line selector-class-pattern */ - .ant-tabs-tab-btn { - color: #333; - font-weight: 400; - font-size: 20px; - line-height: 23px; - margin-bottom: 0; - - &[aria-selected='true'] { - font-weight: 500; - } - } - - /* stylelint-disable-next-line selector-class-pattern */ - .ant-tabs-tab-active { - /* stylelint-disable-next-line selector-class-pattern */ - .ant-tabs-tab-btn { - color: #333; - } - } - } - - /* stylelint-disable-next-line selector-class-pattern */ - & > :global(.ant-tabs-nav .ant-tabs-ink-bar) { - background: linear-gradient( - to right, - transparent 30%, - var(--primary-color) 30%, - var(--primary-color) 70%, - transparent 70% - ); - height: 3px; - bottom: 3px; - } -} - .scriptCellsPanel, .scriptTransactionsPanel { table { diff --git a/src/pages/Transaction/TransactionCellScript/index.tsx b/src/pages/Transaction/TransactionCellScript/index.tsx index 0f37d4ba5..8babfc406 100644 --- a/src/pages/Transaction/TransactionCellScript/index.tsx +++ b/src/pages/Transaction/TransactionCellScript/index.tsx @@ -9,13 +9,12 @@ import { TransactionDetailCopyButton, TransactionDetailContainer, TransactionDetailPanel, - TransactionDetailLock, - TransactionDetailType, TransactionCellDetailPanel, - TransactionDetailData, - TransactionDetailCapacityUsage, TransactionCellInfoValuePanel, TransactionDetailScriptButton, + TransactionCellDetailTab, + TransactionCellDetailPane, + TransactionCellDetailTitle, } from './styled' import SmallLoading from '../../../components/Loading/SmallLoading' import CloseIcon from './modal_close.png' @@ -250,32 +249,54 @@ export default ({ cell, onClose }: TransactionCellScriptProps) => { return ( - changeType(CellInfo.LOCK)}> - {t('transaction.lock_script')} - - - changeType(CellInfo.TYPE)}> - {t('transaction.type_script')} - - - changeType(CellInfo.DATA)}> - {t('transaction.data')} - - changeType(CellInfo.CAPACITY)} + + close icon {}} onClick={() => onClose()} /> + + } + tabBarStyle={{ fontSize: '10px' }} + onTabClick={key => { + const state = parseInt(key, 10) + if (state && !Number.isNaN(state)) { + changeType(state) + } + }} > - {t('transaction.capacity_usage')} - - - -
- close icon {}} onClick={() => onClose()} /> -
+ + {t('transaction.lock_script')} + + + } + key={CellInfo.LOCK} + /> + + {t('transaction.type_script')} + + + } + key={CellInfo.TYPE} + /> + {t('transaction.data')}} + key={CellInfo.DATA} + /> + + {t('transaction.capacity_usage')} + + + } + key={CellInfo.CAPACITY} + /> +
-
- {isFetched ? (
diff --git a/src/pages/Transaction/TransactionCellScript/styled.tsx b/src/pages/Transaction/TransactionCellScript/styled.tsx index 495ccdc4a..e4e69bef2 100644 --- a/src/pages/Transaction/TransactionCellScript/styled.tsx +++ b/src/pages/Transaction/TransactionCellScript/styled.tsx @@ -1,3 +1,5 @@ +import { Tabs } from 'antd' +import TabPane from 'antd/lib/tabs/TabPane' import styled from 'styled-components' export const TransactionDetailContainer = styled.div` @@ -18,6 +20,7 @@ export const TransactionDetailItem = styled.div<{ selected?: boolean }>` font-weight: 600; font-size: 16px; align-items: center; + white-space: pre-wrap; @media (max-width: 750px) { margin-top: 5px; @@ -73,6 +76,43 @@ export const TransactionDetailCapacityUsage = styled(TransactionDetailItem)` } ` +export const TransactionCellDetailTab = styled(Tabs)` + display: flex; + flex-direction: column; + justify-content: center; + width: 100%; + background-color: #fff; + border-radius: 6px 6px 0 0; + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-nav-operations { + display: none !important; + } + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-tab.ant-tabs-tab-active { + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-tab-btn { + color: var(--primary-color); + } + } + + /* stylelint-disable-next-line selector-class-pattern */ + .ant-tabs-nav .ant-tabs-ink-bar { + background: linear-gradient(to right, var(--primary-color) 100%, transparent 100%); + height: 3px; + bottom: 3px; + } +` + +export const TransactionCellDetailTitle = styled.span` + font-size: 16px; +` + +export const TransactionCellDetailPane = styled(TabPane)` + color: #333; +` + export const TransactionCellDetailPanel = styled.div` width: 100%; font-weight: 500; @@ -92,11 +132,7 @@ export const TransactionCellDetailPanel = styled.div` } .transactionDetailModalClose { - flex: 1; - display: flex; - justify-content: flex-end; - align-items: center; - padding-bottom: 17px; + padding: 17px 0 17px 17px; > img { cursor: pointer; @@ -105,7 +141,7 @@ export const TransactionCellDetailPanel = styled.div` } @media (max-width: 750px) { - padding-bottom: 15px; + padding: 15px 0 15px 15px; > img { width: 12px;