mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-21 14:08:14 +00:00
add title to call-result values
This commit is contained in:
parent
1442f33d5a
commit
a28c598af1
@ -3,6 +3,7 @@ import { useField } from 'react-final-form'
|
|||||||
|
|
||||||
import TextField from 'src/components/forms/TextField'
|
import TextField from 'src/components/forms/TextField'
|
||||||
import Col from 'src/components/layout/Col'
|
import Col from 'src/components/layout/Col'
|
||||||
|
import Paragraph from 'src/components/layout/Paragraph'
|
||||||
import Row from 'src/components/layout/Row'
|
import Row from 'src/components/layout/Row'
|
||||||
|
|
||||||
const RenderOutputParams = () => {
|
const RenderOutputParams = () => {
|
||||||
@ -14,8 +15,14 @@ const RenderOutputParams = () => {
|
|||||||
}: any = useField('callResults', { value: true })
|
}: any = useField('callResults', { value: true })
|
||||||
const multipleResults = !!method && method.outputs.length > 1
|
const multipleResults = !!method && method.outputs.length > 1
|
||||||
|
|
||||||
return results
|
return results ? (
|
||||||
? method.outputs.map(({ name, type }, index) => {
|
<>
|
||||||
|
<Row align="left" margin="xs">
|
||||||
|
<Paragraph color="primary" size="lg" style={{ letterSpacing: '-0.5px' }}>
|
||||||
|
Call result:
|
||||||
|
</Paragraph>
|
||||||
|
</Row>
|
||||||
|
{method.outputs.map(({ name, type }, index) => {
|
||||||
const placeholder = name ? `${name} (${type})` : type
|
const placeholder = name ? `${name} (${type})` : type
|
||||||
const key = `methodCallResult-${method.name}_${index}_${type}`
|
const key = `methodCallResult-${method.name}_${index}_${type}`
|
||||||
const value = multipleResults ? results[index] : results
|
const value = multipleResults ? results[index] : results
|
||||||
@ -33,8 +40,9 @@ const RenderOutputParams = () => {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
)
|
)
|
||||||
})
|
})}
|
||||||
: null
|
</>
|
||||||
|
) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
export default RenderOutputParams
|
export default RenderOutputParams
|
||||||
|
Loading…
x
Reference in New Issue
Block a user