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