From 0fcea6f9411ef09442c9faa69f3d52d0f3716d69 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 27 Sep 2022 21:10:46 +0400 Subject: [PATCH] Add partner link on devops page --- .github/workflows/deploy.yml | 2 +- components/custom-ad.tsx | 80 +++++++++++++++++++++--------------- components/footer.tsx | 3 ++ pages/[roadmap]/index.tsx | 3 +- pages/upcoming.tsx | 2 +- scripts/build.sh | 2 + styles/carbon.css | 63 ---------------------------- 7 files changed, 57 insertions(+), 98 deletions(-) delete mode 100644 styles/carbon.css diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c7973801b..825ffb15a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ jobs: persist-credentials: false - uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 16 - name: Setup Environment run: | npm install diff --git a/components/custom-ad.tsx b/components/custom-ad.tsx index 09c756d8f..b3c0d8ca9 100644 --- a/components/custom-ad.tsx +++ b/components/custom-ad.tsx @@ -1,37 +1,53 @@ +import { Box, Flex, Heading, Image, Link } from '@chakra-ui/react'; +import { getParameterByName } from '../pages/upcoming'; + +function getPageSlug() { + const pathname = (typeof window !== 'undefined' ? window : {} as any)?.location?.pathname || ''; + + return pathname?.replace(/\//g, ''); +} + export const CustomAd = () => { + const slug = getPageSlug(); + if (slug !== 'devops') { + return null; + } + + const shouldShowAd = getParameterByName('ad'); + if (!shouldShowAd) { + return null; + } + return ( -
- - - - Custom Logo - - - He Went from ZERO TO $74,000 as a Full Time Developer in 7 Weeks - - - + Custom Logo + + + Free DevOps eBook + + Learn all about doing DevOps the Cloud Native way with this free ebook from our partner, The New Stack + + + - Sponsored by - - -
+ Partner Content + + + ); }; diff --git a/components/footer.tsx b/components/footer.tsx index 83bb54aa5..25116f732 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -1,6 +1,7 @@ import { Box, Container, Flex, Image, Link, Stack, Text } from '@chakra-ui/react'; import siteConfig from '../content/site.json'; import { CustomAd } from './custom-ad'; +import React from 'react'; function NavigationLinks() { return ( @@ -62,6 +63,8 @@ export function Footer() { + + ); } diff --git a/pages/[roadmap]/index.tsx b/pages/[roadmap]/index.tsx index be19e6bef..e374f8919 100644 --- a/pages/[roadmap]/index.tsx +++ b/pages/[roadmap]/index.tsx @@ -14,7 +14,7 @@ import MdRenderer from '../../components/md-renderer'; import Helmet from '../../components/helmet'; import { RoadmapPageHeader } from '../../components/roadmap/roadmap-page-header'; import { InteractiveRoadmapRenderer } from './interactive'; -import { FreeSignUp, SIGNUP_EMAIL_INPUT_NAME, SIGNUP_FORM_ACTION } from '../signup'; +import { SIGNUP_EMAIL_INPUT_NAME, SIGNUP_FORM_ACTION } from '../signup'; import { BellIcon, EmailIcon } from '@chakra-ui/icons'; import { RelatedRoadmaps } from '../../components/related-roadmaps'; @@ -107,6 +107,7 @@ export default function Roadmap(props: RoadmapPageProps) { +