From 9921496d64cbcc97867a7fe5c623e39fdaa588b7 Mon Sep 17 00:00:00 2001 From: Juri Date: Wed, 20 Nov 2024 11:16:29 +0100 Subject: [PATCH] feat(nx-dev): update top-level navbar --- .../2024-10-25-sports-retailer-success.md | 2 +- nx-dev/nx-dev/app/blog/[slug]/page.tsx | 4 +- nx-dev/nx-dev/app/blog/page.tsx | 8 +- nx-dev/nx-dev/app/nx-cloud/page.tsx | 18 +- nx-dev/nx-dev/app/powerpack/page.tsx | 15 +- nx-dev/nx-dev/app/pricing/page.tsx | 3 +- .../lib/components/headerCtaConfigs.tsx | 41 +++ nx-dev/nx-dev/pages/customers.tsx | 3 +- nx-dev/nx-dev/pages/enterprise.tsx | 3 +- nx-dev/nx-dev/pages/index.tsx | 9 +- nx-dev/ui-cloud/src/lib/hero.tsx | 4 +- nx-dev/ui-common/src/index.ts | 4 +- nx-dev/ui-common/src/lib/button.tsx | 12 +- nx-dev/ui-common/src/lib/default-layout.tsx | 6 +- .../src/lib/headers/documentation-header.tsx | 163 +++------ nx-dev/ui-common/src/lib/headers/header.tsx | 324 ++++++------------ .../ui-common/src/lib/headers/menu-items.ts | 31 +- nx-dev/ui-common/src/lib/sidebar.tsx | 12 +- nx-dev/ui-customers/src/lib/hero.tsx | 4 +- nx-dev/ui-enterprise/src/lib/hero.tsx | 15 +- nx-dev/ui-home/src/lib/hero.tsx | 14 +- nx-dev/ui-pricing/src/lib/plans-display.tsx | 20 +- 22 files changed, 317 insertions(+), 398 deletions(-) create mode 100644 nx-dev/nx-dev/lib/components/headerCtaConfigs.tsx diff --git a/docs/blog/2024-10-25-sports-retailer-success.md b/docs/blog/2024-10-25-sports-retailer-success.md index 4248cf25ef4e6..1a9c2dacf0874 100644 --- a/docs/blog/2024-10-25-sports-retailer-success.md +++ b/docs/blog/2024-10-25-sports-retailer-success.md @@ -2,7 +2,7 @@ title: Improve your architecture and CI pipeline times with Nx projects slug: improve-architecture-and-ci-times-with-projects authors: [Philip Fulcher] -tags: [nx, enterprise] +tags: [nx, 'customer story'] cover_image: '/blog/images/2024-10-25/header.avif' pinned: true --- diff --git a/nx-dev/nx-dev/app/blog/[slug]/page.tsx b/nx-dev/nx-dev/app/blog/[slug]/page.tsx index 2ea8d7086ab17..55a5cd148beac 100644 --- a/nx-dev/nx-dev/app/blog/[slug]/page.tsx +++ b/nx-dev/nx-dev/app/blog/[slug]/page.tsx @@ -2,6 +2,7 @@ import type { Metadata, ResolvingMetadata } from 'next'; import { blogApi } from '../../../lib/blog.api'; import { BlogDetails } from '@nx/nx-dev/ui-blog'; import { DefaultLayout } from '@nx/nx-dev/ui-common'; +import { tryNxCloudForFree } from '../../../lib/components/headerCtaConfigs'; interface BlogPostDetailProps { params: { slug: string }; @@ -44,12 +45,13 @@ export async function generateStaticParams() { export default async function BlogPostDetail({ params: { slug }, }: BlogPostDetailProps) { + const ctaHeaderConfig = [tryNxCloudForFree]; const blog = await blogApi.getBlogPostBySlug(slug); return blog ? ( <> {/* This empty div is necessary as app router does not automatically scroll on route changes */}
- + diff --git a/nx-dev/nx-dev/app/blog/page.tsx b/nx-dev/nx-dev/app/blog/page.tsx index 1989174e24257..23456f5044046 100644 --- a/nx-dev/nx-dev/app/blog/page.tsx +++ b/nx-dev/nx-dev/app/blog/page.tsx @@ -3,6 +3,10 @@ import { blogApi } from '../../lib/blog.api'; import { BlogContainer } from '@nx/nx-dev/ui-blog'; import { DefaultLayout } from '@nx/nx-dev/ui-common'; import { Suspense } from 'react'; +import { + requestFreeTrial, + tryNxCloudForFree, +} from '../../lib/components/headerCtaConfigs'; export const metadata: Metadata = { title: 'Nx Blog - Updates from the Nx & Nx Cloud team', @@ -34,11 +38,13 @@ async function getBlogTags() { } export default async function BlogIndex() { + const ctaHeaderConfig = [tryNxCloudForFree]; + const blogs = await getBlogs(); const tags = await getBlogTags(); return ( - + diff --git a/nx-dev/nx-dev/app/nx-cloud/page.tsx b/nx-dev/nx-dev/app/nx-cloud/page.tsx index dccc93c360fe5..0ea2572e48cf5 100644 --- a/nx-dev/nx-dev/app/nx-cloud/page.tsx +++ b/nx-dev/nx-dev/app/nx-cloud/page.tsx @@ -9,7 +9,11 @@ import { Statistics, } from '@nx/nx-dev/ui-cloud'; -import { CallToAction, DefaultLayout } from '@nx/nx-dev/ui-common'; +import { + ButtonLinkProps, + CallToAction, + DefaultLayout, +} from '@nx/nx-dev/ui-common'; import type { Metadata } from 'next'; @@ -37,8 +41,18 @@ export const metadata: Metadata = { }; export default function NxCloudPage(): JSX.Element { + const headerCTAConfig: ButtonLinkProps[] = [ + { + href: '/pricing', + variant: 'primary', + size: 'small', + title: 'Get started for free', + children: 'Get started for free', + }, + ]; + return ( - + diff --git a/nx-dev/nx-dev/app/powerpack/page.tsx b/nx-dev/nx-dev/app/powerpack/page.tsx index 7811d81db4089..d3f157355ede9 100644 --- a/nx-dev/nx-dev/app/powerpack/page.tsx +++ b/nx-dev/nx-dev/app/powerpack/page.tsx @@ -1,10 +1,11 @@ -import { DefaultLayout } from '@nx/nx-dev/ui-common'; +import { ButtonLinkProps, DefaultLayout } from '@nx/nx-dev/ui-common'; import { CallToAction, GetStarted, Hero, PowerpackFeatures, } from '@nx/nx-dev/ui-powerpack'; +import { contactButton } from '../../lib/components/headerCtaConfigs'; import type { Metadata } from 'next'; @@ -32,8 +33,18 @@ export const metadata: Metadata = { }; export default function NxPowerPackPage(): JSX.Element { + const headerCTAConfig: ButtonLinkProps[] = [ + { + href: 'https://cloud.nx.app/powerpack/purchase?licenseBusinessType=small&utm_source=nx.dev&utm_medium=referral&utm_campaign=nx-powerpackurl', + variant: 'primary', + size: 'small', + title: 'Request a free trial', + children: 'Request a free trial', + }, + ]; + return ( - +
diff --git a/nx-dev/nx-dev/app/pricing/page.tsx b/nx-dev/nx-dev/app/pricing/page.tsx index ccea644bc7f32..e11669fd04927 100644 --- a/nx-dev/nx-dev/app/pricing/page.tsx +++ b/nx-dev/nx-dev/app/pricing/page.tsx @@ -12,6 +12,7 @@ import { Testimonials, TrustedBy, } from '@nx/nx-dev/ui-common'; +import { gotoAppButton } from '../../lib/components/headerCtaConfigs'; export const metadata: Metadata = { title: 'Nx Cloud - Available Plans', @@ -38,7 +39,7 @@ export const metadata: Metadata = { export default function PricingPage() { return ( - +
diff --git a/nx-dev/nx-dev/lib/components/headerCtaConfigs.tsx b/nx-dev/nx-dev/lib/components/headerCtaConfigs.tsx new file mode 100644 index 0000000000000..1d773b90efffc --- /dev/null +++ b/nx-dev/nx-dev/lib/components/headerCtaConfigs.tsx @@ -0,0 +1,41 @@ +import { ButtonLinkProps } from '@nx/nx-dev/ui-common'; +import { NxCloudAnimatedIcon } from '@nx/nx-dev/ui-icons'; + +export const requestFreeTrial: ButtonLinkProps = { + href: '/contact/sales', + variant: 'primary', + size: 'small', + title: 'Request a free trial', + children: 'Request a free trial', +}; + +export const tryNxCloudForFree: ButtonLinkProps = { + href: '/pricing', + variant: 'primary', + size: 'small', + title: 'Try Nx Cloud for free', + children: 'Try Nx Cloud for free', +}; + +export const gotoAppButton: ButtonLinkProps = { + href: 'https://nx.app/?utm_source=nx.dev&utm_medium=header-menu', + variant: 'secondary', + size: 'small', + target: '_blank', + title: 'Log in to your Nx Cloud Account', + children: ( + <> +