1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-02-23 19:13:19 +01:00

69 lines
2.2 KiB
TypeScript
Raw Normal View History

2022-09-27 21:10:46 +04:00
import { Box, Flex, Heading, Image, Link } from '@chakra-ui/react';
2022-09-28 10:22:48 +04:00
import { event } from '../lib/gtag';
2022-09-27 21:10:46 +04:00
function getPageSlug() {
const pathname = (typeof window !== 'undefined' ? window : {} as any)?.location?.pathname || '';
return pathname?.replace(/\//g, '');
}
2021-09-05 18:46:38 +02:00
export const CustomAd = () => {
2022-09-27 21:10:46 +04:00
const slug = getPageSlug();
if (slug !== 'devops') {
return null;
}
2021-09-05 18:46:38 +02:00
return (
2022-09-28 10:22:48 +04:00
<Link
2022-11-15 16:46:32 +04:00
href='https://www.stormforge.io/ebook/getting-started-kubernetes-resource-management-optimization/?utm_medium=referral&utm_source=roadmap-sh&utm_campaign=ebook_get-started-k8s-resource-mgmt'
2022-09-28 10:22:48 +04:00
id='custom-ad'
pos='fixed'
bottom='15px'
right='20px'
zIndex={999}
2022-11-15 16:46:32 +04:00
display='flex'
2022-09-28 10:22:48 +04:00
maxWidth='330px'
bg='white'
boxShadow='0 1px 4px 1px hsla(0, 0%, 0%, .1)'
_hover={{ textDecoration: 'none' }}
rel="noopener sponsored"
target={'_blank'}
onClick={() => {
event({
category: 'SponsorClick',
2022-11-15 16:46:32 +04:00
action: `StormForge EBook Redirect`,
label: `Clicked StormForge EBook Link`
2022-09-28 10:22:48 +04:00
});
}}
>
2022-09-27 21:10:46 +04:00
<Image
2022-11-15 16:46:32 +04:00
src='https://i.imgur.com/uNJWl4L.png'
2022-09-27 21:10:46 +04:00
alt='Custom Logo'
height={['100px', '100px', '100px', 'auto']}
width='130'
style={{ maxWidth: '130px', border: 'none' }}
/>
<Flex as='span' flexDirection='column' justifyContent='space-between'>
<Box as='span' p='10px'>
2022-11-15 16:46:32 +04:00
<Heading as='span' fontSize='14px' mb='5px' display='block'>Free Kubernetes eBook</Heading>
2022-09-27 21:10:46 +04:00
<Box display='block' as='span' fontSize='13px' lineHeight={1.5} fontWeight={500} color='gray.500'>
2022-11-15 16:46:32 +04:00
Learn how to manage and optimize Kubernetes resources with this free eBook.
2022-09-27 21:10:46 +04:00
</Box>
</Box>
<Box as='span'
textAlign='center'
fontWeight={600}
fontSize='9px'
letterSpacing='0.5px'
textTransform='uppercase'
padding='5px 10px'
display={'block'}
background='repeating-linear-gradient(-45deg, transparent, transparent 5px, hsla(0, 0%, 0%, .025) 5px, hsla(0, 0%, 0%, .025) 10px) hsla(203, 11%, 95%, .4)'
2021-09-05 18:46:38 +02:00
>
2022-09-27 21:10:46 +04:00
Partner Content
</Box>
</Flex>
</Link>
2021-09-05 18:46:38 +02:00
);
};