From 3bb17adc8df73873af9afe99ace3e7a4c3a6a059 Mon Sep 17 00:00:00 2001 From: daryl Date: Mon, 25 Sep 2023 02:24:43 +0800 Subject: [PATCH] feat(typeId): show type id from the property "id" in response --- src/pages/Script/index.tsx | 8 +++----- src/pages/Script/styles.module.scss | 5 +++++ src/pages/Script/types.ts | 3 +-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pages/Script/index.tsx b/src/pages/Script/index.tsx index 907d56bf1..e566348a6 100644 --- a/src/pages/Script/index.tsx +++ b/src/pages/Script/index.tsx @@ -39,7 +39,7 @@ const scriptHashNameMap = new Map( ) const getScriptInfo = (scriptInfo: ScriptInfo) => { - const { scriptName, scriptType, typeId, codeHash, hashType, capacityOfDeployedCells, capacityOfReferringCells } = + const { scriptName, scriptType, id, codeHash, hashType, capacityOfDeployedCells, capacityOfReferringCells } = scriptInfo const items: OverviewItemData[] = [ { @@ -58,8 +58,7 @@ const getScriptInfo = (scriptInfo: ScriptInfo) => { }, { title: i18n.t('scripts.type_id'), - tooltip: i18n.t('glossary.type_id'), - content: typeId || '-', + content: {id || '-'}, }, { title: i18n.t('scripts.code_hash'), @@ -123,10 +122,9 @@ export const ScriptPage = () => { status === 'success' && resp ? toCamelcase>(resp?.data)!.data : ({ - id: 0, + id: '-', scriptName: '', scriptType: '', - typeId: '', codeHash, hashType, capacityOfDeployedCells: '0', diff --git a/src/pages/Script/styles.module.scss b/src/pages/Script/styles.module.scss index a4198a024..3f6f7ea26 100644 --- a/src/pages/Script/styles.module.scss +++ b/src/pages/Script/styles.module.scss @@ -143,3 +143,8 @@ .hashType { text-transform: capitalize; } + +.typeId { + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/src/pages/Script/types.ts b/src/pages/Script/types.ts index 4df243d3a..e3bcee0f4 100644 --- a/src/pages/Script/types.ts +++ b/src/pages/Script/types.ts @@ -1,8 +1,7 @@ export interface ScriptInfo { - id: number + id: string scriptName: string scriptType: string - typeId: string codeHash: string hashType: 'type' | 'data' capacityOfDeployedCells: string