Skip to content

Commit

Permalink
revert: i hate this
Browse files Browse the repository at this point in the history
  • Loading branch information
jktrn committed Nov 1, 2023
1 parent 10a7f71 commit 4db8731
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions layouts/PostSimple.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client'

import Comments from '@/components/Comments'
import Image from '@/components/Image'
import Link from '@/components/Link'
import PageTitle from '@/components/PageTitle'
Expand All @@ -13,7 +12,6 @@ import NextImage from 'next/image'
import { CoreContent } from 'pliny/utils/contentlayer'
import { formatDate } from 'pliny/utils/formatDate'
import { ReactNode, useState } from 'react'
import { Redis } from "@upstash/redis"

interface LayoutProps {
content: CoreContent<Blog>
Expand All @@ -23,13 +21,8 @@ interface LayoutProps {
prev?: { path: string; title: string }
}

const redis = Redis.fromEnv()

export const revalidate = 60

export default async function PostLayout({ content, authorDetails, next, prev, children }: LayoutProps) {
export default function PostLayout({ content, authorDetails, next, prev, children }: LayoutProps) {
const { path, slug, tags, date, title, thumbnail } = content
const views = (await redis.get<number>(["pageviews", "projects", slug].join(":"))) ?? 0;
const displayThumbnail = thumbnail ? thumbnail : '/static/images/twitter-card.png'
const [isLoading, setIsLoading] = useState(true)

Expand Down Expand Up @@ -67,14 +60,6 @@ export default async function PostLayout({ content, authorDetails, next, prev, c
<time dateTime={date}>
{formatDate(date, siteMetadata.locale)}
</time>
{views > 0 && (
<span className="ml-2">
<span className="text-primary">
{views.toLocaleString()}
</span>{" "}
views
</span>
)}
</dd>
</div>
</dl>
Expand Down

0 comments on commit 4db8731

Please sign in to comment.