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

added months passed to comments

This commit is contained in:
Fedor Katurov 2022-07-15 16:45:59 +07:00
parent e9a1a624fd
commit 3dfd886570
7 changed files with 111 additions and 9 deletions

View file

@ -1,4 +1,13 @@
import React, { createElement, FC, Fragment, memo, useCallback, useMemo, useState } from 'react';
import React, {
createElement,
FC,
Fragment,
memo,
ReactNode,
useCallback,
useMemo,
useState,
} from 'react';
import classnames from 'classnames';
import classNames from 'classnames';
@ -18,6 +27,7 @@ import { CommentMenu } from '../CommentMenu';
import styles from './styles.module.scss';
interface IProps {
prefix?: ReactNode;
nodeId: number;
comment: IComment;
canEdit: boolean;
@ -27,7 +37,7 @@ interface IProps {
}
const CommentContent: FC<IProps> = memo(
({ comment, canEdit, nodeId, saveComment, onDelete, onShowImageModal }) => {
({ comment, canEdit, nodeId, saveComment, onDelete, onShowImageModal, prefix }) => {
const [isEditing, setIsEditing] = useState(false);
const startEditing = useCallback(() => setIsEditing(true), [setIsEditing]);
@ -74,8 +84,10 @@ const CommentContent: FC<IProps> = memo(
return (
<div className={styles.wrap}>
{comment.text && (
{comment.text.trim() && (
<Group className={classnames(styles.block, styles.block_text)}>
{!!prefix && <div className={styles.prefix}>{prefix}</div>}
{menu}
<Group className={styles.renderers}>