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
6c26a876
Commit
6c26a876
authored
Apr 26, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
socket notice components for desktop and mobile
parent
4dd65e9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
24 deletions
+39
-24
SocketNewItemsNotice.tsx
ui/shared/SocketNewItemsNotice.tsx
+28
-3
TokenTransfer.tsx
ui/token/TokenTransfer/TokenTransfer.tsx
+2
-3
TokenTransferTable.tsx
ui/token/TokenTransfer/TokenTransferTable.tsx
+9
-18
No files found.
ui/shared/SocketNewItemsNotice.tsx
View file @
6c26a876
import
{
Alert
,
Link
,
Text
,
chakra
,
useTheme
,
useColorModeValue
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
Alert
,
Link
,
Text
,
chakra
,
useTheme
,
useColorModeValue
,
Skeleton
,
Tr
,
Td
}
from
'
@chakra-ui/react
'
;
import
{
transparentize
}
from
'
@chakra-ui/theme-tools
'
;
import
{
transparentize
}
from
'
@chakra-ui/theme-tools
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -16,7 +16,7 @@ interface Props {
...
@@ -16,7 +16,7 @@ interface Props {
isLoading
?:
boolean
;
isLoading
?:
boolean
;
}
}
const
SocketNewItemsNotice
=
({
children
,
className
,
url
,
num
,
alert
,
type
=
'
transaction
'
,
isLoading
}:
Props
)
=>
{
const
SocketNewItemsNotice
=
chakra
(
({
children
,
className
,
url
,
num
,
alert
,
type
=
'
transaction
'
,
isLoading
}:
Props
)
=>
{
const
theme
=
useTheme
();
const
theme
=
useTheme
();
const
alertContent
=
(()
=>
{
const
alertContent
=
(()
=>
{
...
@@ -69,6 +69,31 @@ const SocketNewItemsNotice = ({ children, className, url, num, alert, type = 'tr
...
@@ -69,6 +69,31 @@ const SocketNewItemsNotice = ({ children, className, url, num, alert, type = 'tr
)
:
<
Skeleton
className=
{
className
}
h=
"33px"
/>;
)
:
<
Skeleton
className=
{
className
}
h=
"33px"
/>;
return
children
?
children
({
content
})
:
content
;
return
children
?
children
({
content
})
:
content
;
});
export
default
SocketNewItemsNotice
;
export
const
Desktop
=
({
...
props
}:
Props
)
=>
{
return
(
<
SocketNewItemsNotice
borderRadius=
{
props
.
isLoading
?
'
sm
'
:
0
}
h=
{
props
.
isLoading
?
4
:
'
auto
'
}
maxW=
{
props
.
isLoading
?
'
215px
'
:
undefined
}
w=
"100%"
mx=
{
props
.
isLoading
?
4
:
0
}
my=
{
props
.
isLoading
?
'
6px
'
:
0
}
{
...
props
}
>
{
({
content
})
=>
<
Tr
><
Td
colSpan=
{
100
}
p=
{
0
}
>
{
content
}
</
Td
></
Tr
>
}
</
SocketNewItemsNotice
>
);
};
};
export
default
chakra
(
SocketNewItemsNotice
);
export
const
Mobile
=
({
...
props
}:
Props
)
=>
{
return
(
<
SocketNewItemsNotice
borderBottomRadius=
{
0
}
{
...
props
}
/>
);
};
ui/token/TokenTransfer/TokenTransfer.tsx
View file @
6c26a876
...
@@ -15,7 +15,7 @@ import ActionBar from 'ui/shared/ActionBar';
...
@@ -15,7 +15,7 @@ import ActionBar from 'ui/shared/ActionBar';
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
Pagination
from
'
ui/shared/Pagination
'
;
import
Pagination
from
'
ui/shared/Pagination
'
;
import
type
{
Props
as
PaginationProps
}
from
'
ui/shared/Pagination
'
;
import
type
{
Props
as
PaginationProps
}
from
'
ui/shared/Pagination
'
;
import
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
*
as
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
TokenTransferList
from
'
ui/token/TokenTransfer/TokenTransferList
'
;
import
TokenTransferList
from
'
ui/token/TokenTransfer/TokenTransferList
'
;
import
TokenTransferTable
from
'
ui/token/TokenTransfer/TokenTransferTable
'
;
import
TokenTransferTable
from
'
ui/token/TokenTransfer/TokenTransferTable
'
;
...
@@ -77,12 +77,11 @@ const TokenTransfer = ({ transfersQuery, tokenId, token }: Props) => {
...
@@ -77,12 +77,11 @@ const TokenTransfer = ({ transfersQuery, tokenId, token }: Props) => {
</Box>
</Box>
<Box display={{ base: 'block', lg: 'none' }}>
<Box display={{ base: 'block', lg: 'none' }}>
{ pagination.page === 1 && (
{ pagination.page === 1 && (
<SocketNewItemsNotice
<SocketNewItemsNotice
.Mobile
url={ window.location.href }
url={ window.location.href }
num={ newItemsCount }
num={ newItemsCount }
alert={ socketAlert }
alert={ socketAlert }
type="token_transfer"
type="token_transfer"
borderBottomRadius={ 0 }
isLoading={ isPlaceholderData }
isLoading={ isPlaceholderData }
/>
/>
) }
) }
...
...
ui/token/TokenTransfer/TokenTransferTable.tsx
View file @
6c26a876
import
{
Table
,
Tbody
,
Tr
,
Th
,
Td
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenInfo
}
from
'
types/api/token
'
;
import
type
{
TokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
type
{
TokenTransfer
}
from
'
types/api/tokenTransfer
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
trimTokenSymbol
from
'
lib/token/trimTokenSymbol
'
;
import
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
*
as
SocketNewItemsNotice
from
'
ui/shared/SocketNewItemsNotice
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
TokenTransferTableItem
from
'
ui/token/TokenTransfer/TokenTransferTableItem
'
;
import
TokenTransferTableItem
from
'
ui/token/TokenTransfer/TokenTransferTableItem
'
;
...
@@ -39,22 +39,13 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket
...
@@ -39,22 +39,13 @@ const TokenTransferTable = ({ data, top, showSocketInfo, socketInfoAlert, socket
</
Thead
>
</
Thead
>
<
Tbody
>
<
Tbody
>
{
showSocketInfo
&&
(
{
showSocketInfo
&&
(
<
Tr
>
<
SocketNewItemsNotice
.
Desktop
<
Td
colSpan=
{
10
}
p=
{
0
}
>
url=
{
window
.
location
.
href
}
{
isLoading
?
(
alert=
{
socketInfoAlert
}
<
Skeleton
my=
"6px"
mx=
"10px"
h=
{
4
}
maxW=
"215px"
w=
"100%"
borderRadius=
"sm"
/>
num=
{
socketInfoNum
}
)
:
(
type=
"token_transfer"
<
SocketNewItemsNotice
isLoading=
{
isLoading
}
borderRadius=
{
0
}
/>
pl=
"10px"
url=
{
window
.
location
.
href
}
alert=
{
socketInfoAlert
}
num=
{
socketInfoNum
}
type=
"token_transfer"
/>
)
}
</
Td
>
</
Tr
>
)
}
)
}
{
data
.
map
((
item
,
index
)
=>
(
{
data
.
map
((
item
,
index
)
=>
(
<
TokenTransferTableItem
key=
{
index
}
{
...
item
}
tokenId=
{
tokenId
}
isLoading=
{
isLoading
}
/>
<
TokenTransferTableItem
key=
{
index
}
{
...
item
}
tokenId=
{
tokenId
}
isLoading=
{
isLoading
}
/>
...
...
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