Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
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
vicotor
frontend
Commits
1a5f0e63
Unverified
Commit
1a5f0e63
authored
Jul 04, 2025
by
Igor Stuev
Committed by
GitHub
Jul 04, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change txs socket alert text (#2822)
parent
a2b9c418
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
70 additions
and
63 deletions
+70
-63
AddressBlocksValidated.tsx
ui/address/AddressBlocksValidated.tsx
+5
-5
AddressTokenTransfers.tsx
ui/address/AddressTokenTransfers.tsx
+6
-6
BlocksContent.tsx
ui/blocks/BlocksContent.tsx
+5
-5
BlocksTable.tsx
ui/blocks/BlocksTable.tsx
+3
-3
LatestTxs.tsx
ui/home/LatestTxs.tsx
+2
-2
LatestArbitrumDeposits.tsx
ui/home/latestDeposits/LatestArbitrumDeposits.tsx
+4
-4
LatestDeposits.tsx
ui/home/latestDeposits/LatestDeposits.tsx
+10
-3
LatestOptimisticDeposits.tsx
ui/home/latestDeposits/LatestOptimisticDeposits.tsx
+4
-4
Blocks.pw.tsx_default_socket-error-1.png
.../__screenshots__/Blocks.pw.tsx_default_socket-error-1.png
+0
-0
SocketNewItemsNotice.pw.tsx
ui/shared/SocketNewItemsNotice.pw.tsx
+1
-1
SocketNewItemsNotice.tsx
ui/shared/SocketNewItemsNotice.tsx
+4
-4
TokenTransferTable.tsx
ui/shared/TokenTransfer/TokenTransferTable.tsx
+3
-3
SocketNewItemsNotice.pw.tsx_default_connection-loss-1.png
...SocketNewItemsNotice.pw.tsx_default_connection-loss-1.png
+0
-0
TokenTransfer.tsx
ui/token/TokenTransfer/TokenTransfer.tsx
+5
-5
TokenTransferTable.tsx
ui/token/TokenTransfer/TokenTransferTable.tsx
+3
-3
TxsSocketNoticeTypeAddress.tsx
ui/txs/socket/TxsSocketNoticeTypeAddress.tsx
+3
-3
TxsSocketNoticeTypeAll.tsx
ui/txs/socket/TxsSocketNoticeTypeAll.tsx
+3
-3
useTxsSocketTypeAddress.tsx
ui/txs/socket/useTxsSocketTypeAddress.tsx
+5
-5
useTxsSocketTypeAll.tsx
ui/txs/socket/useTxsSocketTypeAll.tsx
+4
-4
No files found.
ui/address/AddressBlocksValidated.tsx
View file @
1a5f0e63
...
...
@@ -33,7 +33,7 @@ interface Props {
}
const
AddressBlocksValidated
=
({
shouldRender
=
true
,
isQueryEnabled
=
true
}:
Props
)
=>
{
const
[
s
ocketAlert
,
setSocketAlert
]
=
React
.
useState
(
''
);
const
[
s
howSocketAlert
,
setShowSocketAlert
]
=
React
.
useState
(
false
);
const
[
newItemsCount
,
setNewItemsCount
]
=
React
.
useState
(
0
);
const
queryClient
=
useQueryClient
();
...
...
@@ -60,11 +60,11 @@ const AddressBlocksValidated = ({ shouldRender = true, isQueryEnabled = true }:
});
const
handleSocketError
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
An error has occurred while fetching new blocks. Please refresh the page to load new blocks.
'
);
setS
howSocketAlert
(
true
);
},
[]);
const
handleNewSocketMessage
:
SocketMessage
.
NewBlock
[
'
handler
'
]
=
React
.
useCallback
((
payload
)
=>
{
setS
ocketAlert
(
''
);
setS
howSocketAlert
(
false
);
queryClient
.
setQueryData
(
getResourceKey
(
'
general:address_blocks_validated
'
,
{
pathParams
:
{
hash
:
addressHash
}
}),
...
...
@@ -121,7 +121,7 @@ const AddressBlocksValidated = ({ shouldRender = true, isQueryEnabled = true }:
<
TableBody
>
<
SocketNewItemsNotice
.
Desktop
num=
{
newItemsCount
}
alert=
{
s
ocketAlert
}
showErrorAlert=
{
showS
ocketAlert
}
type=
"block"
isLoading=
{
query
.
isPlaceholderData
}
/>
...
...
@@ -140,7 +140,7 @@ const AddressBlocksValidated = ({ shouldRender = true, isQueryEnabled = true }:
{
query
.
pagination
.
page
===
1
&&
(
<
SocketNewItemsNotice
.
Mobile
num=
{
newItemsCount
}
alert=
{
s
ocketAlert
}
showErrorAlert=
{
showS
ocketAlert
}
type=
"block"
isLoading=
{
query
.
isPlaceholderData
}
/>
...
...
ui/address/AddressTokenTransfers.tsx
View file @
1a5f0e63
...
...
@@ -73,7 +73,7 @@ const AddressTokenTransfers = ({ overloadCount = OVERLOAD_COUNT, shouldRender =
const
currentAddress
=
getQueryParamString
(
router
.
query
.
hash
);
const
[
s
ocketAlert
,
setSocketAlert
]
=
React
.
useState
(
''
);
const
[
s
howSocketAlert
,
setShowSocketAlert
]
=
React
.
useState
(
false
);
const
[
newItemsCount
,
setNewItemsCount
]
=
React
.
useState
(
0
);
const
[
filters
,
setFilters
]
=
React
.
useState
<
Filters
>
(
...
...
@@ -109,7 +109,7 @@ const AddressTokenTransfers = ({ overloadCount = OVERLOAD_COUNT, shouldRender =
},
[
filters
,
onFilterChange
]);
const
handleNewSocketMessage
:
SocketMessage
.
AddressTokenTransfer
[
'
handler
'
]
=
(
payload
)
=>
{
setS
ocketAlert
(
''
);
setS
howSocketAlert
(
false
);
const
newItems
:
Array
<
TokenTransfer
>
=
[];
let
newCount
=
0
;
...
...
@@ -152,11 +152,11 @@ const AddressTokenTransfers = ({ overloadCount = OVERLOAD_COUNT, shouldRender =
};
const
handleSocketClose
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
Connection is lost. Please refresh the page to load new token transfers.
'
);
setS
howSocketAlert
(
true
);
},
[]);
const
handleSocketError
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
An error has occurred while fetching new token transfers. Please refresh the page.
'
);
setS
howSocketAlert
(
true
);
},
[]);
const
channel
=
useSocketChannel
({
...
...
@@ -189,7 +189,7 @@ const AddressTokenTransfers = ({ overloadCount = OVERLOAD_COUNT, shouldRender =
top=
{
isActionBarHidden
?
0
:
ACTION_BAR_HEIGHT_DESKTOP
}
enableTimeIncrement
showSocketInfo=
{
pagination
.
page
===
1
}
s
ocketInfoAlert=
{
s
ocketAlert
}
s
howSocketErrorAlert=
{
showS
ocketAlert
}
socketInfoNum=
{
newItemsCount
}
isLoading=
{
isPlaceholderData
}
/>
...
...
@@ -198,7 +198,7 @@ const AddressTokenTransfers = ({ overloadCount = OVERLOAD_COUNT, shouldRender =
{
pagination
.
page
===
1
&&
(
<
SocketNewItemsNotice
.
Mobile
num=
{
newItemsCount
}
alert=
{
s
ocketAlert
}
showErrorAlert=
{
showS
ocketAlert
}
type=
"token_transfer"
isLoading=
{
isPlaceholderData
}
/>
...
...
ui/blocks/BlocksContent.tsx
View file @
1a5f0e63
...
...
@@ -34,7 +34,7 @@ interface Props {
const
BlocksContent
=
({
type
,
query
,
enableSocket
=
true
,
top
}:
Props
)
=>
{
const
queryClient
=
useQueryClient
();
const
isMobile
=
useIsMobile
();
const
[
s
ocketAlert
,
setSocketAlert
]
=
React
.
useState
(
''
);
const
[
s
howSocketAlert
,
setShowSocketAlert
]
=
React
.
useState
(
false
);
const
[
newItemsCount
,
setNewItemsCount
]
=
React
.
useState
(
0
);
...
...
@@ -66,11 +66,11 @@ const BlocksContent = ({ type, query, enableSocket = true, top }: Props) => {
},
[
queryClient
,
type
]);
const
handleSocketClose
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
Connection is lost. Please refresh the page to load new blocks.
'
);
setS
howSocketAlert
(
true
);
},
[]);
const
handleSocketError
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
An error has occurred while fetching new blocks. Please refresh the page to load new blocks.
'
);
setS
howSocketAlert
(
true
);
},
[]);
const
channel
=
useSocketChannel
({
...
...
@@ -91,7 +91,7 @@ const BlocksContent = ({ type, query, enableSocket = true, top }: Props) => {
{
query
.
pagination
.
page
===
1
&&
enableSocket
&&
(
<
SocketNewItemsNotice
.
Mobile
num=
{
newItemsCount
}
alert=
{
s
ocketAlert
}
showErrorAlert=
{
showS
ocketAlert
}
type=
"block"
isLoading=
{
query
.
isPlaceholderData
}
/>
...
...
@@ -106,7 +106,7 @@ const BlocksContent = ({ type, query, enableSocket = true, top }: Props) => {
isLoading=
{
query
.
isPlaceholderData
}
showSocketInfo=
{
query
.
pagination
.
page
===
1
&&
enableSocket
}
socketInfoNum=
{
newItemsCount
}
s
ocketInfoAlert=
{
s
ocketAlert
}
s
howSocketErrorAlert=
{
showS
ocketAlert
}
/>
</
Box
>
</>
...
...
ui/blocks/BlocksTable.tsx
View file @
1a5f0e63
...
...
@@ -19,7 +19,7 @@ interface Props {
top
:
number
;
page
:
number
;
socketInfoNum
?:
number
;
s
ocketInfoAlert
?:
string
;
s
howSocketErrorAlert
?:
boolean
;
showSocketInfo
?:
boolean
;
}
...
...
@@ -30,7 +30,7 @@ const FEES_COL_WEIGHT = 22;
const
isRollup
=
config
.
features
.
rollup
.
isEnabled
;
const
BlocksTable
=
({
data
,
isLoading
,
top
,
page
,
showSocketInfo
,
socketInfoNum
,
s
ocketInfo
Alert
}:
Props
)
=>
{
const
BlocksTable
=
({
data
,
isLoading
,
top
,
page
,
showSocketInfo
,
socketInfoNum
,
s
howSocketError
Alert
}:
Props
)
=>
{
const
initialList
=
useInitialList
({
data
:
data
??
[],
idFn
:
(
item
)
=>
item
.
height
,
...
...
@@ -71,7 +71,7 @@ const BlocksTable = ({ data, isLoading, top, page, showSocketInfo, socketInfoNum
<
TableBody
>
{
showSocketInfo
&&
(
<
SocketNewItemsNotice
.
Desktop
alert=
{
socketInfo
Alert
}
showErrorAlert=
{
showSocketError
Alert
}
num=
{
socketInfoNum
}
type=
"block"
isLoading=
{
isLoading
}
...
...
ui/home/LatestTxs.tsx
View file @
1a5f0e63
...
...
@@ -23,7 +23,7 @@ const LatestTransactions = () => {
},
});
const
{
num
,
alertTex
t
}
=
useNewTxsSocket
({
type
:
'
txs_home
'
,
isLoading
:
isPlaceholderData
});
const
{
num
,
showErrorAler
t
}
=
useNewTxsSocket
({
type
:
'
txs_home
'
,
isLoading
:
isPlaceholderData
});
if
(
isError
)
{
return
<
Text
mt=
{
4
}
>
No data. Please reload the page.
</
Text
>;
...
...
@@ -33,7 +33,7 @@ const LatestTransactions = () => {
const
txsUrl
=
route
({
pathname
:
'
/txs
'
});
return
(
<>
<
SocketNewItemsNotice
borderBottomRadius=
{
0
}
url=
{
txsUrl
}
num=
{
num
}
alert=
{
alertTex
t
}
isLoading=
{
isPlaceholderData
}
/>
<
SocketNewItemsNotice
borderBottomRadius=
{
0
}
url=
{
txsUrl
}
num=
{
num
}
showErrorAlert=
{
showErrorAler
t
}
isLoading=
{
isPlaceholderData
}
/>
<
Box
mb=
{
3
}
display=
{
{
base
:
'
block
'
,
lg
:
'
none
'
}
}
>
{
data
.
slice
(
0
,
txsCount
).
map
(((
tx
,
index
)
=>
(
<
LatestTxsItemMobile
...
...
ui/home/latestDeposits/LatestArbitrumDeposits.tsx
View file @
1a5f0e63
...
...
@@ -22,14 +22,14 @@ const LatestArbitrumDeposits = () => {
});
const
[
num
,
setNum
]
=
useGradualIncrement
(
0
);
const
[
s
ocketAlert
,
setSocketAlert
]
=
React
.
useState
(
''
);
const
[
s
howSocketErrorAlert
,
setShowSocketErrorAlert
]
=
React
.
useState
(
false
);
const
handleSocketClose
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
Connection is lost. Please reload the page.
'
);
setS
howSocketErrorAlert
(
true
);
},
[]);
const
handleSocketError
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
An error has occurred while fetching new transactions. Please reload the page.
'
);
setS
howSocketErrorAlert
(
true
);
},
[]);
const
handleNewDepositMessage
:
SocketMessage
.
NewArbitrumDeposits
[
'
handler
'
]
=
React
.
useCallback
((
payload
)
=>
{
...
...
@@ -66,7 +66,7 @@ const LatestArbitrumDeposits = () => {
))
}
isLoading=
{
isPlaceholderData
}
socketItemsNum=
{
num
}
s
ocketAlert=
{
socket
Alert
}
s
howSocketErrorAlert=
{
showSocketError
Alert
}
/>
);
}
...
...
ui/home/latestDeposits/LatestDeposits.tsx
View file @
1a5f0e63
...
...
@@ -28,7 +28,7 @@ type Props = {
isLoading
?:
boolean
;
items
:
Array
<
DepositsItem
>
;
socketItemsNum
:
number
;
s
ocketAlert
?:
string
;
s
howSocketErrorAlert
?:
boolean
;
};
type
ItemProps
=
{
...
...
@@ -151,11 +151,18 @@ const LatestDepositsItem = ({ item, isLoading }: ItemProps) => {
);
};
const
LatestDeposits
=
({
isLoading
,
items
,
s
ocket
Alert
,
socketItemsNum
}:
Props
)
=>
{
const
LatestDeposits
=
({
isLoading
,
items
,
s
howSocketError
Alert
,
socketItemsNum
}:
Props
)
=>
{
const
depositsUrl
=
route
({
pathname
:
'
/deposits
'
});
return
(
<>
<
SocketNewItemsNotice
borderBottomRadius=
{
0
}
url=
{
depositsUrl
}
num=
{
socketItemsNum
}
alert=
{
socketAlert
}
type=
"deposit"
isLoading=
{
isLoading
}
/>
<
SocketNewItemsNotice
borderBottomRadius=
{
0
}
url=
{
depositsUrl
}
num=
{
socketItemsNum
}
showErrorAlert=
{
showSocketErrorAlert
}
type=
"deposit"
isLoading=
{
isLoading
}
/>
<
Box
mb=
{
{
base
:
3
,
lg
:
4
}
}
>
{
items
.
map
(((
item
,
index
)
=>
(
<
LatestDepositsItem
...
...
ui/home/latestDeposits/LatestOptimisticDeposits.tsx
View file @
1a5f0e63
...
...
@@ -22,14 +22,14 @@ const LatestOptimisticDeposits = () => {
});
const
[
num
,
setNum
]
=
useGradualIncrement
(
0
);
const
[
s
ocketAlert
,
setSocketAlert
]
=
React
.
useState
(
''
);
const
[
s
howSocketErrorAlert
,
setShowSocketErrorAlert
]
=
React
.
useState
(
false
);
const
handleSocketClose
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
Connection is lost. Please reload the page.
'
);
setS
howSocketErrorAlert
(
true
);
},
[]);
const
handleSocketError
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
An error has occurred while fetching new transactions. Please reload the page.
'
);
setS
howSocketErrorAlert
(
true
);
},
[]);
const
handleNewDepositMessage
:
SocketMessage
.
NewOptimisticDeposits
[
'
handler
'
]
=
React
.
useCallback
((
payload
)
=>
{
...
...
@@ -61,7 +61,7 @@ const LatestOptimisticDeposits = () => {
))
}
isLoading=
{
isPlaceholderData
}
socketItemsNum=
{
num
}
s
ocketAlert=
{
socket
Alert
}
s
howSocketErrorAlert=
{
showSocketError
Alert
}
/>
);
}
...
...
ui/pages/__screenshots__/Blocks.pw.tsx_default_socket-error-1.png
View replaced file @
a2b9c418
View file @
1a5f0e63
46.2 KB
|
W:
|
H:
45 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/shared/SocketNewItemsNotice.pw.tsx
View file @
1a5f0e63
...
...
@@ -17,7 +17,7 @@ test('2 new items in validated txs list +@dark-mode', async({ render }) => {
});
test
(
'
connection loss
'
,
async
({
render
})
=>
{
const
component
=
await
render
(<
SocketNewItemsNotice
url=
"/"
alert=
"Connection is lost. Please reload the page."
/>,
{
hooksConfig
});
const
component
=
await
render
(<
SocketNewItemsNotice
url=
"/"
showErrorAlert
/>,
{
hooksConfig
});
await
expect
(
component
).
toHaveScreenshot
();
});
...
...
ui/shared/SocketNewItemsNotice.tsx
View file @
1a5f0e63
...
...
@@ -15,19 +15,19 @@ interface Props {
children
?:
(
props
:
InjectedProps
)
=>
React
.
JSX
.
Element
;
className
?:
string
;
url
?:
string
;
alert
?:
string
;
showErrorAlert
?:
boolean
;
num
?:
number
;
isLoading
?:
boolean
;
}
const
SocketNewItemsNotice
=
chakra
(({
children
,
className
,
url
,
num
,
a
lert
,
type
=
'
transaction
'
,
isLoading
}:
Props
)
=>
{
const
SocketNewItemsNotice
=
chakra
(({
children
,
className
,
url
,
num
,
showErrorA
lert
,
type
=
'
transaction
'
,
isLoading
}:
Props
)
=>
{
const
handleLinkClick
=
React
.
useCallback
(()
=>
{
window
.
location
.
reload
();
},
[]);
const
alertContent
=
(()
=>
{
if
(
a
lert
)
{
return
alert
;
if
(
showErrorA
lert
)
{
return
'
Live updates temporarily delayed
'
;
}
let
name
;
...
...
ui/shared/TokenTransfer/TokenTransferTable.tsx
View file @
1a5f0e63
...
...
@@ -15,7 +15,7 @@ interface Props {
top
:
number
;
enableTimeIncrement
?:
boolean
;
showSocketInfo
?:
boolean
;
s
ocketInfoAlert
?:
string
;
s
howSocketErrorAlert
?:
boolean
;
socketInfoNum
?:
number
;
isLoading
?:
boolean
;
}
...
...
@@ -27,7 +27,7 @@ const TokenTransferTable = ({
top
,
enableTimeIncrement
,
showSocketInfo
,
s
ocketInfo
Alert
,
s
howSocketError
Alert
,
socketInfoNum
,
isLoading
,
}:
Props
)
=>
{
...
...
@@ -53,7 +53,7 @@ const TokenTransferTable = ({
<
TableBody
>
{
showSocketInfo
&&
(
<
SocketNewItemsNotice
.
Desktop
alert=
{
socketInfo
Alert
}
showErrorAlert=
{
showSocketError
Alert
}
num=
{
socketInfoNum
}
type=
"token_transfer"
isLoading=
{
isLoading
}
...
...
ui/shared/__screenshots__/SocketNewItemsNotice.pw.tsx_default_connection-loss-1.png
View replaced file @
a2b9c418
View file @
1a5f0e63
2.74 KB
|
W:
|
H:
2.36 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/token/TokenTransfer/TokenTransfer.tsx
View file @
1a5f0e63
...
...
@@ -40,18 +40,18 @@ const TokenTransfer = ({ transfersQuery, tokenId, tokenQuery, tabsHeight = TABS_
const
{
data
:
token
,
isPlaceholderData
:
isTokenPlaceholderData
,
isError
:
isTokenError
}
=
tokenQuery
;
const
[
newItemsCount
,
setNewItemsCount
]
=
useGradualIncrement
(
0
);
const
[
s
ocketAlert
,
setSocketAlert
]
=
React
.
useState
(
''
);
const
[
s
howSocketErrorAlert
,
setShowSocketErrorAlert
]
=
React
.
useState
(
false
);
const
handleNewTransfersMessage
:
SocketMessage
.
TokenTransfers
[
'
handler
'
]
=
(
payload
)
=>
{
setNewItemsCount
(
payload
.
token_transfer
);
};
const
handleSocketClose
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
Connection is lost. Please refresh the page to load new token transfers.
'
);
setS
howSocketErrorAlert
(
true
);
},
[]);
const
handleSocketError
=
React
.
useCallback
(()
=>
{
setS
ocketAlert
(
'
An error has occurred while fetching new token transfers. Please refresh the page.
'
);
setS
howSocketErrorAlert
(
true
);
},
[]);
const
channel
=
useSocketChannel
({
...
...
@@ -79,7 +79,7 @@ const TokenTransfer = ({ transfersQuery, tokenId, tokenQuery, tabsHeight = TABS_
data={ data?.items }
top={ tabsHeight }
showSocketInfo={ pagination.page === 1 }
s
ocketInfoAlert={ socket
Alert }
s
howSocketErrorAlert={ showSocketError
Alert }
socketInfoNum={ newItemsCount }
tokenId={ tokenId }
token={ token }
...
...
@@ -91,7 +91,7 @@ const TokenTransfer = ({ transfersQuery, tokenId, tokenQuery, tabsHeight = TABS_
{ pagination.page === 1 && (
<SocketNewItemsNotice.Mobile
num={ newItemsCount }
alert={ socket
Alert }
showErrorAlert={ showSocketError
Alert }
type="token_transfer"
isLoading={ isLoading }
/>
...
...
ui/token/TokenTransfer/TokenTransferTable.tsx
View file @
1a5f0e63
...
...
@@ -15,7 +15,7 @@ interface Props {
data
:
Array
<
TokenTransfer
>
;
top
:
number
;
showSocketInfo
:
boolean
;
s
ocketInfoAlert
?:
string
;
s
howSocketErrorAlert
?:
boolean
;
socketInfoNum
?:
number
;
tokenId
?:
string
;
isLoading
?:
boolean
;
...
...
@@ -23,7 +23,7 @@ interface Props {
instance
?:
TokenInstance
;
}
const
TokenTransferTable
=
({
data
,
top
,
showSocketInfo
,
s
ocketInfo
Alert
,
socketInfoNum
,
tokenId
,
isLoading
,
token
,
instance
}:
Props
)
=>
{
const
TokenTransferTable
=
({
data
,
top
,
showSocketInfo
,
s
howSocketError
Alert
,
socketInfoNum
,
tokenId
,
isLoading
,
token
,
instance
}:
Props
)
=>
{
const
tokenType
=
token
.
type
;
...
...
@@ -51,7 +51,7 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket
<
TableBody
>
{
showSocketInfo
&&
(
<
SocketNewItemsNotice
.
Desktop
alert=
{
socketInfo
Alert
}
showErrorAlert=
{
showSocketError
Alert
}
num=
{
socketInfoNum
}
type=
"token_transfer"
isLoading=
{
isLoading
}
...
...
ui/txs/socket/TxsSocketNoticeTypeAddress.tsx
View file @
1a5f0e63
...
...
@@ -12,7 +12,7 @@ interface Props {
}
const
TxsSocketNoticeTypeAddress
=
({
place
,
isLoading
}:
Props
)
=>
{
const
{
num
,
alertTex
t
}
=
useTxsSocketTypeAddress
({
isLoading
});
const
{
num
,
showErrorAler
t
}
=
useTxsSocketTypeAddress
({
isLoading
});
if
(
num
===
undefined
)
{
return
null
;
...
...
@@ -21,7 +21,7 @@ const TxsSocketNoticeTypeAddress = ({ place, isLoading }: Props) => {
if
(
place
===
'
table
'
)
{
return
(
<
SocketNewItemsNotice
.
Desktop
alert=
{
alertTex
t
}
showErrorAlert=
{
showErrorAler
t
}
num=
{
num
}
isLoading=
{
isLoading
}
/>
...
...
@@ -32,7 +32,7 @@ const TxsSocketNoticeTypeAddress = ({ place, isLoading }: Props) => {
return
(
<
SocketNewItemsNotice
.
Mobile
num=
{
num
}
alert=
{
alertTex
t
}
showErrorAlert=
{
showErrorAler
t
}
isLoading=
{
isLoading
}
/>
);
...
...
ui/txs/socket/TxsSocketNoticeTypeAll.tsx
View file @
1a5f0e63
...
...
@@ -17,7 +17,7 @@ interface Props {
const
TxsSocketNoticeTypeAll
=
({
type
,
place
,
isLoading
}:
Props
)
=>
{
const
multichainContext
=
useMultichainContext
();
const
{
num
,
alertTex
t
}
=
useNewTxsSocketTypeAll
({
type
,
isLoading
});
const
{
num
,
showErrorAler
t
}
=
useNewTxsSocketTypeAll
({
type
,
isLoading
});
if
(
num
===
undefined
)
{
return
null
;
...
...
@@ -36,7 +36,7 @@ const TxsSocketNoticeTypeAll = ({ type, place, isLoading }: Props) => {
if
(
place
===
'
table
'
)
{
return
(
<
SocketNewItemsNotice
.
Desktop
alert=
{
alertTex
t
}
showErrorAlert=
{
showErrorAler
t
}
num=
{
num
}
isLoading=
{
isLoading
}
url=
{
url
}
...
...
@@ -48,7 +48,7 @@ const TxsSocketNoticeTypeAll = ({ type, place, isLoading }: Props) => {
return
(
<
SocketNewItemsNotice
.
Mobile
num=
{
num
}
alert=
{
alertTex
t
}
showErrorAlert=
{
showErrorAler
t
}
isLoading=
{
isLoading
}
url=
{
url
}
/>
...
...
ui/txs/socket/useTxsSocketTypeAddress.tsx
View file @
1a5f0e63
...
...
@@ -38,7 +38,7 @@ interface Params {
}
export
default
function
useTxsSocketTypeAddress
({
isLoading
}:
Params
)
{
const
[
alertText
,
setAlertText
]
=
React
.
useState
(
''
);
const
[
showErrorAlert
,
setShowErrorAlert
]
=
React
.
useState
(
false
);
const
[
num
,
setNum
]
=
React
.
useState
(
0
);
const
router
=
useRouter
();
...
...
@@ -51,12 +51,12 @@ export default function useTxsSocketTypeAddress({ isLoading }: Params) {
const
{
chain
}
=
useMultichainContext
()
||
{};
const
handleNewSocketMessage
:
SocketMessage
.
AddressTxs
[
'
handler
'
]
=
React
.
useCallback
((
payload
)
=>
{
setAlertText
(
''
);
const
queryKey
=
getResourceKey
(
'
general:address_txs
'
,
{
pathParams
:
{
hash
:
currentAddress
},
queryParams
:
filterValue
?
{
filter
:
filterValue
}
:
undefined
,
chainSlug
:
chain
?.
slug
,
});
setShowErrorAlert
(
false
);
queryClient
.
setQueryData
(
queryKey
,
...
...
@@ -100,11 +100,11 @@ export default function useTxsSocketTypeAddress({ isLoading }: Params) {
},
[
currentAddress
,
filterValue
,
queryClient
,
sort
,
chain
?.
slug
]);
const
handleSocketClose
=
React
.
useCallback
(()
=>
{
set
AlertText
(
'
Connection is lost. Please refresh the page to load new transactions.
'
);
set
ShowErrorAlert
(
true
);
},
[]);
const
handleSocketError
=
React
.
useCallback
(()
=>
{
set
AlertText
(
'
An error has occurred while fetching new transactions. Please refresh the page.
'
);
set
ShowErrorAlert
(
true
);
},
[]);
const
isDisabled
=
Boolean
((
page
&&
page
!==
'
1
'
)
||
isLoading
);
...
...
@@ -132,5 +132,5 @@ export default function useTxsSocketTypeAddress({ isLoading }: Params) {
return { };
}
return { num,
alertTex
t };
return { num,
showErrorAler
t };
}
ui/txs/socket/useTxsSocketTypeAll.tsx
View file @
1a5f0e63
...
...
@@ -45,7 +45,7 @@ export default function useNewTxsSocketTypeAll({ type, isLoading }: Params) {
const
page
=
getQueryParamString
(
router
.
query
.
page
);
const
[
num
,
setNum
]
=
useGradualIncrement
(
0
);
const
[
alertText
,
setAlertText
]
=
React
.
useState
(
''
);
const
[
showErrorAlert
,
setShowErrorAlert
]
=
React
.
useState
(
false
);
const
{
topic
,
event
}
=
getSocketParams
(
type
,
page
);
...
...
@@ -59,11 +59,11 @@ export default function useNewTxsSocketTypeAll({ type, isLoading }: Params) {
},
[
setNum
]);
const
handleSocketClose
=
React
.
useCallback
(()
=>
{
set
AlertText
(
'
Connection is lost. Please reload the page.
'
);
set
ShowErrorAlert
(
true
);
},
[]);
const
handleSocketError
=
React
.
useCallback
(()
=>
{
set
AlertText
(
'
An error has occurred while fetching new transactions. Please reload the page.
'
);
set
ShowErrorAlert
(
true
);
},
[]);
const
channel
=
useSocketChannel
({
...
...
@@ -83,5 +83,5 @@ export default function useNewTxsSocketTypeAll({ type, isLoading }: Params) {
return
{
};
}
return
{
num
,
alertTex
t
};
return
{
num
,
showErrorAler
t
};
}
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