From 6bb24fc86946ebf46d58c7b635d0895aed9081f5 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 15 Oct 2019 17:58:14 +0700 Subject: [PATCH] hiding comment author on mobile --- src/components/containers/CommentWrapper/styles.scss | 7 +++++++ src/utils/dom.ts | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/containers/CommentWrapper/styles.scss b/src/components/containers/CommentWrapper/styles.scss index 23988d3f..42897f16 100644 --- a/src/components/containers/CommentWrapper/styles.scss +++ b/src/components/containers/CommentWrapper/styles.scss @@ -23,6 +23,13 @@ .text { flex: 1; min-width: 0; + + @include tablet { + :global(.comment-author) { + display: none !important; + color: red; + } + } } .thumb { diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 62649a81..00ed1461 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -77,7 +77,9 @@ export const formatCommentText = (author, text: string) => .replace(/:\|--\|/gim, '://') .split('\n') .map((el, index) => - index === 0 ? `${author ? `

${author}: ` : ''}${el}

` : `

${el}

` + index === 0 + ? `${author ? `

${author}: ` : ''}${el}

` + : `

${el}

` ) .join(''); // .replace(/\/\*(\*(?!\/)|[^*])*\*\//igm, '');