* add invite link and toaster to zapier setup page * create env variable for invite link and save in database * fetch invite link form getStaticProps * add getStaticPath method * clean code * Moves app setup and index page * Moves Loader to ui * Trying new way to handle dynamic app store pages * Cleanup * Update tailwind.config.js * zapier invite link fixes * Tests fixes Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars <zomars@me.com>
21 lines
545 B
TypeScript
21 lines
545 B
TypeScript
import { GetStaticPropsContext } from "next";
|
|
|
|
import getAppKeysFromSlug from "../../../_utils/getAppKeysFromSlug";
|
|
|
|
export interface IZapierSetupProps {
|
|
inviteLink: string;
|
|
}
|
|
|
|
export const getStaticProps = async (ctx: GetStaticPropsContext) => {
|
|
if (typeof ctx.params?.slug !== "string") return { notFound: true } as const;
|
|
let inviteLink = "";
|
|
const appKeys = await getAppKeysFromSlug("zapier");
|
|
if (typeof appKeys.invite_link === "string") inviteLink = appKeys.invite_link;
|
|
|
|
return {
|
|
props: {
|
|
inviteLink,
|
|
},
|
|
};
|
|
};
|