From 1ddfc8e9a5be1aac5d344d9a95ace4e4497da709 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Fri, 16 Dec 2022 10:17:50 +0300 Subject: [PATCH] Nested comments --- src/components/Article/Comment.tsx | 214 +++++++++++----------- src/components/Article/CommentWrapper.tsx | 71 ------- src/components/Article/CommentsTree.tsx | 24 ++- 3 files changed, 122 insertions(+), 187 deletions(-) delete mode 100644 src/components/Article/CommentWrapper.tsx diff --git a/src/components/Article/Comment.tsx b/src/components/Article/Comment.tsx index 1f5411cf..89401946 100644 --- a/src/components/Article/Comment.tsx +++ b/src/components/Article/Comment.tsx @@ -1,4 +1,5 @@ import styles from './Comment.module.scss' +import type { JSX } from 'solid-js/jsx-runtime' import { Icon } from '../_shared/Icon' import { AuthorCard } from '../Author/Card' import { Show, createMemo, createSignal } from 'solid-js' @@ -12,13 +13,13 @@ import { formatDate } from '../../utils' import { SharePopup } from './SharePopup' import stylesHeader from '../Nav/Header.module.scss' import Userpic from '../Author/Userpic' -import CommentWrapper from './CommentWrapper' export default (props: { level?: number comment: Partial canEdit?: boolean compact?: boolean + children?: JSX.Element[] }) => { const [isReplyVisible, setIsReplyVisible] = createSignal(false) @@ -35,116 +36,117 @@ export default (props: { ) return ( - -
  • - - - } - > -
    -
    - -
    - -
    {formattedDate()}
    -
    0, - [styles.commentRatingNegative]: comment().stat?.rating < 0 - }} - > -
    +
  • + + + } + > +
    +
    +
    - -
    - +
    {formattedDate()}
    +
    0, + [styles.commentRatingNegative]: comment().stat?.rating < 0 + }} + > +
    +
    + + +
    + +
    + + +
    + + + + {/*FIXME implement edit comment modal*/} + {/* showModal('editComment')}*/} + {/*>*/} + {/* */} + {/* {t('Edit')}*/} + {/**/} + + + + + + {t('Share')} + + } + /> + + {/* showModal('reportComment')}*/} + {/*>*/} + {/* {t('Report')}*/} + {/**/}
    - -
    - - - - {/*FIXME implement edit comment modal*/} - {/* showModal('editComment')}*/} - {/*>*/} - {/* */} - {/* {t('Edit')}*/} - {/**/} -