Skip to content

Commit

Permalink
Merge pull request #276 from k35o/aaaa
Browse files Browse the repository at this point in the history
ちょっとした修正
  • Loading branch information
k35o authored Sep 21, 2024
2 parents 15760d3 + d73890b commit 0513c1f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"format": "prettier --write src/",
"format:check": "prettier --check src/",
"type-check": "tsc --noEmit",
"storybook": "storybook dev -p 6006",
"storybook": "storybook dev -p 6006 --no-open",
"build-storybook": "storybook build",
"test": "TZ=UTC vitest",
"test:ui": "TZ=UTC vitest --ui",
Expand Down
4 changes: 2 additions & 2 deletions src/app/blog/_components/blog-layout/blog-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { formatDate } from '@/utils/date/format';
import { Calendar, Eye } from 'lucide-react';
import { FC, ReactNode, Suspense } from 'react';
import { ViewCoounter } from '../view-counter';
import { ViewCounter } from '../view-counter';
import { Slug } from '../../_types';
import { ErrorBoundary } from 'react-error-boundary';

Expand All @@ -18,7 +18,7 @@ export const BlogLayout: FC<{
<Suspense fallback={<></>}>
<div className="flex items-center gap-1">
<Eye className="size-4" />
<ViewCoounter slug={slug} />
<ViewCounter slug={slug} />
</div>
</Suspense>
</ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import type { Meta, StoryObj } from '@storybook/react';
import { ViewCoounter } from './view-counter';
import { ViewCounter } from './view-counter';
import { kv } from '#src/mocks/vercel-kv.mock';

const meta: Meta<typeof ViewCoounter> = {
const meta: Meta<typeof ViewCounter> = {
title: 'app/blog/view-counter',
component: ViewCoounter,
component: ViewCounter,
beforeEach: () => {
kv.incr.mockResolvedValue(74931);
},
};

export default meta;
type Story = StoryObj<typeof ViewCoounter>;
type Story = StoryObj<typeof ViewCounter>;

export const Primary: Story = {
args: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/blog/_components/view-counter/view-counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { kv } from '#vercel/kv';
import { commalize } from '@/utils/number/commalize';
import { Slug } from '../../_types';

export const ViewCoounter: FC<{ slug: Slug }> = async ({ slug }) => {
export const ViewCounter: FC<{ slug: Slug }> = async ({ slug }) => {
const views = await kv.incr(`views-${slug}`);
return <span>{commalize(views)}</span>;
};

0 comments on commit 0513c1f

Please sign in to comment.