1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

refactor main components and IProps

This commit is contained in:
Fedor Katurov 2023-11-22 19:59:17 +06:00
parent 85a182c053
commit efbaf13151
124 changed files with 235 additions and 256 deletions

View file

@ -2,12 +2,12 @@ import { FC, useMemo } from 'react';
import { CornerMenu } from '~/components/menu/CornerMenu';
interface IProps {
interface Props {
onEdit: () => void;
onDelete: () => void;
}
const CommentMenu: FC<IProps> = ({ onEdit, onDelete }) => {
const CommentMenu: FC<Props> = ({ onEdit, onDelete }) => {
const actions = useMemo(
() => [
{

View file

@ -8,9 +8,9 @@ import { formatText } from '~/utils/dom';
import styles from './styles.module.scss';
interface IProps extends ICommentBlockProps {}
interface Props extends ICommentBlockProps {}
const CommentTextBlock: FC<IProps> = ({ block }) => {
const CommentTextBlock: FC<Props> = ({ block }) => {
const content = useMemo(() => formatText(block.content), [block.content]);
return (

View file

@ -24,7 +24,7 @@ import { CommentMenu } from './components/CommentMenu';
import { COMMENT_BLOCK_RENDERERS } from './constants';
import styles from './styles.module.scss';
interface IProps {
interface Props {
prefix?: ReactNode;
nodeId: number;
comment: IComment;
@ -36,7 +36,7 @@ interface IProps {
onShowImageModal: (images: IFile[], index: number) => void;
}
const CommentContent: FC<IProps> = memo(
const CommentContent: FC<Props> = memo(
({
comment,
nodeId,

View file

@ -14,11 +14,11 @@ import { canEditComment, canLikeComment } from '~/utils/node';
import styles from './styles.module.scss';
interface IProps {
interface Props {
order: 'ASC' | 'DESC';
}
const NodeComments: FC<IProps> = observer(({ order }) => {
const NodeComments: FC<Props> = observer(({ order }) => {
const user = useUserContext();
const { node } = useNodeContext();