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
d7075bc8
Commit
d7075bc8
authored
Jan 11, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token transfer notice
parent
17e3dce6
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
35 additions
and
20 deletions
+35
-20
AddressTokenTransfers.tsx
ui/address/AddressTokenTransfers.tsx
+7
-2
LatestTxs.tsx
ui/home/LatestTxs.tsx
+2
-2
SocketNewItemsNotice.pw.tsx
ui/shared/SocketNewItemsNotice.pw.tsx
+4
-4
SocketNewItemsNotice.tsx
ui/shared/SocketNewItemsNotice.tsx
+7
-4
TokenTransferTable.tsx
ui/shared/TokenTransfer/TokenTransferTable.tsx
+9
-2
SocketNewItemsNotice.pw.tsx_dark-color-mode_2-new-items-in-validated-txs-list-dark-mode-1.png
...or-mode_2-new-items-in-validated-txs-list-dark-mode-1.png
+0
-0
SocketNewItemsNotice.pw.tsx_default_2-new-items-in-validated-txs-list-dark-mode-1.png
...default_2-new-items-in-validated-txs-list-dark-mode-1.png
+0
-0
SocketNewItemsNotice.pw.tsx_default_connection-loss-1.png
...SocketNewItemsNotice.pw.tsx_default_connection-loss-1.png
+0
-0
SocketNewItemsNotice.pw.tsx_default_fetching-1.png
...hots__/SocketNewItemsNotice.pw.tsx_default_fetching-1.png
+0
-0
TxsContent.tsx
ui/txs/TxsContent.tsx
+3
-3
TxsTable.tsx
ui/txs/TxsTable.tsx
+3
-3
No files found.
ui/address/AddressTokenTransfers.tsx
View file @
d7075bc8
...
...
@@ -22,11 +22,11 @@ import DataFetchAlert from 'ui/shared/DataFetchAlert';
import
Pagination
from
'
ui/shared/Pagination
'
;
import
SkeletonList
from
'
ui/shared/skeletons/SkeletonList
'
;
import
SkeletonTable
from
'
ui/shared/skeletons/SkeletonTable
'
;
import
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
{
TOKEN_TYPE
,
flattenTotal
}
from
'
ui/shared/TokenTransfer/helpers
'
;
import
TokenTransferFilter
from
'
ui/shared/TokenTransfer/TokenTransferFilter
'
;
import
TokenTransferList
from
'
ui/shared/TokenTransfer/TokenTransferList
'
;
import
TokenTransferTable
from
'
ui/shared/TokenTransfer/TokenTransferTable
'
;
import
TxsNewItemNotice
from
'
ui/txs/TxsNewItemNotice
'
;
type
Filters
=
{
type
:
Array
<
TokenType
>
;
...
...
@@ -185,7 +185,12 @@ const AddressTokenTransfers = ({ scrollRef }: {scrollRef?: React.RefObject<HTMLD
/>
</
Hide
>
<
Show
below=
"lg"
>
<
TxsNewItemNotice
url=
{
window
.
location
.
href
}
num=
{
newItemsCount
}
alert=
{
socketAlert
}
/>
<
SocketNewItemsNotice
url=
{
window
.
location
.
href
}
num=
{
newItemsCount
}
alert=
{
socketAlert
}
type=
"token_transfer"
/>
<
TokenTransferList
data=
{
items
}
baseAddress=
{
currentAddress
}
...
...
ui/home/LatestTxs.tsx
View file @
d7075bc8
...
...
@@ -5,7 +5,7 @@ import useApiQuery from 'lib/api/useApiQuery';
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useNewTxsSocket
from
'
lib/hooks/useNewTxsSocket
'
;
import
link
from
'
lib/link/link
'
;
import
TxsNewItemNotice
from
'
ui/txs/TxsNewItem
Notice
'
;
import
SocketNewItemsNotice
from
'
ui/shared/SocketNewItems
Notice
'
;
import
LatestTxsItem
from
'
./LatestTxsItem
'
;
import
LatestTxsItemSkeleton
from
'
./LatestTxsItemSkeleton
'
;
...
...
@@ -36,7 +36,7 @@ const LatestTransactions = () => {
const
txsUrl
=
link
(
'
txs
'
);
content
=
(
<>
<
TxsNewItem
Notice
borderBottomRadius=
{
0
}
url=
{
link
(
'
txs
'
)
}
num=
{
num
}
alert=
{
socketAlert
}
/>
<
SocketNewItems
Notice
borderBottomRadius=
{
0
}
url=
{
link
(
'
txs
'
)
}
num=
{
num
}
alert=
{
socketAlert
}
/>
<
Box
mb=
{
{
base
:
3
,
lg
:
4
}
}
>
{
data
.
slice
(
0
,
txsCount
).
map
((
tx
=>
<
LatestTxsItem
key=
{
tx
.
hash
}
tx=
{
tx
}
/>))
}
</
Box
>
...
...
ui/
txs/TxsNewItem
Notice.pw.tsx
→
ui/
shared/SocketNewItems
Notice.pw.tsx
View file @
d7075bc8
...
...
@@ -4,7 +4,7 @@ import React from 'react';
import
{
ROUTES
}
from
'
lib/link/routes
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
TxsNewItemNotice
from
'
./TxsNewItem
Notice
'
;
import
SocketNewItemsNotice
from
'
./SocketNewItems
Notice
'
;
const
hooksConfig
=
{
router
:
{
...
...
@@ -16,7 +16,7 @@ const hooksConfig = {
test
(
'
2 new items in validated txs list +@dark-mode
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
TxsNewItem
Notice
url=
"/"
num=
{
2
}
/>
<
SocketNewItems
Notice
url=
"/"
num=
{
2
}
/>
</
TestApp
>,
{
hooksConfig
},
);
...
...
@@ -27,7 +27,7 @@ test('2 new items in validated txs list +@dark-mode', async({ mount }) => {
test
(
'
connection loss
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
TxsNewItem
Notice
url=
"/"
alert=
"Connection is lost. Please reload the page."
/>
<
SocketNewItems
Notice
url=
"/"
alert=
"Connection is lost. Please reload the page."
/>
</
TestApp
>,
{
hooksConfig
},
);
...
...
@@ -38,7 +38,7 @@ test('connection loss', async({ mount }) => {
test
(
'
fetching
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
TxsNewItem
Notice
url=
"/"
/>
<
SocketNewItems
Notice
url=
"/"
/>
</
TestApp
>,
{
hooksConfig
},
);
...
...
ui/
txs/TxsNewItem
Notice.tsx
→
ui/
shared/SocketNewItems
Notice.tsx
View file @
d7075bc8
...
...
@@ -7,6 +7,7 @@ interface InjectedProps {
}
interface
Props
{
type
?:
'
transaction
'
|
'
token_transfer
'
;
children
?:
(
props
:
InjectedProps
)
=>
JSX
.
Element
;
className
?:
string
;
url
:
string
;
...
...
@@ -14,7 +15,7 @@ interface Props {
num
?:
number
;
}
const
TxsNewItemNotice
=
({
children
,
className
,
url
,
num
,
alert
}:
Props
)
=>
{
const
SocketNewItemsNotice
=
({
children
,
className
,
url
,
num
,
alert
,
type
=
'
transaction
'
}:
Props
)
=>
{
const
theme
=
useTheme
();
const
alertContent
=
(()
=>
{
...
...
@@ -22,13 +23,15 @@ const TxsNewItemNotice = ({ children, className, url, num, alert }: Props) => {
return
alert
;
}
const
name
=
type
===
'
token_transfer
'
?
'
token transfer
'
:
'
transaction
'
;
if
(
!
num
)
{
return
'
scanning new transactions...
'
;
return
`scanning new
${
name
}
s...`
;
}
return
(
<>
<
Link
href=
{
url
}
>
{
num
}
more
transaction
{
num
>
1
?
'
s
'
:
''
}
</
Link
>
<
Link
href=
{
url
}
>
{
num
}
more
{
name
}
{
num
>
1
?
'
s
'
:
''
}
</
Link
>
<
Text
whiteSpace=
"pre"
>
ha
{
num
>
1
?
'
ve
'
:
'
s
'
}
come in
</
Text
>
</>
);
...
...
@@ -52,4 +55,4 @@ const TxsNewItemNotice = ({ children, className, url, num, alert }: Props) => {
return
children
?
children
({
content
})
:
content
;
};
export
default
chakra
(
TxsNewItem
Notice
);
export
default
chakra
(
SocketNewItems
Notice
);
ui/shared/TokenTransfer/TokenTransferTable.tsx
View file @
d7075bc8
...
...
@@ -3,9 +3,9 @@ import React from 'react';
import
type
{
TokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
TokenTransferTableItem
from
'
ui/shared/TokenTransfer/TokenTransferTableItem
'
;
import
TxsNewItemNotice
from
'
ui/txs/TxsNewItemNotice
'
;
interface
Props
{
data
:
Array
<
TokenTransfer
>
;
...
...
@@ -47,7 +47,14 @@ const TokenTransferTable = ({
{
showSocketInfo
&&
(
<
Tr
>
<
Td
colSpan=
{
10
}
p=
{
0
}
>
<
TxsNewItemNotice
borderRadius=
{
0
}
pl=
"10px"
url=
{
window
.
location
.
href
}
alert=
{
socketInfoAlert
}
num=
{
socketInfoNum
}
/>
<
SocketNewItemsNotice
borderRadius=
{
0
}
pl=
"10px"
url=
{
window
.
location
.
href
}
alert=
{
socketInfoAlert
}
num=
{
socketInfoNum
}
type=
"token_transfer"
/>
</
Td
>
</
Tr
>
)
}
...
...
ui/
txs/__screenshots__/TxsNewItem
Notice.pw.tsx_dark-color-mode_2-new-items-in-validated-txs-list-dark-mode-1.png
→
ui/
shared/__screenshots__/SocketNewItems
Notice.pw.tsx_dark-color-mode_2-new-items-in-validated-txs-list-dark-mode-1.png
View file @
d7075bc8
File moved
ui/
txs/__screenshots__/TxsNewItem
Notice.pw.tsx_default_2-new-items-in-validated-txs-list-dark-mode-1.png
→
ui/
shared/__screenshots__/SocketNewItems
Notice.pw.tsx_default_2-new-items-in-validated-txs-list-dark-mode-1.png
View file @
d7075bc8
File moved
ui/
txs/__screenshots__/TxsNewItem
Notice.pw.tsx_default_connection-loss-1.png
→
ui/
shared/__screenshots__/SocketNewItems
Notice.pw.tsx_default_connection-loss-1.png
View file @
d7075bc8
File moved
ui/
txs/__screenshots__/TxsNewItem
Notice.pw.tsx_default_fetching-1.png
→
ui/
shared/__screenshots__/SocketNewItems
Notice.pw.tsx_default_fetching-1.png
View file @
d7075bc8
File moved
ui/txs/TxsContent.tsx
View file @
d7075bc8
...
...
@@ -9,10 +9,10 @@ import DataFetchAlert from 'ui/shared/DataFetchAlert';
import
type
{
Props
as
PaginationProps
}
from
'
ui/shared/Pagination
'
;
import
SkeletonList
from
'
ui/shared/skeletons/SkeletonList
'
;
import
SkeletonTable
from
'
ui/shared/skeletons/SkeletonTable
'
;
import
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
TxsHeaderMobile
from
'
./TxsHeaderMobile
'
;
import
TxsListItem
from
'
./TxsListItem
'
;
import
TxsNewItemNotice
from
'
./TxsNewItemNotice
'
;
import
TxsTable
from
'
./TxsTable
'
;
import
useTxsSort
from
'
./useTxsSort
'
;
...
...
@@ -75,9 +75,9 @@ const TxsContent = ({
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
>
{
showSocketInfo
&&
(
<
TxsNewItem
Notice
url=
{
window
.
location
.
href
}
num=
{
socketInfoNum
}
alert=
{
socketInfoAlert
}
>
<
SocketNewItems
Notice
url=
{
window
.
location
.
href
}
num=
{
socketInfoNum
}
alert=
{
socketInfoAlert
}
>
{
({
content
})
=>
<
Box
>
{
content
}
</
Box
>
}
</
TxsNewItem
Notice
>
</
SocketNewItems
Notice
>
)
}
{
txs
.
map
(
tx
=>
(
<
TxsListItem
...
...
ui/txs/TxsTable.tsx
View file @
d7075bc8
...
...
@@ -7,9 +7,9 @@ import type { Sort } from 'types/client/txs-sort';
import
appConfig
from
'
configs/app/config
'
;
import
rightArrowIcon
from
'
icons/arrows/east.svg
'
;
import
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
TheadSticky
from
'
ui/shared/TheadSticky
'
;
import
TxsNewItemNotice
from
'
./TxsNewItemNotice
'
;
import
TxsTableItem
from
'
./TxsTableItem
'
;
type
Props
=
{
...
...
@@ -67,9 +67,9 @@ const TxsTable = ({
</
TheadSticky
>
<
Tbody
>
{
showSocketInfo
&&
(
<
TxsNewItem
Notice
borderRadius=
{
0
}
url=
{
window
.
location
.
href
}
alert=
{
socketInfoAlert
}
num=
{
socketInfoNum
}
>
<
SocketNewItems
Notice
borderRadius=
{
0
}
url=
{
window
.
location
.
href
}
alert=
{
socketInfoAlert
}
num=
{
socketInfoNum
}
>
{
({
content
})
=>
<
Tr
><
Td
colSpan=
{
10
}
p=
{
0
}
>
{
content
}
</
Td
></
Tr
>
}
</
TxsNewItem
Notice
>
</
SocketNewItems
Notice
>
)
}
<
AnimatePresence
initial=
{
false
}
>
{
txs
.
map
((
item
)
=>
(
...
...
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