Skip to content

Commit 36640dc

Browse files
committed
feat: use generic view hooks to display reads
1 parent 4854fdc commit 36640dc

File tree

5 files changed

+10
-46
lines changed

5 files changed

+10
-46
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ yarn-error.log*
2929
/.next
3030

3131
/lib/data/
32+
33+
.vercel

lib/components/title.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { msToString } from '../data-transform'
33
import { useTheme } from '@geist-ui/react'
44
import { useRouter } from 'next/router'
55
import { Configs } from '../utils'
6-
import useViewsShow from '../use-views-show'
6+
import useViews from '@unix/views'
77

88
const DateDisplay = ({ date }) => {
99
const theme = useTheme()
1010
const { asPath } = useRouter()
11-
const [count, countUpdated] = useViewsShow(asPath)
11+
const [count, countUpdated] = useViews(asPath)
1212

1313
const d = useMemo(() => new Date(date), [])
1414
if (`${d}` === 'Invalid Date') return null

lib/use-views-show.js

Lines changed: 0 additions & 44 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@geist-ui/react": "^2.1.3",
1616
"@geist-ui/react-icons": "^1.0.1",
1717
"@geist-ui/react-prism": "^1.0.0",
18+
"@unix/views": "^0.1.3",
1819
"ms": "^2.1.2",
1920
"next": "^9.5.4",
2021
"react": "^16.13.1",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,6 +1576,11 @@
15761576
"@types/unist" "*"
15771577
"@types/vfile-message" "*"
15781578

1579+
"@unix/views@^0.1.3":
1580+
version "0.1.3"
1581+
resolved "https://registry.yarnpkg.com/@unix/views/-/views-0.1.3.tgz#1cb490169b0804cffa86736d7f028faf8e0b1464"
1582+
integrity sha512-KyonKxxRl0h8VHQvVfSNZdWxvVT+HmodhgkM19OkcnByVpAsKzkIfFx83vqJcNS3zCd4Z4slziYu4rPVJ3X3Vg==
1583+
15791584
"@webassemblyjs/ast@1.9.0":
15801585
version "1.9.0"
15811586
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"

0 commit comments

Comments
 (0)