Skip to content

Commit

Permalink
Merge pull request #351 from LinkdropHQ/dev
Browse files Browse the repository at this point in the history
Added "transaction button"
  • Loading branch information
spacehaz authored Aug 21, 2024
2 parents 2f653d3 + 37868ee commit 13ab55a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
36 changes: 33 additions & 3 deletions src/components/pages/claim-page/error-transaction/index.tsx
Original file line number Diff line number Diff line change
@@ -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<typeof mapStateToProps>

const ErrorComponent: FC<ReduxType> = ({
hash,
chainId
}) => {
return <>
<Image src={ErrorImageBlack} />
<Title>Transaction failed</Title>
{hash && chainId && <ButtonStyled
onClick={() => {
window.open(`${defineExplorerURL(chainId)}/tx/${hash}`, '_blank')
}}
title='View in Explorer'
appearance='default'
/>}
</>
}

export default ErrorComponent
export default connect(mapStateToProps)(ErrorComponent)
2 changes: 1 addition & 1 deletion src/helpers/define-explorer-url.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 13ab55a

Please sign in to comment.