From f861e6a269ba9f62700776d3cd13b644a9e836d4 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 20 Sep 2023 16:38:54 +0200 Subject: refactor: use named export for everything except pages Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements. --- src/components/organisms/layout/comment.tsx | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/components/organisms/layout/comment.tsx') diff --git a/src/components/organisms/layout/comment.tsx b/src/components/organisms/layout/comment.tsx index 23073ad..e2a42bf 100644 --- a/src/components/organisms/layout/comment.tsx +++ b/src/components/organisms/layout/comment.tsx @@ -3,12 +3,11 @@ import Script from 'next/script'; import { FC, useCallback, useState } from 'react'; import { useIntl } from 'react-intl'; import { type Comment as CommentSchema, type WithContext } from 'schema-dts'; -import { type SingleComment } from '../../../types/app'; -import useSettings from '../../../utils/hooks/use-settings'; -import Button from '../../atoms/buttons/button'; -import Link from '../../atoms/links/link'; -import Meta from '../../molecules/layout/meta'; -import CommentForm, { type CommentFormProps } from '../forms/comment-form'; +import { type SingleComment } from '../../../types'; +import { useSettings } from '../../../utils/hooks'; +import { Button, Link } from '../../atoms'; +import { Meta } from '../../molecules'; +import { CommentForm, type CommentFormProps } from '../forms'; import styles from './comment.module.scss'; export type CommentProps = Pick< @@ -27,7 +26,7 @@ export type CommentProps = Pick< * * Render a single comment. */ -const Comment: FC = ({ +export const Comment: FC = ({ approved, canReply = true, content, @@ -107,13 +106,13 @@ const Comment: FC = ({ return ( <>