Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

use markdown

Kiran K6f1c83e8c4c4
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx
index 3504f693c8..f4beca1d89 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx
@@ -12,10 +12,10 @@ import { IntegrationGuide } from "./types";
interface GuideProps {
selectedGuide: IntegrationGuide;
- guideContent: string | null;
+ markdown: string | null;
}
-export function Guide({ selectedGuide, guideContent }: GuideProps) {
+export function Guide({ selectedGuide, markdown }: GuideProps) {
const router = useRouter();
const [hasSubmitted, setHasSubmitted] = useState(false);
const { id: workspaceId, slug: workspaceSlug, mutate } = useWorkspace();
@@ -77,9 +77,7 @@ export function Guide({ selectedGuide, guideContent }: GuideProps) {
</div>
<div className="mb-8 rounded-2xl bg-neutral-100">
- {guideContent && (
- <Markdown className="p-6">{guideContent}</Markdown>
- )}
+ {markdown && <Markdown className="p-6">{markdown}</Markdown>}
</div>
<div className="flex flex-col gap-2">
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx
index 01aca07803..2e7da11d79 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page-client.tsx
@@ -8,10 +8,10 @@ import { GuideList } from "./guide-list";
import { IntegrationGuide } from "./types";
interface PageClientProps {
- guideContent: string | null;
+ markdown: string | null;
}
-export function PageClient({ guideContent }: PageClientProps) {
+export function PageClient({ markdown }: PageClientProps) {
const searchParams = useSearchParams();
const [selectedGuide, setSelectedGuide] = useState<IntegrationGuide | null>(
null,
@@ -43,7 +43,7 @@ export function PageClient({ guideContent }: PageClientProps) {
<div>
{selectedGuide ? (
- <Guide selectedGuide={selectedGuide} guideContent={guideContent} />
+ <Guide selectedGuide={selectedGuide} markdown={markdown} />
) : (
<GuideList />
)}
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx
index 43f42c48d8..da9e65b846 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/page.tsx
@@ -6,7 +6,7 @@ import { guides } from "./constants";
import { PageClient } from "./page-client";
import { IntegrationGuide } from "./types";
-function getGuideContent(guideKey: string): string | null {
+function getMarkdown(guideKey: string): string | null {
const markdownPath = join(process.cwd(), "markdown", `${guideKey}.md`);
try {
@@ -26,7 +26,7 @@ export default async function Page({
}) {
let { guide } = searchParams;
let selectedGuide: IntegrationGuide | null = null;
- let content: string | null = null;
+ let markdown: string | null = null;
if (guide) {
selectedGuide = guides.find((g) => g.key === guide.toLowerCase()) ?? null;
@@ -35,16 +35,16 @@ export default async function Page({
notFound();
}
- content = getGuideContent(selectedGuide.key);
+ markdown = getMarkdown(selectedGuide.key);
- if (!content) {
+ if (!markdown) {
notFound();
}
}
return (
<StepPage title="Connecting Dub">
- <PageClient guideContent={content} />
+ <PageClient markdown={markdown} />
</StepPage>
);
}