Commit bc5741ec authored by tom's avatar tom

text ad placeholder

parent a299ed56
...@@ -101,7 +101,7 @@ const AddressPageContent = () => { ...@@ -101,7 +101,7 @@ const AddressPageContent = () => {
return ( return (
<Page> <Page>
<TextAd mb={ 6 }/> { addressQuery.isLoading ? <Skeleton h={{ base: 12, lg: 6 }} mb={ 6 } w="100%" maxW="680px"/> : <TextAd mb={ 6 }/> }
{ addressQuery.isLoading ? ( { addressQuery.isLoading ? (
<Skeleton h={ 10 } w="260px" mb={ 6 }/> <Skeleton h={ 10 } w="260px" mb={ 6 }/>
) : ( ) : (
......
...@@ -143,10 +143,13 @@ const TokenPageContent = () => { ...@@ -143,10 +143,13 @@ const TokenPageContent = () => {
return ( return (
<Page> <Page>
{ tokenQuery.isLoading ? ( { tokenQuery.isLoading ? (
<Flex alignItems="center" mb={ 6 }> <>
<SkeletonCircle w={ 6 } h={ 6 } mr={ 3 }/> <Skeleton h={{ base: 12, lg: 6 }} mb={ 6 } w="100%" maxW="680px"/>
<Skeleton w="500px" h={ 10 }/> <Flex alignItems="center" mb={ 6 }>
</Flex> <SkeletonCircle w={ 6 } h={ 6 } mr={ 3 }/>
<Skeleton w="500px" h={ 10 }/>
</Flex>
</>
) : ( ) : (
<> <>
<TextAd mb={ 6 }/> <TextAd mb={ 6 }/>
......
...@@ -26,6 +26,8 @@ type AdData = { ...@@ -26,6 +26,8 @@ type AdData = {
const CoinzillaTextAd = ({ className }: {className?: string}) => { const CoinzillaTextAd = ({ className }: {className?: string}) => {
const [ adData, setAdData ] = React.useState<AdData | null>(null); const [ adData, setAdData ] = React.useState<AdData | null>(null);
const [ isLoading, setIsLoading ] = React.useState(true);
useEffect(() => { useEffect(() => {
fetch('https://request-global.czilladx.com/serve/native.php?z=19260bf627546ab7242') fetch('https://request-global.czilladx.com/serve/native.php?z=19260bf627546ab7242')
.then(res => res.status === 200 ? res.json() : null) .then(res => res.status === 200 ? res.json() : null)
...@@ -34,9 +36,16 @@ const CoinzillaTextAd = ({ className }: {className?: string}) => { ...@@ -34,9 +36,16 @@ const CoinzillaTextAd = ({ className }: {className?: string}) => {
if (data?.ad?.impressionUrl) { if (data?.ad?.impressionUrl) {
fetch(data.ad.impressionUrl); fetch(data.ad.impressionUrl);
} }
})
.finally(() => {
setIsLoading(false);
}); });
}, []); }, []);
if (isLoading) {
return <Box className={ className } h={{ base: 12, lg: 6 }}/>;
}
if (!adData) { if (!adData) {
return null; return null;
} }
...@@ -52,7 +61,7 @@ const CoinzillaTextAd = ({ className }: {className?: string}) => { ...@@ -52,7 +61,7 @@ const CoinzillaTextAd = ({ className }: {className?: string}) => {
mr={ 3 } mr={ 3 }
display={{ base: 'none', lg: 'inline' }} display={{ base: 'none', lg: 'inline' }}
> >
ADs: Ads:
</Text> </Text>
{ urlObject.hostname === 'nifty.ink' ? { urlObject.hostname === 'nifty.ink' ?
<Text as="span" mr={ 1 }>🎨</Text> : <Text as="span" mr={ 1 }>🎨</Text> :
......
...@@ -7,6 +7,7 @@ import SkeletonTabs from 'ui/shared/skeletons/SkeletonTabs'; ...@@ -7,6 +7,7 @@ import SkeletonTabs from 'ui/shared/skeletons/SkeletonTabs';
const TokenInstanceSkeleton = () => { const TokenInstanceSkeleton = () => {
return ( return (
<Box> <Box>
<Skeleton h={{ base: 12, lg: 6 }} mb={ 6 } w="100%" maxW="680px"/>
<Skeleton h={ 10 } maxW="400px" w="100%" mb={ 6 }/> <Skeleton h={ 10 } maxW="400px" w="100%" mb={ 6 }/>
<Flex align="center"> <Flex align="center">
<SkeletonCircle boxSize={ 6 } flexShrink={ 0 }/> <SkeletonCircle boxSize={ 6 } flexShrink={ 0 }/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment