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
a299ed56
Commit
a299ed56
authored
Feb 21, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sponsored item
parent
d0230810
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
57 deletions
+39
-57
AddressDetails.tsx
ui/address/AddressDetails.tsx
+3
-18
DetailsSponsoredItem.tsx
ui/shared/DetailsSponsoredItem.tsx
+29
-0
TokenDetails.tsx
ui/token/TokenDetails.tsx
+3
-18
TokenInstanceContent.tsx
ui/tokenInstance/TokenInstanceContent.tsx
+0
-3
TokenInstanceDetails.tsx
ui/tokenInstance/TokenInstanceDetails.tsx
+2
-0
TxDetails.tsx
ui/tx/TxDetails.tsx
+2
-18
No files found.
ui/address/AddressDetails.tsx
View file @
a299ed56
import
{
Box
,
Flex
,
Text
,
Icon
,
Grid
,
GridItem
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
,
Text
,
Icon
,
Grid
}
from
'
@chakra-ui/react
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
{
route
}
from
'
nextjs-routes
'
;
...
@@ -10,14 +10,13 @@ import appConfig from 'configs/app/config';
...
@@ -10,14 +10,13 @@ import appConfig from 'configs/app/config';
import
blockIcon
from
'
icons/block.svg
'
;
import
blockIcon
from
'
icons/block.svg
'
;
import
type
{
ResourceError
}
from
'
lib/api/resources
'
;
import
type
{
ResourceError
}
from
'
lib/api/resources
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
AddressCounterItem
from
'
ui/address/details/AddressCounterItem
'
;
import
AddressCounterItem
from
'
ui/address/details/AddressCounterItem
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressHeadingInfo
from
'
ui/shared/AddressHeadingInfo
'
;
import
AddressHeadingInfo
from
'
ui/shared/AddressHeadingInfo
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsSponsoredItem
from
'
ui/shared/DetailsSponsoredItem
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
...
@@ -34,7 +33,6 @@ interface Props {
...
@@ -34,7 +33,6 @@ interface Props {
const
AddressDetails
=
({
addressQuery
,
scrollRef
}:
Props
)
=>
{
const
AddressDetails
=
({
addressQuery
,
scrollRef
}:
Props
)
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
isMobile
=
useIsMobile
();
const
addressHash
=
getQueryParamString
(
router
.
query
.
hash
);
const
addressHash
=
getQueryParamString
(
router
.
query
.
hash
);
...
@@ -196,20 +194,7 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
...
@@ -196,20 +194,7 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
</
LinkInternal
>
</
LinkInternal
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
)
}
{
isMobile
?
<
DetailsSponsoredItem
/>
(
<
GridItem
mt=
{
5
}
>
<
AdBanner
justifyContent=
"center"
/>
</
GridItem
>
)
:
(
<
DetailsInfoItem
title=
"Sponsored"
hint=
"Sponsored banner advertisement"
>
<
AdBanner
/>
</
DetailsInfoItem
>
)
}
</
Grid
>
</
Grid
>
</
Box
>
</
Box
>
);
);
...
...
ui/shared/DetailsSponsoredItem.tsx
0 → 100644
View file @
a299ed56
import
{
GridItem
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
const
DetailsSponsoredItem
=
()
=>
{
const
isMobile
=
useIsMobile
();
if
(
isMobile
)
{
return
(
<
GridItem
mt=
{
5
}
>
<
AdBanner
justifyContent=
"center"
/>
</
GridItem
>
);
}
return
(
<
DetailsInfoItem
title=
"Sponsored"
hint=
"Sponsored banner advertisement"
>
<
AdBanner
/>
</
DetailsInfoItem
>
);
};
export
default
React
.
memo
(
DetailsSponsoredItem
);
ui/token/TokenDetails.tsx
View file @
a299ed56
import
{
Grid
,
GridItem
,
Link
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
Grid
,
Link
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
...
@@ -8,10 +8,9 @@ import type { TokenInfo } from 'types/api/token';
...
@@ -8,10 +8,9 @@ import type { TokenInfo } from 'types/api/token';
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
type
{
TokenTabs
}
from
'
ui/pages/Token
'
;
import
type
{
TokenTabs
}
from
'
ui/pages/Token
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsSponsoredItem
from
'
ui/shared/DetailsSponsoredItem
'
;
import
DetailsSkeletonRow
from
'
ui/shared/skeletons/DetailsSkeletonRow
'
;
import
DetailsSkeletonRow
from
'
ui/shared/skeletons/DetailsSkeletonRow
'
;
interface
Props
{
interface
Props
{
...
@@ -20,7 +19,6 @@ interface Props {
...
@@ -20,7 +19,6 @@ interface Props {
const
TokenDetails
=
({
tokenQuery
}:
Props
)
=>
{
const
TokenDetails
=
({
tokenQuery
}:
Props
)
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
isMobile
=
useIsMobile
();
const
tokenCountersQuery
=
useApiQuery
(
'
token_counters
'
,
{
const
tokenCountersQuery
=
useApiQuery
(
'
token_counters
'
,
{
pathParams
:
{
hash
:
router
.
query
.
hash
?.
toString
()
},
pathParams
:
{
hash
:
router
.
query
.
hash
?.
toString
()
},
...
@@ -138,20 +136,7 @@ const TokenDetails = ({ tokenQuery }: Props) => {
...
@@ -138,20 +136,7 @@ const TokenDetails = ({ tokenQuery }: Props) => {
{
decimals
}
{
decimals
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
)
}
{
isMobile
?
<
DetailsSponsoredItem
/>
(
<
GridItem
mt=
{
5
}
>
<
AdBanner
justifyContent=
"center"
/>
</
GridItem
>
)
:
(
<
DetailsInfoItem
title=
"Sponsored"
hint=
"Sponsored banner advertisement"
>
<
AdBanner
/>
</
DetailsInfoItem
>
)
}
</
Grid
>
</
Grid
>
);
);
};
};
...
...
ui/tokenInstance/TokenInstanceContent.tsx
View file @
a299ed56
...
@@ -8,7 +8,6 @@ import useApiQuery from 'lib/api/useApiQuery';
...
@@ -8,7 +8,6 @@ import useApiQuery from 'lib/api/useApiQuery';
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useQueryWithPages
from
'
lib/hooks/useQueryWithPages
'
;
import
useQueryWithPages
from
'
lib/hooks/useQueryWithPages
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
AddressHeadingInfo
from
'
ui/shared/AddressHeadingInfo
'
;
import
AddressHeadingInfo
from
'
ui/shared/AddressHeadingInfo
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
...
@@ -89,8 +88,6 @@ const TokenInstanceContent = () => {
...
@@ -89,8 +88,6 @@ const TokenInstanceContent = () => {
<
TokenInstanceDetails
data=
{
tokenInstanceQuery
.
data
}
scrollRef=
{
scrollRef
}
/>
<
TokenInstanceDetails
data=
{
tokenInstanceQuery
.
data
}
scrollRef=
{
scrollRef
}
/>
<
AdBanner
mt=
{
{
base
:
6
,
lg
:
8
}
}
justifyContent=
"center"
/>
{
/* should stay before tabs to scroll up with pagination */
}
{
/* should stay before tabs to scroll up with pagination */
}
<
Box
ref=
{
scrollRef
}
></
Box
>
<
Box
ref=
{
scrollRef
}
></
Box
>
...
...
ui/tokenInstance/TokenInstanceDetails.tsx
View file @
a299ed56
...
@@ -8,6 +8,7 @@ import AddressIcon from 'ui/shared/address/AddressIcon';
...
@@ -8,6 +8,7 @@ import AddressIcon from 'ui/shared/address/AddressIcon';
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsSponsoredItem
from
'
ui/shared/DetailsSponsoredItem
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
import
TokenSnippet
from
'
ui/shared/TokenSnippet/TokenSnippet
'
;
...
@@ -65,6 +66,7 @@ const TokenInstanceDetails = ({ data, scrollRef }: Props) => {
...
@@ -65,6 +66,7 @@ const TokenInstanceDetails = ({ data, scrollRef }: Props) => {
</
Flex
>
</
Flex
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
<
TokenInstanceTransfersCount
hash=
{
data
.
token
.
address
}
id=
{
data
.
id
}
onClick=
{
handleCounterItemClick
}
/>
<
TokenInstanceTransfersCount
hash=
{
data
.
token
.
address
}
id=
{
data
.
id
}
onClick=
{
handleCounterItemClick
}
/>
<
DetailsSponsoredItem
/>
</
Grid
>
</
Grid
>
<
NftMedia
<
NftMedia
imageUrl=
{
data
.
image_url
}
imageUrl=
{
data
.
image_url
}
...
...
ui/tx/TxDetails.tsx
View file @
a299ed56
...
@@ -22,9 +22,7 @@ import errorIcon from 'icons/status/error.svg';
...
@@ -22,9 +22,7 @@ import errorIcon from 'icons/status/error.svg';
import
successIcon
from
'
icons/status/success.svg
'
;
import
successIcon
from
'
icons/status/success.svg
'
;
import
{
WEI
,
WEI_IN_GWEI
}
from
'
lib/consts
'
;
import
{
WEI
,
WEI_IN_GWEI
}
from
'
lib/consts
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
getConfirmationDuration
from
'
lib/tx/getConfirmationDuration
'
;
import
getConfirmationDuration
from
'
lib/tx/getConfirmationDuration
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
...
@@ -32,6 +30,7 @@ import CopyToClipboard from 'ui/shared/CopyToClipboard';
...
@@ -32,6 +30,7 @@ import CopyToClipboard from 'ui/shared/CopyToClipboard';
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
DetailsSponsoredItem
from
'
ui/shared/DetailsSponsoredItem
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
// import PrevNext from 'ui/shared/PrevNext';
// import PrevNext from 'ui/shared/PrevNext';
import
LogDecodedInputData
from
'
ui/shared/logs/LogDecodedInputData
'
;
import
LogDecodedInputData
from
'
ui/shared/logs/LogDecodedInputData
'
;
...
@@ -49,8 +48,6 @@ import useFetchTxInfo from 'ui/tx/useFetchTxInfo';
...
@@ -49,8 +48,6 @@ import useFetchTxInfo from 'ui/tx/useFetchTxInfo';
const
TxDetails
=
()
=>
{
const
TxDetails
=
()
=>
{
const
{
data
,
isLoading
,
isError
,
socketStatus
,
error
}
=
useFetchTxInfo
();
const
{
data
,
isLoading
,
isError
,
socketStatus
,
error
}
=
useFetchTxInfo
();
const
isMobile
=
useIsMobile
();
const
[
isExpanded
,
setIsExpanded
]
=
React
.
useState
(
false
);
const
[
isExpanded
,
setIsExpanded
]
=
React
.
useState
(
false
);
const
handleCutClick
=
React
.
useCallback
(()
=>
{
const
handleCutClick
=
React
.
useCallback
(()
=>
{
...
@@ -177,20 +174,7 @@ const TxDetails = () => {
...
@@ -177,20 +174,7 @@ const TxDetails = () => {
<
Text
variant=
"secondary"
>
{
getConfirmationDuration
(
data
.
confirmation_duration
)
}
</
Text
>
<
Text
variant=
"secondary"
>
{
getConfirmationDuration
(
data
.
confirmation_duration
)
}
</
Text
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
)
}
{
isMobile
?
<
DetailsSponsoredItem
/>
(
<
GridItem
>
<
AdBanner
justifyContent=
"center"
/>
</
GridItem
>
)
:
(
<
DetailsInfoItem
title=
"Sponsored"
hint=
"Sponsored banner advertisement"
>
<
AdBanner
/>
</
DetailsInfoItem
>
)
}
{
divider
}
{
divider
}
...
...
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