2021-02-04 19:15:23 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import ConfirmTransactionBase from '../confirm-transaction-base';
|
2021-05-21 22:07:06 +02:00
|
|
|
import { toBuffer } from '../../../shared/modules/buffer-utils';
|
2023-03-09 06:08:37 +01:00
|
|
|
import Box from '../../components/ui/box';
|
2023-07-20 21:49:35 +02:00
|
|
|
import { Text } from '../../components/component-library';
|
2023-03-09 06:08:37 +01:00
|
|
|
import {
|
|
|
|
Color,
|
|
|
|
DISPLAY,
|
|
|
|
OVERFLOW_WRAP,
|
|
|
|
TextVariant,
|
|
|
|
TEXT_TRANSFORM,
|
|
|
|
} from '../../helpers/constants/design-system';
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
export default class ConfirmDeployContract extends Component {
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
txData: PropTypes.object,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
renderData() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { t } = this.context;
|
|
|
|
const { txData: { origin, txParams: { data } = {} } = {} } = this.props;
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
return (
|
2023-03-09 06:08:37 +01:00
|
|
|
<Box color={Color.textAlternative} padding={4}>
|
|
|
|
<Box
|
|
|
|
backgroundColor={Color.backgroundAlternative}
|
|
|
|
padding={4}
|
|
|
|
variant={TextVariant.bodySm}
|
|
|
|
>
|
|
|
|
<Box display={DISPLAY.FLEX}>
|
|
|
|
<Text
|
|
|
|
backgroundColor={Color.backgroundAlternative}
|
|
|
|
marginBottom={1}
|
|
|
|
paddingRight={4}
|
|
|
|
variant={TextVariant.bodySmBold}
|
|
|
|
>
|
2020-11-03 00:41:28 +01:00
|
|
|
{`${t('origin')}:`}
|
2023-03-09 06:08:37 +01:00
|
|
|
</Text>
|
|
|
|
<Text
|
|
|
|
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
|
|
|
|
variant={TextVariant.bodySm}
|
|
|
|
>
|
|
|
|
{origin}
|
|
|
|
</Text>
|
|
|
|
</Box>
|
|
|
|
<Box display={DISPLAY.FLEX}>
|
|
|
|
<Text
|
|
|
|
backgroundColor={Color.backgroundAlternative}
|
|
|
|
paddingRight={4}
|
|
|
|
variant={TextVariant.bodySmBold}
|
|
|
|
>
|
2020-11-03 00:41:28 +01:00
|
|
|
{`${t('bytes')}:`}
|
2023-03-09 06:08:37 +01:00
|
|
|
</Text>
|
|
|
|
<Text variant={TextVariant.bodySm}>{toBuffer(data).length}</Text>
|
|
|
|
</Box>
|
|
|
|
</Box>
|
|
|
|
<Text
|
|
|
|
as="h3"
|
|
|
|
paddingBottom={3}
|
|
|
|
paddingTop={2}
|
|
|
|
textTransform={TEXT_TRANSFORM.UPPERCASE}
|
|
|
|
variant={TextVariant.bodySm}
|
|
|
|
>{`${t('hexData')}:`}</Text>
|
|
|
|
<Text
|
|
|
|
backgroundColor={Color.backgroundAlternative}
|
|
|
|
overflowWrap={OVERFLOW_WRAP.BREAK_WORD}
|
|
|
|
padding={4}
|
|
|
|
variant={TextVariant.bodySm}
|
|
|
|
>
|
|
|
|
{data}
|
|
|
|
</Text>
|
|
|
|
</Box>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2018-06-23 08:52:45 +02:00
|
|
|
return (
|
|
|
|
<ConfirmTransactionBase
|
2019-11-18 16:08:47 +01:00
|
|
|
actionKey="contractDeployment"
|
2018-06-23 08:52:45 +02:00
|
|
|
dataComponent={this.renderData()}
|
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
}
|