aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/molecules/card/card.stories.tsx6
-rw-r--r--src/utils/hooks/use-article.ts (renamed from src/utils/hooks/use-article.tsx)5
-rw-r--r--src/utils/hooks/use-comments.ts (renamed from src/utils/hooks/use-comments.tsx)4
3 files changed, 9 insertions, 6 deletions
diff --git a/src/components/molecules/card/card.stories.tsx b/src/components/molecules/card/card.stories.tsx
index 74f426c..bc9cbd4 100644
--- a/src/components/molecules/card/card.stories.tsx
+++ b/src/components/molecules/card/card.stories.tsx
@@ -1,4 +1,4 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import type { ComponentMeta, Story } from '@storybook/react';
import NextImage from 'next/image';
import { Button, ButtonLink, Link, Time } from '../../atoms';
import { Card, type CardProps } from './card';
@@ -19,7 +19,9 @@ export default {
argTypes: {},
} as ComponentMeta<typeof Card>;
-const Template: ComponentStory<typeof Card> = <T extends string | undefined>(
+const Template: Story<CardProps<string | undefined>> = <
+ T extends string | undefined,
+>(
args: CardProps<T>
) => <Card {...args} />;
diff --git a/src/utils/hooks/use-article.tsx b/src/utils/hooks/use-article.ts
index 86d8e38..5cf0e51 100644
--- a/src/utils/hooks/use-article.tsx
+++ b/src/utils/hooks/use-article.ts
@@ -4,7 +4,7 @@ import {
fetchAPI,
getArticleFromRawData,
} from '../../services/graphql';
-import { type Article, type RawArticle } from '../../types';
+import type { Article, RawArticle } from '../../types';
export type UseArticleConfig = {
/**
@@ -29,7 +29,8 @@ export const useArticle = ({
}: UseArticleConfig): Article | undefined => {
const { data } = useSWR(
slug ? { query: articleBySlugQuery, variables: { slug } } : null,
- fetchAPI<RawArticle, typeof articleBySlugQuery>
+ fetchAPI<RawArticle, typeof articleBySlugQuery>,
+ {}
);
return data ? getArticleFromRawData(data.post) : fallback;
diff --git a/src/utils/hooks/use-comments.tsx b/src/utils/hooks/use-comments.ts
index 6ac3d42..ac723e9 100644
--- a/src/utils/hooks/use-comments.tsx
+++ b/src/utils/hooks/use-comments.ts
@@ -1,6 +1,6 @@
import useSWR from 'swr';
import { getAllComments } from '../../services/graphql';
-import { SingleComment } from '../../types';
+import type { SingleComment } from '../../types';
export type UseCommentsConfig = {
contentId?: string | number;
@@ -17,7 +17,7 @@ export const useComments = ({
contentId,
fallback,
}: UseCommentsConfig): SingleComment[] | undefined => {
- const { data } = useSWR(contentId ? { contentId } : null, getAllComments);
+ const { data } = useSWR(contentId ? { contentId } : null, getAllComments, {});
return data ?? fallback;
};