Skip to content

Commit

Permalink
fix: move to use table on astra-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
viennguyen2-tiki committed Mar 23, 2023
1 parent e6438b4 commit 63e6db2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
25 changes: 16 additions & 9 deletions components/Card/CardInfo/Components/Decode.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Table } from '@astraprotocol/astra-ui'
import clsx from 'clsx'
import CopyButton from 'components/Button/CopyButton'
import Table from 'components/Table/Table'
import { isString } from 'lodash'
import styles from '../style.module.scss'

Expand All @@ -24,39 +24,39 @@ export default function Decode({ methodId, call, items }: DecodeProps) {
id="method"
colums={[
{
title: 'Method Id',
content: 'Method Id',
key: 'method',
render: value => (
<span className={clsx('money money-sm', styles.primaryColor)}>{value || '0x'}</span>
)
},
{
title: 'Call',
content: 'Call',
key: 'call',
render: value => (
<span className={clsx('money money-sm', styles.primaryColor)}>{value || '...'}</span>
)
}
]}
rows={[{ method: methodId, call }]}
rows={[{ method: { content: methodId }, call: { content: call } }]}
classes={{ wapper: styles.table }}
/>
<div className="margin-bottom-xs" />
<Table
id="param"
colums={[
{
title: 'Name',
content: 'Name',
key: 'name',
render: value => <span className="text text-sm contrast-color-70">{value}</span>
},
{
title: 'Type',
content: 'Type',
key: 'type',
render: value => <span className="text text-sm contrast-color-70">{value}</span>
},
{
title: 'Indexed?',
content: 'Indexed?',
key: 'indexed',
render: value => (
<span className={clsx('money money-sm', styles.primaryColor)}>
Expand All @@ -65,7 +65,7 @@ export default function Decode({ methodId, call, items }: DecodeProps) {
)
},
{
title: 'Data',
content: 'Data',
key: 'value',
render: values => {
let valueCopy = values
Expand Down Expand Up @@ -100,7 +100,14 @@ export default function Decode({ methodId, call, items }: DecodeProps) {
}
}
]}
rows={(items as any[]) || []}
rows={
items.map(item => ({
indexed: { content: item.indexed },
name: { content: item.name },
type: { content: item.type },
value: { content: item.value }
})) || []
}
classes={{ wapper: styles.table }}
/>
</div>
Expand Down
1 change: 0 additions & 1 deletion components/Card/CardInfo/style.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
td,
th {
padding-left: 10px !important;
width: 2%;
}
}
}
Expand Down

0 comments on commit 63e6db2

Please sign in to comment.