-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove unused funcitons, rewrite homepage route to use draft mode
- Loading branch information
Showing
4 changed files
with
5 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,5 @@ | ||
import { getCookie } from "cookies-next"; | ||
import { GetStaticPropsContext, PreviewData } from "next"; | ||
|
||
import { defaultCookieOptions, envIdCookieName, previewApiKeyCookieName } from "../constants/cookies"; | ||
import { defaultEnvId } from "./env"; | ||
|
||
export const getEnvIdFromRouteParams = (context: GetStaticPropsContext): string => { | ||
const envId = context.params?.envId; | ||
const isEnvIdPresent = typeof envId === "string"; | ||
if (!isEnvIdPresent) { | ||
console.warn("No envId in the route. Falling back to envId from the environment variable.") | ||
} | ||
|
||
return isEnvIdPresent ? envId : defaultEnvId; | ||
} | ||
|
||
export const getPreviewApiKeyFromPreviewData = (previewData: PreviewData | undefined) => | ||
previewData && typeof previewData === 'object' && previewApiKeyCookieName in previewData | ||
? previewData.currentPreviewApiKey as string | ||
: undefined; | ||
import { defaultCookieOptions, envIdCookieName } from "../constants/cookies"; | ||
|
||
export const getEnvIdFromCookie = () => getCookie(envIdCookieName, defaultCookieOptions); |
This file was deleted.
Oops, something went wrong.