// Copyright 2017-2019 @polkadot/app-staking authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. import { I18nProps } from '@polkadot/react-components/types'; import { CodeStored } from '../types'; import React from 'react'; import styled from 'styled-components'; import { RouteComponentProps } from 'react-router'; import { withRouter } from 'react-router-dom'; import { Button, Card, CodeRow, Forget } from '@polkadot/react-components'; import { withMulti } from '@polkadot/react-api'; import ABI from '../ABI'; import RemoveABI from '../RemoveABI'; import contracts from '../store'; import translate from '../translate'; type Props = I18nProps & RouteComponentProps & { basePath: string; code: CodeStored; showDeploy: (codeHash?: string) => () => void; }; interface State { isForgetOpen: boolean; isRemoveABIOpen: boolean; } const CodeCard = styled(Card)` && { min-height: 13rem; } `; class Contract extends React.PureComponent { public state: State = { isForgetOpen: false, isRemoveABIOpen: false }; public render (): React.ReactNode { const { code, code: { contractAbi } } = this.props; return ( {this.renderModals()} ); } private renderButtons (): React.ReactNode { const { code: { json: { codeHash } }, showDeploy, t } = this.props; return ( <>