From 0a6271c57e49ddd79b92e38e4cda2b5622ab4826 Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Wed, 29 Mar 2023 23:18:25 +0300 Subject: [PATCH 1/2] Fixed article controls style --- src/components/Article/Article.module.scss | 25 +++++++++++++++++----- src/components/Article/FullArticle.tsx | 20 +++++++++++------ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/components/Article/Article.module.scss b/src/components/Article/Article.module.scss index abdd02e7..6705a228 100644 --- a/src/components/Article/Article.module.scss +++ b/src/components/Article/Article.module.scss @@ -143,8 +143,8 @@ img { } .shoutStatsItem { + cursor: pointer; @include font-size(1.5rem); - font-weight: 500; display: inline-block; margin: 0 3.2rem 1em 0; @@ -166,17 +166,32 @@ img { max-height: 1.8em; } + .shoutStatsItemInner .iconEdit { + margin-right: 0.3em; + } + img { display: block; } a { border: none; + } +} - &:hover { - .icon { - filter: invert(1); - } +.shoutStatsItemInner { + margin: -0.3em -0.3em 0; + padding: 0.3em; + + .icon { + margin-right: 0; + } + + &:hover { + background: #000; + + img { + filter: invert(1); } } } diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index 8d66d814..b1fe6a7d 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -206,8 +206,10 @@ export const FullArticle = (props: ArticleProps) => {
scrollToComments()}> - - {/*{props.article.stat?.commented || ''}*/} +
+ + {/*{props.article.stat?.commented || ''}*/} +
@@ -216,18 +218,24 @@ export const FullArticle = (props: ArticleProps) => { description={getDescription(props.article.body)} imageUrl={props.article.cover} containerCssClass={stylesHeader.control} - trigger={} + trigger={ +
+ +
+ } />
- +
+ +
From 55cf0e1ffd449277f08fc29ae0b80906114a5d59 Mon Sep 17 00:00:00 2001 From: kvakazyambra Date: Wed, 29 Mar 2023 23:47:54 +0300 Subject: [PATCH 2/2] Fixed article controls style --- src/components/Article/Article.module.scss | 7 ++++++- src/components/Article/CommentsTree.tsx | 3 +++ src/components/_shared/Button/Button.tsx | 13 ++++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/components/Article/Article.module.scss b/src/components/Article/Article.module.scss index 6705a228..9f632f7a 100644 --- a/src/components/Article/Article.module.scss +++ b/src/components/Article/Article.module.scss @@ -143,7 +143,6 @@ img { } .shoutStatsItem { - cursor: pointer; @include font-size(1.5rem); font-weight: 500; display: inline-block; @@ -180,6 +179,7 @@ img { } .shoutStatsItemInner { + cursor: pointer; margin: -0.3em -0.3em 0; padding: 0.3em; @@ -315,6 +315,11 @@ img { margin-top: 0; } +.commentsViewSwitcherButton { + padding-left: 0 !important; + padding-right: 0 !important; +} + .help { border-bottom: 1px solid #e8e8e8; margin-bottom: 1.6rem; diff --git a/src/components/Article/CommentsTree.tsx b/src/components/Article/CommentsTree.tsx index c372e95b..f5e6e1be 100644 --- a/src/components/Article/CommentsTree.tsx +++ b/src/components/Article/CommentsTree.tsx @@ -126,6 +126,7 @@ export const CommentsTree = (props: Props) => { onClick={() => { setCommentsOrder('newOnly') }} + className={styles.commentsViewSwitcherButton} /> @@ -136,6 +137,7 @@ export const CommentsTree = (props: Props) => { onClick={() => { setCommentsOrder('createdAt') }} + className={styles.commentsViewSwitcherButton} />
  • @@ -145,6 +147,7 @@ export const CommentsTree = (props: Props) => { onClick={() => { setCommentsOrder('rating') }} + className={styles.commentsViewSwitcherButton} />
  • diff --git a/src/components/_shared/Button/Button.tsx b/src/components/_shared/Button/Button.tsx index eee81efe..382cba8c 100644 --- a/src/components/_shared/Button/Button.tsx +++ b/src/components/_shared/Button/Button.tsx @@ -10,6 +10,7 @@ type Props = { loading?: boolean disabled?: boolean onClick?: () => void + className?: string | '' } export const Button = (props: Props) => { @@ -18,9 +19,15 @@ export const Button = (props: Props) => { onClick={props.onClick} type={props.type ?? 'button'} disabled={props.loading || props.disabled} - class={clsx(styles.button, styles[props.size ?? 'M'], styles[props.variant ?? 'primary'], { - [styles.loading]: props.loading - })} + class={clsx( + styles.button, + styles[props.size ?? 'M'], + styles[props.variant ?? 'primary'], + { + [styles.loading]: props.loading + }, + props.className + )} > {props.value}