Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
d330eea3
Unverified
Commit
d330eea3
authored
Mar 27, 2023
by
eddie
Committed by
GitHub
Mar 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: re-add transaction activity popups (#6223)
parent
35dace7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
PopupItem.tsx
src/components/Popups/PopupItem.tsx
+4
-1
TransactionPopup.tsx
src/components/Popups/TransactionPopup.tsx
+46
-0
No files found.
src/components/Popups/PopupItem.tsx
View file @
d330eea3
...
...
@@ -7,6 +7,7 @@ import styled, { useTheme } from 'styled-components/macro'
import
{
useRemovePopup
}
from
'
../../state/application/hooks
'
import
{
PopupContent
}
from
'
../../state/application/reducer
'
import
FailedNetworkSwitchPopup
from
'
./FailedNetworkSwitchPopup
'
import
TransactionPopup
from
'
./TransactionPopup
'
const
StyledClose
=
styled
(
X
)
`
position: absolute;
...
...
@@ -77,7 +78,9 @@ export default function PopupItem({
})
let
popupContent
if
(
'
failedSwitchNetwork
'
in
content
)
{
if
(
'
txn
'
in
content
)
{
popupContent
=
<
TransactionPopup
hash=
{
content
.
txn
.
hash
}
/>
}
else
if
(
'
failedSwitchNetwork
'
in
content
)
{
popupContent
=
<
FailedNetworkSwitchPopup
chainId=
{
content
.
failedSwitchNetwork
}
/>
}
...
...
src/components/Popups/TransactionPopup.tsx
0 → 100644
View file @
d330eea3
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
TransactionSummary
}
from
'
components/AccountDetails/TransactionSummary
'
import
{
AutoColumn
}
from
'
components/Column
'
import
{
AutoRow
}
from
'
components/Row
'
import
{
useContext
}
from
'
react
'
import
{
AlertCircle
,
CheckCircle
}
from
'
react-feather
'
import
{
useTransaction
}
from
'
state/transactions/hooks
'
import
styled
,
{
ThemeContext
}
from
'
styled-components/macro
'
import
{
ExternalLink
,
ThemedText
}
from
'
theme
'
import
{
ExplorerDataType
,
getExplorerLink
}
from
'
utils/getExplorerLink
'
const
RowNoFlex
=
styled
(
AutoRow
)
`
flex-wrap: nowrap;
`
export
default
function
TransactionPopup
({
hash
}:
{
hash
:
string
})
{
const
{
chainId
}
=
useWeb3React
()
const
tx
=
useTransaction
(
hash
)
const
theme
=
useContext
(
ThemeContext
)
if
(
!
tx
)
return
null
const
success
=
Boolean
(
tx
.
receipt
&&
tx
.
receipt
.
status
===
1
)
return
(
<
RowNoFlex
>
<
div
style=
{
{
paddingRight
:
16
}
}
>
{
success
?
(
<
CheckCircle
color=
{
theme
.
accentSuccess
}
size=
{
24
}
/>
)
:
(
<
AlertCircle
color=
{
theme
.
accentFailure
}
size=
{
24
}
/>
)
}
</
div
>
<
AutoColumn
gap=
"8px"
>
<
ThemedText
.
BodyPrimary
fontWeight=
{
500
}
>
<
TransactionSummary
info=
{
tx
.
info
}
/>
</
ThemedText
.
BodyPrimary
>
{
chainId
&&
(
<
ExternalLink
href=
{
getExplorerLink
(
chainId
,
hash
,
ExplorerDataType
.
TRANSACTION
)
}
>
View on Explorer
</
ExternalLink
>
)
}
</
AutoColumn
>
</
RowNoFlex
>
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment