Skip to content

Commit

Permalink
feat(nx-dev): call to action button
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacplmann authored and juristr committed Nov 9, 2023
1 parent 40f54d5 commit b9e02d1
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/nx-cloud/intro/nx-cloud-workflows.md
Expand Up @@ -5,6 +5,8 @@ src="https://www.youtube.com/embed/JG1FWfZFByM"
title="Introducing Nx Cloud Workflows"
width="100%" /%}

{% call-to-action title="Sign Up for Early Access" icon="nxcloud" description="Experience Nx Cloud Workflows for yourself" url="https://cloud.nx.app/workflows-early-access" /%}

## Powerful CI Capabilities Optimized for Nx monorepos

Just like Nx and Nx Cloud, Nx Cloud Workflows enables you to offload tedious technical tasks so that you can focus on more mission-critical tasks. With a traditional CI platform, you are responsible for telling the CI platform exactly what commands to execute in which environments and what to do with the artifacts. Nx Cloud by itself can automate parallelizing tasks and sharing build artifacts across machines, but you still have to create agent machines on your CI platform.
Expand Down
4 changes: 4 additions & 0 deletions nx-dev/ui-markdoc/src/index.ts
Expand Up @@ -17,6 +17,8 @@ import { CustomLink } from './lib/nodes/link.component';
import { link } from './lib/nodes/link.schema';
import { Callout } from './lib/tags/callout.component';
import { callout } from './lib/tags/callout.schema';
import { CallToAction } from './lib/tags/call-to-action.component';
import { callToAction } from './lib/tags/call-to-action.schema';
import { Card, Cards, LinkCard } from './lib/tags/cards.component';
import { card, cards, linkCard } from './lib/tags/cards.schema';
import { GithubRepository } from './lib/tags/github-repository.component';
Expand Down Expand Up @@ -66,6 +68,7 @@ export const getMarkdocCustomConfig = (
},
tags: {
callout,
'call-to-action': callToAction,
card,
cards,
'link-card': linkCard,
Expand All @@ -90,6 +93,7 @@ export const getMarkdocCustomConfig = (
},
components: {
Callout,
CallToAction,
Card,
Cards,
LinkCard,
Expand Down
41 changes: 41 additions & 0 deletions nx-dev/ui-markdoc/src/lib/tags/call-to-action.component.tsx
@@ -0,0 +1,41 @@
import { ChevronRightIcon } from '@heroicons/react/24/outline';
import { frameworkIcons } from '../icons';

export function CallToAction({
url,
title,
description,
icon = 'nx',
}: {
url: string;
title: string;
description?: string;
icon?: string;
}): JSX.Element {
return (
<div className="not-prose group relative my-12 mx-auto flex w-full max-w-md items-center gap-3 overflow-hidden rounded-lg bg-slate-50 shadow-md transition hover:text-white dark:bg-slate-800/60">
<div className="absolute inset-0 z-0 w-2 bg-blue-500 transition-all duration-150 group-hover:w-full dark:bg-sky-500"></div>
<div className="w-2 bg-blue-500 dark:bg-sky-500"></div>

<div className="z-10 flex flex-grow items-center py-3">
<div className="h-10 w-10">{icon && frameworkIcons[icon]?.image}</div>

<div className="mx-3">
<p>
{title}
<a
href={url}
target="_blank"
rel="noreferrer"
className="block text-sm font-medium opacity-80"
>
<span className="absolute inset-0" aria-hidden="true"></span>
{description || ''}
</a>
</p>
</div>
</div>
<ChevronRightIcon className="mr-4 h-6 w-6 transition-all group-hover:translate-x-3" />
</div>
);
}
29 changes: 29 additions & 0 deletions nx-dev/ui-markdoc/src/lib/tags/call-to-action.schema.ts
@@ -0,0 +1,29 @@
import { Schema } from '@markdoc/markdoc';

export const callToAction: Schema = {
// 'Display content in a large button.',
render: 'CallToAction',
attributes: {
url: {
// 'The url to link to',
type: 'String',
required: true,
},
title: {
// 'Title of the call to action',
type: 'String',
required: true,
},
description: {
// 'Description of the call to action. Defaults to an empty string',
type: 'String',
required: false,
},
icon: {
// 'Icon displayed to the left of the call to actions. Defaults to the Nx icon',
// Choose from the list in nx-dev/ui-markdoc/src/lib/icons.tsx
type: 'String',
required: false,
},
},
};

1 comment on commit b9e02d1

@vercel
Copy link

@vercel vercel bot commented on b9e02d1 Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app

Please sign in to comment.