Skip to content

Commit

Permalink
added api ref and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
evisdrenova committed Nov 13, 2023
1 parent 9bf9dab commit 23adb9b
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/docs/transformers/system/email.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ hide_title: true
slug: /transformers/system/email
---

import { DocPageHeader } from '@site/src/CustomComponents/DocPageHeader.tsx';
import { TransformerPageHeader } from '@site/src/CustomComponents/TransformerPageHeader.tsx';

import { DocsTable } from '@site/src/CustomComponents/DocsTable.tsx';

<DocPageHeader title="Email" />
<TransformerPageHeader
title="Email"
type="string"
apiRef="https://github.com/nucleuscloud/neosync/blob/main/worker/internal/benthos/transformers/email.go"
/>

## Definition

Expand Down
20 changes: 20 additions & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@mdx-js/react": "^1.6.22",
"@radix-ui/react-icons": "^1.3.0",
"autoprefixer": "^10.4.16",
"class-variance-authority": "^0.7.0",
"postcss": "^8.4.31",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
Expand Down
22 changes: 22 additions & 0 deletions docs/src/CustomComponents/TransformerPageHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Link from '@docusaurus/Link';
import React from 'react';
import { Badge } from '../components/Badge';

interface Props {
title: string;
type: string;
apiRef: string;
}

export const TransformerPageHeader = (props: Props) => {
const { title, type, apiRef } = props;
return (
<div className="transformer-page-header">
<div>{title}</div>
<Badge>{type}</Badge>
<Link href={apiRef} className="flex items-center">
<Badge>API reference</Badge>
</Link>
</div>
);
};
36 changes: 36 additions & 0 deletions docs/src/components/Badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { cva, type VariantProps } from 'class-variance-authority';
import * as React from 'react';

import { cn } from '../utils';

const badgeVariants = cva(
'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
{
variants: {
variant: {
default:
'border border-gray-200 bg-gray-100 text-primary-foreground text',
secondary:
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
destructive:
'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',
outline: 'text-foreground',
},
},
defaultVariants: {
variant: 'default',
},
}
);

export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}

function Badge({ className, variant, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
);
}

export { Badge, badgeVariants };
4 changes: 4 additions & 0 deletions docs/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ this is the class for the sidebar categories that section headers
@apply flex flex-col text-left font-bold text-3xl;
}

.transformer-page-header {
@apply flex flex-row gap-4 font-bold text-3xl items-center;
}

.heroImage {
@apply py-10;
}
Expand Down

0 comments on commit 23adb9b

Please sign in to comment.