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
a822cf51
Commit
a822cf51
authored
Apr 14, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skeleton for ad
parent
dde2cfc5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
DetailsSponsoredItem.tsx
ui/shared/DetailsSponsoredItem.tsx
+10
-4
AdBanner.tsx
ui/shared/ad/AdBanner.tsx
+4
-4
CoinzillaTextAd.tsx
ui/shared/ad/CoinzillaTextAd.tsx
+2
-2
TokenDetails.tsx
ui/token/TokenDetails.tsx
+1
-1
No files found.
ui/shared/DetailsSponsoredItem.tsx
View file @
a822cf51
...
...
@@ -3,21 +3,26 @@ import React from 'react';
import
*
as
cookies
from
'
lib/cookies
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
isSelfHosted
from
'
lib/isSelfHosted
'
;
import
AdBanner
from
'
ui/shared/ad/AdBanner
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
const
DetailsSponsoredItem
=
()
=>
{
interface
Props
{
isLoading
?:
boolean
;
}
const
DetailsSponsoredItem
=
({
isLoading
}:
Props
)
=>
{
const
isMobile
=
useIsMobile
();
const
hasAdblockCookie
=
cookies
.
get
(
cookies
.
NAMES
.
ADBLOCK_DETECTED
);
if
(
hasAdblockCookie
)
{
if
(
!
isSelfHosted
()
||
hasAdblockCookie
)
{
return
null
;
}
if
(
isMobile
)
{
return
(
<
GridItem
mt=
{
5
}
>
<
AdBanner
justifyContent=
"center"
/>
<
AdBanner
justifyContent=
"center"
isLoading=
{
isLoading
}
/>
</
GridItem
>
);
}
...
...
@@ -26,8 +31,9 @@ const DetailsSponsoredItem = () => {
<
DetailsInfoItem
title=
"Sponsored"
hint=
"Sponsored banner advertisement"
isLoading=
{
isLoading
}
>
<
AdBanner
/>
<
AdBanner
isLoading=
{
isLoading
}
/>
</
DetailsInfoItem
>
);
};
...
...
ui/shared/ad/AdBanner.tsx
View file @
a822cf51
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
{
chakra
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
appConfig
from
'
configs/app/config
'
;
...
...
@@ -9,7 +9,7 @@ import isSelfHosted from 'lib/isSelfHosted';
import
AdbutlerBanner
from
'
./AdbutlerBanner
'
;
import
CoinzillaBanner
from
'
./CoinzillaBanner
'
;
const
AdBanner
=
({
className
}:
{
className
?:
string
})
=>
{
const
AdBanner
=
({
className
,
isLoading
}:
{
className
?:
string
;
isLoading
?:
boolean
})
=>
{
const
hasAdblockCookie
=
cookies
.
get
(
cookies
.
NAMES
.
ADBLOCK_DETECTED
,
useAppContext
().
cookies
);
if
(
!
isSelfHosted
()
||
hasAdblockCookie
)
{
...
...
@@ -17,10 +17,10 @@ const AdBanner = ({ className }: { className?: string }) => {
}
if
(
appConfig
.
ad
.
adButlerOn
)
{
return
<
AdbutlerBanner
className=
{
className
}
/
>;
return
<
Skeleton
className=
{
className
}
isLoaded=
{
!
isLoading
}
borderRadius=
"none"
><
AdbutlerBanner
className=
{
className
}
/></
Skeleton
>;
}
return
<
CoinzillaBanner
className=
{
className
}
/
>;
return
<
Skeleton
className=
{
className
}
isLoaded=
{
!
isLoading
}
borderRadius=
"none"
><
CoinzillaBanner
className=
{
className
}
/></
Skeleton
>;
};
export
default
chakra
(
AdBanner
);
ui/shared/ad/CoinzillaTextAd.tsx
View file @
a822cf51
import
{
Box
,
Image
,
Link
,
Text
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Image
,
Link
,
Text
,
chakra
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useEffect
}
from
'
react
'
;
import
{
useAppContext
}
from
'
lib/appContext
'
;
...
...
@@ -55,7 +55,7 @@ const CoinzillaTextAd = ({ className }: {className?: string}) => {
}
if
(
isLoading
)
{
return
<
Box
className=
{
className
}
h=
{
{
base
:
12
,
lg
:
6
}
}
/>;
return
<
Skeleton
className=
{
className
}
h=
{
{
base
:
12
,
lg
:
6
}
}
maxW=
"1000px"
/>;
}
if
(
!
adData
)
{
...
...
ui/token/TokenDetails.tsx
View file @
a822cf51
...
...
@@ -149,7 +149,7 @@ const TokenDetails = ({ tokenQuery }: Props) => {
</
Skeleton
>
</
DetailsInfoItem
>
)
}
<
DetailsSponsoredItem
/>
<
DetailsSponsoredItem
isLoading=
{
tokenCountersQuery
.
isPlaceholderData
}
/>
</
Grid
>
);
};
...
...
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