Updated isProduction function

This commit is contained in:
Elio Struyf
2021-09-08 10:01:36 +02:00
parent cdc49c09f1
commit 3941c33b1d
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import Link from 'next/link';
import { Extension } from '../../constants/extension';
import { useRouter } from 'next/router';
import { Searchbox } from '../Page/Searchbox';
import { publicUrl } from '../../lib/publicUrl';
import { isProduction } from '../../helpers/isProduction';
export interface INavigationProps {}
@@ -15,7 +15,7 @@ export const Navigation: React.FunctionComponent<INavigationProps> = (props: Rea
return (
<>
{
process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production' ? (
!isProduction() ? (
<div className={`bg-yellow-500 text-center py-2 px-4`}>
<a href={`https://frontmatter.codes`} title={`Go to main release documentation`} className={`text-base font-medium text-vulcan-500 hover:text-vulcan-900`}>
You are currently viewing the BETA version of Front Matter documentation. Click on the banner to go to the main release documentation.
+2 -2
View File
@@ -24,8 +24,8 @@ export const CTA: React.FunctionComponent<ICTAProps> = (props: React.PropsWithCh
<div className="mt-10 max-w-sm mx-auto sm:max-w-none">
<div className="space-y-4 sm:space-y-0 sm:mx-auto sm:inline-grid sm:grid-cols-2 sm:gap-5">
<a href={isProduction ? Extension.installLink : Extension.installBetaLink} className="flex items-center justify-center px-4 py-3 border border-transparent text-base font-medium shadow-sm text-white bg-teal-500 hover:bg-opacity-70 sm:px-8" rel={`noopener noreferrer`}>
{isProduction ? strings(`cta_button_primary`) : strings(`cta_button_beta_primary`)}
<a href={isProduction() ? Extension.installLink : Extension.installBetaLink} className="flex items-center justify-center px-4 py-3 border border-transparent text-base font-medium shadow-sm text-white bg-teal-500 hover:bg-opacity-70 sm:px-8" rel={`noopener noreferrer`}>
{isProduction() ? strings(`cta_button_primary`) : strings(`cta_button_beta_primary`)}
</a>
<a href={`/docs`} title={`Read our documentation`} className="flex items-center justify-center px-4 py-3 border border-transparent text-base font-medium shadow-sm text-vulcan-500 bg-whisper-500 hover:bg-opacity-70 sm:px-8">
{strings(`cta_button_secondary`)}
+1 -1
View File
@@ -1,3 +1,3 @@
export const isProduction = process.env.NODE_ENV === 'production';
export const isProduction = () => process.env.NEXT_PUBLIC_VERCEL_ENV === 'production';