diff --git a/generator/konfig-docs/src/components/SdkNew.tsx b/generator/konfig-docs/src/components/SdkNew.tsx index 3a5902932..aefef7e74 100644 --- a/generator/konfig-docs/src/components/SdkNew.tsx +++ b/generator/konfig-docs/src/components/SdkNew.tsx @@ -6,26 +6,26 @@ * For an explanation of the new pSEO page, see the ticket here: * https://www.notion.so/konfigthis/Restructure-pSEO-pages-based-on-Zapier-5ff64f53351a4ae2bf728e338b56e57d?pvs=4 */ -import React, { useEffect, useState } from 'react' -import { Sdk, SdkMethod } from './Sdk' -import Layout from '@theme/Layout' -import Head from '@docusaurus/Head' +import React, { useEffect, useState } from "react"; +import { Sdk, SdkMethod } from "./Sdk"; +import Layout from "@theme/Layout"; +import Head from "@docusaurus/Head"; import { IconArrowsDownUp, IconExternalLink, IconPencil, -} from '@tabler/icons-react' -import { TsIcon } from './TsIcon' -import { useSdkSignup } from '../util/use-sdk-signup' -import clsx from 'clsx' -import { LoadingIcon } from './LoadingIcon' -import { Method } from './SdkComponentProps' -import { Breadcrumbs } from './Breadcrumbs' -import { LogoBox } from './LogoBox' -import useContentLoaded from '../util/use-content-loaded' -import { HowKonfigWorks } from './HowKonfigWorks' +} from "@tabler/icons-react"; +import { TsIcon } from "./TsIcon"; +import { useSdkSignup } from "../util/use-sdk-signup"; +import clsx from "clsx"; +import { LoadingIcon } from "./LoadingIcon"; +import { Method } from "./SdkComponentProps"; +import { Breadcrumbs } from "./Breadcrumbs"; +import { LogoBox } from "./LogoBox"; +import useContentLoaded from "../util/use-content-loaded"; +import { HowKonfigWorks } from "./HowKonfigWorks"; -type InputPropsFromOriginalSdkComponent = React.ComponentProps +type InputPropsFromOriginalSdkComponent = React.ComponentProps; export function SdkNew({ serviceName, @@ -45,17 +45,17 @@ export function SdkNew({ companyKebabCase, }: InputPropsFromOriginalSdkComponent) { const serviceNameSubstring = - serviceName !== undefined ? ` ${serviceName}` : '' - const description = `Explore the ${company}${serviceNameSubstring} TypeScript SDK. Discover SDK ${methods.length} methods to integrate ${company}'s${serviceNameSubstring} API into your application.` + serviceName !== undefined ? ` ${serviceName}` : ""; + const description = `Explore the ${company}${serviceNameSubstring} TypeScript SDK. Discover SDK ${methods.length} methods to integrate ${company}'s${serviceNameSubstring} API into your application.`; if (FirstRequest === undefined) { throw new Error( - "FirstRequest is required for the SdkNew component. It is used to render the 'MakeYourFirstRequest' section.", - ) + "FirstRequest is required for the SdkNew component. It is used to render the 'MakeYourFirstRequest' section." + ); } if (categories === undefined) { - throw new Error('categories is required for the SdkNew component') + throw new Error("categories is required for the SdkNew component"); } - const title = `Integrate ${company}'s${serviceNameSubstring} API using Konfig's ${language} SDK` + const title = `Integrate ${company}'s${serviceNameSubstring} API using Konfig's ${language} SDK`; /* Easily Integrate
@@ -117,7 +117,7 @@ Easily Integrate serviceNameSubString={serviceNameSubstring} /> - ) + ); } function BottomCTA({ @@ -126,10 +126,10 @@ function BottomCTA({ serviceName, serviceNameSubString, }: { - company: string - language: string - serviceName?: string - serviceNameSubString?: string + company: string; + language: string; + serviceName?: string; + serviceNameSubString?: string; }) { return (
@@ -145,7 +145,7 @@ function BottomCTA({ doNotShowQuestion />
- ) + ); } export function AboutCompany({ @@ -157,13 +157,13 @@ export function AboutCompany({ openApiGitHubUi, developerDocumentation, }: { - company: string - logo: string - metaDescription: string - homepage: string - categories: string[] - openApiGitHubUi?: string - developerDocumentation?: string + company: string; + logo: string; + metaDescription: string; + homepage: string; + categories: string[]; + openApiGitHubUi?: string; + developerDocumentation?: string; }) { return (
@@ -178,10 +178,10 @@ export function AboutCompany({

About {company}

{metaDescription}

-
+
{openApiGitHubUi && ( - + )} {developerDocumentation && ( {category} - ) + ); })}
- ) + ); } function ExternalLinkButton({ url, label }: { url: string; label: string }) { - const withHttps = url.startsWith('https://') ? url : `https://${url}` - const withoutHttps = label.startsWith('https://') ? label.slice(8) : label + const withHttps = url.startsWith("https://") ? url : `https://${url}`; + const withoutHttps = label.startsWith("https://") ? label.slice(8) : label; return ( - + - ) + ); } function MakeYourFirstRequest({ @@ -231,17 +235,17 @@ function MakeYourFirstRequest({ methods, clientNameCamelCase, }: { - GettingStarted: React.ComponentType - FirstRequest: React.ComponentType - company: string - serviceNameSubstring?: string - language: string - methods: Method[] - clientNameCamelCase: string + GettingStarted: React.ComponentType; + FirstRequest: React.ComponentType; + company: string; + serviceNameSubstring?: string; + language: string; + methods: Method[]; + clientNameCamelCase: string; }) { - const [amountToShow, setAmountToShow] = useState(6) - const numberOfMethods = methods.length - methods = methods.slice(0, amountToShow) + const [amountToShow, setAmountToShow] = useState(6); + const numberOfMethods = methods.length; + methods = methods.slice(0, amountToShow); return (

@@ -273,12 +277,12 @@ function MakeYourFirstRequest({
- ) + ); })}

- ) + ); } function TrustedBy() { @@ -315,7 +319,7 @@ function TrustedBy() { - ) + ); } function HeroSection({ @@ -325,16 +329,16 @@ function HeroSection({ serviceName, logo, }: { - language: string - company: string - serviceName?: string - serviceNameSubstring?: string - logo: string + language: string; + company: string; + serviceName?: string; + serviceNameSubstring?: string; + logo: string; }) { - const [showGraphic, setShowGraphic] = useState(false) + const [showGraphic, setShowGraphic] = useState(false); useContentLoaded(() => { - setShowGraphic(true) - }) + setShowGraphic(true); + }); return (
@@ -343,9 +347,9 @@ function HeroSection({ Easily Integrate
- {' '} - {company}'s{serviceNameSubstring} API{' '} - {' '} + {" "} + {company}'s{serviceNameSubstring} API{" "} + {" "} using Konfig's {language} SDK
- ) + ); } function SignupForm({ @@ -389,25 +393,19 @@ function SignupForm({ doNotShowQuestion, bottomCTA, }: { - company: string - serviceName?: string - language: string - serviceNameSubString?: string - doNotShowQuestion?: boolean - bottomCTA?: boolean + company: string; + serviceName?: string; + language: string; + serviceNameSubString?: string; + doNotShowQuestion?: boolean; + bottomCTA?: boolean; }) { - const { - setEmail, - signedUp, - signedUpEmail, - loading, - handleSubmit, - email, - } = useSdkSignup({ - company, - serviceName, - language, - }) + const { setEmail, signedUp, signedUpEmail, loading, handleSubmit, email } = + useSdkSignup({ + company, + serviceName, + language, + }); return (
{signedUp @@ -442,7 +440,7 @@ function SignupForm({ data-bottom={bottomCTA} className="mb-0 data-[bottom=true]:text-white" > - For inquiries or support, please contact us at{' '} + For inquiries or support, please contact us at{" "} - ) + ); }