Skip to content

Commit

Permalink
feat(typeId): show type id from the property "id" in response
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl-L committed Sep 24, 2023
1 parent 74bcdf4 commit 3bb17ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/pages/Script/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const scriptHashNameMap = new Map<string, string>(
)

const getScriptInfo = (scriptInfo: ScriptInfo) => {
const { scriptName, scriptType, typeId, codeHash, hashType, capacityOfDeployedCells, capacityOfReferringCells } =
const { scriptName, scriptType, id, codeHash, hashType, capacityOfDeployedCells, capacityOfReferringCells } =
scriptInfo
const items: OverviewItemData[] = [
{
Expand All @@ -58,8 +58,7 @@ const getScriptInfo = (scriptInfo: ScriptInfo) => {
},
{
title: i18n.t('scripts.type_id'),
tooltip: i18n.t('glossary.type_id'),
content: typeId || '-',
content: <span className={styles.typeId}>{id || '-'}</span>,
},
{
title: i18n.t('scripts.code_hash'),
Expand Down Expand Up @@ -123,10 +122,9 @@ export const ScriptPage = () => {
status === 'success' && resp
? toCamelcase<Response.Response<ScriptInfo>>(resp?.data)!.data
: ({
id: 0,
id: '-',
scriptName: '',
scriptType: '',
typeId: '',
codeHash,
hashType,
capacityOfDeployedCells: '0',
Expand Down
5 changes: 5 additions & 0 deletions src/pages/Script/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,8 @@
.hashType {
text-transform: capitalize;
}

.typeId {
overflow: hidden;
text-overflow: ellipsis;
}
3 changes: 1 addition & 2 deletions src/pages/Script/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export interface ScriptInfo {
id: number
id: string
scriptName: string
scriptType: string
typeId: string
codeHash: string
hashType: 'type' | 'data'
capacityOfDeployedCells: string
Expand Down

0 comments on commit 3bb17ad

Please sign in to comment.