diff --git a/src/components/pages/claim-page/error-already-claimed/index.tsx b/src/components/pages/claim-page/error-already-claimed/index.tsx index 3aa6cf4e..2b20303d 100644 --- a/src/components/pages/claim-page/error-already-claimed/index.tsx +++ b/src/components/pages/claim-page/error-already-claimed/index.tsx @@ -1,9 +1,9 @@ import { FC } from 'react' import { Image } from './styled-components' import ExpiredError from 'images/expired-error.png' +import {Title, Subtitle } from 'components/pages/common/styles/styled-components' import { RootState } from 'data/store' import { connect } from 'react-redux' -import {Title, Subtitle } from 'components/pages/common/styles/styled-components' const mapStateToProps = ({ drop: { diff --git a/src/components/pages/claim-page/error-transaction/index.tsx b/src/components/pages/claim-page/error-transaction/index.tsx index 9259af31..88a99e2f 100644 --- a/src/components/pages/claim-page/error-transaction/index.tsx +++ b/src/components/pages/claim-page/error-transaction/index.tsx @@ -1,12 +1,42 @@ import { FC } from 'react' -import { Image, Title } from './styled-components' +import { + Image, + Title, + ButtonStyled +} from './styled-components' import ErrorImageBlack from 'images/error-black.png' +import { RootState } from 'data/store' +import { connect } from 'react-redux' +import { + defineExplorerURL +} from 'helpers' +const mapStateToProps = ({ + drop: { + hash, + chainId + }, +}: RootState) => ({ + hash, + chainId +}) -const ErrorComponent: FC = () => { +type ReduxType = ReturnType + +const ErrorComponent: FC = ({ + hash, + chainId +}) => { return <> Transaction failed + {hash && chainId && { + window.open(`${defineExplorerURL(chainId)}/tx/${hash}`, '_blank') + }} + title='View in Explorer' + appearance='default' + />} } -export default ErrorComponent \ No newline at end of file +export default connect(mapStateToProps)(ErrorComponent) \ No newline at end of file diff --git a/src/helpers/define-explorer-url.tsx b/src/helpers/define-explorer-url.tsx index eec13b01..1e2ed577 100644 --- a/src/helpers/define-explorer-url.tsx +++ b/src/helpers/define-explorer-url.tsx @@ -13,7 +13,7 @@ const defineExplorerUrl: TDefineExplorerURL = (chainId) => { } } const networkName = defineNetworkName(chainId) - return `https://${networkName}.etherscan.io` + return `https://${networkName}.etherscan.io` } export default defineExplorerUrl \ No newline at end of file