mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-11 18:45:41 +00:00
Update article views in prod only
This commit is contained in:
parent
0c0c4cb758
commit
fdda8ad3c3
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user