Update article views in prod only

This commit is contained in:
r-freeman 2023-03-07 20:53:27 +00:00
parent 0c0c4cb758
commit fdda8ad3c3

View File

@ -1,4 +1,5 @@
import React, {ReactNode} from 'react'
import * as process from 'process'
import Head from 'next/head'
import Link from 'next/link'
import {Container} from '@/components/Container'
@ -17,6 +18,8 @@ type ArticleLayout = {
slug: string
}
const isProd = process.env.NODE_ENV === 'production'
export function ArticleLayout({
children,
isRssFeed = false,
@ -106,7 +109,7 @@ export function ArticleLayout({
<time dateTime={date}>
<span>{formatDate(date)}</span>
</time>
<Views slug={slug}/>
<Views slug={slug} shouldUpdateViews={isProd}/>
</p>
</header>
<Prose className="mt-8">{children}</Prose>