Skip to content

Commit 4d01d20

Browse files
committed
fix link in new item socket alert
1 parent 5bf614f commit 4d01d20

11 files changed

+6
-16
lines changed

ui/address/AddressBlocksValidated.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ const AddressBlocksValidated = ({ shouldRender = true, isQueryEnabled = true }:
116116
</TableHeaderSticky>
117117
<TableBody>
118118
<SocketNewItemsNotice.Desktop
119-
url={ window.location.href }
120119
num={ newItemsCount }
121120
alert={ socketAlert }
122121
type="block"
@@ -136,7 +135,6 @@ const AddressBlocksValidated = ({ shouldRender = true, isQueryEnabled = true }:
136135
<Box hideFrom="lg">
137136
{ query.pagination.page === 1 && (
138137
<SocketNewItemsNotice.Mobile
139-
url={ window.location.href }
140138
num={ newItemsCount }
141139
alert={ socketAlert }
142140
type="block"

ui/address/AddressTokenTransfers.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ const AddressTokenTransfers = ({ overloadCount = OVERLOAD_COUNT, shouldRender =
197197
<Box hideFrom="lg">
198198
{ pagination.page === 1 && (
199199
<SocketNewItemsNotice.Mobile
200-
url={ window.location.href }
201200
num={ newItemsCount }
202201
alert={ socketAlert }
203202
type="token_transfer"

ui/blocks/BlocksContent.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const BlocksContent = ({ type, query, enableSocket = true, top }: Props) => {
9090
<Box hideFrom="lg">
9191
{ query.pagination.page === 1 && enableSocket && (
9292
<SocketNewItemsNotice.Mobile
93-
url={ window.location.href }
9493
num={ newItemsCount }
9594
alert={ socketAlert }
9695
type="block"

ui/blocks/BlocksTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const BlocksTable = ({ data, isLoading, top, page, showSocketInfo, socketInfoNum
6767
<TableBody>
6868
{ showSocketInfo && (
6969
<SocketNewItemsNotice.Desktop
70-
url={ window.location.href }
7170
alert={ socketInfoAlert }
7271
num={ socketInfoNum }
7372
type="block"

ui/shared/SocketNewItemsNotice.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ interface Props {
1414
type?: 'transaction' | 'token_transfer' | 'deposit' | 'block';
1515
children?: (props: InjectedProps) => React.JSX.Element;
1616
className?: string;
17-
url: string;
17+
url?: string;
1818
alert?: string;
1919
num?: number;
2020
isLoading?: boolean;
2121
}
2222

2323
const SocketNewItemsNotice = chakra(({ children, className, url, num, alert, type = 'transaction', isLoading }: Props) => {
24+
const handleLinkClick = React.useCallback(() => {
25+
window.location.reload();
26+
}, []);
27+
2428
const alertContent = (() => {
2529
if (alert) {
2630
return alert;
@@ -49,7 +53,7 @@ const SocketNewItemsNotice = chakra(({ children, className, url, num, alert, typ
4953

5054
return (
5155
<>
52-
<Link href={ url }>{ num.toLocaleString() } more { name }{ num > 1 ? 's' : '' }</Link>
56+
<Link href={ url } onClick={ !url ? handleLinkClick : undefined }>{ num.toLocaleString() } more { name }{ num > 1 ? 's' : '' }</Link>
5357
<Text whiteSpace="pre"> ha{ num > 1 ? 've' : 's' } come in</Text>
5458
</>
5559
);

ui/shared/TokenTransfer/TokenTransferTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const TokenTransferTable = ({
4747
<TableBody>
4848
{ showSocketInfo && (
4949
<SocketNewItemsNotice.Desktop
50-
url={ window.location.href }
5150
alert={ socketInfoAlert }
5251
num={ socketInfoNum }
5352
type="token_transfer"

ui/showcases/Alert.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ const AlertShowcase = () => {
7676
</TableHeader>
7777
<TableBody>
7878
<SocketNewItemsNotice.Desktop
79-
url={ window.location.href }
8079
num={ 1234 }
8180
type="block"
8281
isLoading
@@ -95,7 +94,6 @@ const AlertShowcase = () => {
9594
</TableHeader>
9695
<TableBody>
9796
<SocketNewItemsNotice.Desktop
98-
url={ window.location.href }
9997
num={ 1234 }
10098
type="block"
10199
isLoading={ false }

ui/token/TokenTransfer/TokenTransfer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ const TokenTransfer = ({ transfersQuery, tokenId, tokenQuery, tabsHeight = TABS_
8989
<Box display={{ base: 'block', lg: 'none' }}>
9090
{ pagination.page === 1 && (
9191
<SocketNewItemsNotice.Mobile
92-
url={ window.location.href }
9392
num={ newItemsCount }
9493
alert={ socketAlert }
9594
type="token_transfer"

ui/token/TokenTransfer/TokenTransferTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket
4747
<TableBody>
4848
{ showSocketInfo && (
4949
<SocketNewItemsNotice.Desktop
50-
url={ window.location.href }
5150
alert={ socketInfoAlert }
5251
num={ socketInfoNum }
5352
type="token_transfer"

ui/txs/socket/TxsSocketNoticeTypeAddress.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const TxsSocketNoticeTypeAddress = ({ place, isLoading }: Props) => {
2121
if (place === 'table') {
2222
return (
2323
<SocketNewItemsNotice.Desktop
24-
url={ window.location.href }
2524
alert={ alertText }
2625
num={ num }
2726
isLoading={ isLoading }
@@ -32,7 +31,6 @@ const TxsSocketNoticeTypeAddress = ({ place, isLoading }: Props) => {
3231
if (place === 'list') {
3332
return (
3433
<SocketNewItemsNotice.Mobile
35-
url={ window.location.href }
3634
num={ num }
3735
alert={ alertText }
3836
isLoading={ isLoading }

ui/txs/socket/TxsSocketNoticeTypeAll.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const TxsSocketNoticeTypeAll = ({ type, place, isLoading }: Props) => {
2222
if (place === 'table') {
2323
return (
2424
<SocketNewItemsNotice.Desktop
25-
url={ window.location.href }
2625
alert={ alertText }
2726
num={ num }
2827
isLoading={ isLoading }
@@ -33,7 +32,6 @@ const TxsSocketNoticeTypeAll = ({ type, place, isLoading }: Props) => {
3332
if (place === 'list') {
3433
return (
3534
<SocketNewItemsNotice.Mobile
36-
url={ window.location.href }
3735
num={ num }
3836
alert={ alertText }
3937
isLoading={ isLoading }

0 commit comments

Comments
 (0)