Merge branch 'editor' of gitlab.com:discoursio/discoursio-webapp into editor

This commit is contained in:
bniwredyc 2023-03-30 02:40:31 +02:00
commit 3dd2bd6901
4 changed files with 52 additions and 14 deletions

View File

@ -144,7 +144,6 @@ img {
.shoutStatsItem { .shoutStatsItem {
@include font-size(1.5rem); @include font-size(1.5rem);
font-weight: 500; font-weight: 500;
display: inline-block; display: inline-block;
margin: 0 3.2rem 1em 0; margin: 0 3.2rem 1em 0;
@ -166,19 +165,35 @@ img {
max-height: 1.8em; max-height: 1.8em;
} }
.shoutStatsItemInner .iconEdit {
margin-right: 0.3em;
}
img { img {
display: block; display: block;
} }
a { a {
border: none; border: none;
}
}
.shoutStatsItemInner {
cursor: pointer;
margin: -0.3em -0.3em 0;
padding: 0.3em;
.icon {
margin-right: 0;
}
&:hover { &:hover {
.icon { background: #000;
img {
filter: invert(1); filter: invert(1);
} }
} }
}
} }
.shoutStatsItemLikes { .shoutStatsItemLikes {
@ -300,6 +315,11 @@ img {
margin-top: 0; margin-top: 0;
} }
.commentsViewSwitcherButton {
padding-left: 0 !important;
padding-right: 0 !important;
}
.help { .help {
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
margin-bottom: 1.6rem; margin-bottom: 1.6rem;

View File

@ -126,6 +126,7 @@ export const CommentsTree = (props: Props) => {
onClick={() => { onClick={() => {
setCommentsOrder('newOnly') setCommentsOrder('newOnly')
}} }}
className={styles.commentsViewSwitcherButton}
/> />
</li> </li>
</Show> </Show>
@ -136,6 +137,7 @@ export const CommentsTree = (props: Props) => {
onClick={() => { onClick={() => {
setCommentsOrder('createdAt') setCommentsOrder('createdAt')
}} }}
className={styles.commentsViewSwitcherButton}
/> />
</li> </li>
<li classList={{ selected: commentsOrder() === 'rating' }}> <li classList={{ selected: commentsOrder() === 'rating' }}>
@ -145,6 +147,7 @@ export const CommentsTree = (props: Props) => {
onClick={() => { onClick={() => {
setCommentsOrder('rating') setCommentsOrder('rating')
}} }}
className={styles.commentsViewSwitcherButton}
/> />
</li> </li>
</ul> </ul>

View File

@ -206,9 +206,11 @@ export const FullArticle = (props: ArticleProps) => {
</Show> </Show>
<div class={styles.shoutStatsItem} onClick={() => scrollToComments()}> <div class={styles.shoutStatsItem} onClick={() => scrollToComments()}>
<div class={styles.shoutStatsItemInner}>
<Icon name="comment" class={styles.icon} /> <Icon name="comment" class={styles.icon} />
{/*{props.article.stat?.commented || ''}*/} {/*{props.article.stat?.commented || ''}*/}
</div> </div>
</div>
<div class={styles.shoutStatsItem}> <div class={styles.shoutStatsItem}>
<SharePopup <SharePopup
@ -216,18 +218,24 @@ export const FullArticle = (props: ArticleProps) => {
description={getDescription(props.article.body)} description={getDescription(props.article.body)}
imageUrl={props.article.cover} imageUrl={props.article.cover}
containerCssClass={stylesHeader.control} containerCssClass={stylesHeader.control}
trigger={<Icon name="share-outline" class={styles.icon} />} trigger={
<div class={styles.shoutStatsItemInner}>
<Icon name="share-outline" class={styles.icon} />
</div>
}
/> />
</div> </div>
<div class={styles.shoutStatsItem} onClick={bookmark}> <div class={styles.shoutStatsItem} onClick={bookmark}>
<div class={styles.shoutStatsItemInner}>
<Icon name="bookmark" class={styles.icon} /> <Icon name="bookmark" class={styles.icon} />
</div> </div>
</div>
<Show when={canEdit()}> <Show when={canEdit()}>
<div class={styles.shoutStatsItem}> <div class={styles.shoutStatsItem}>
<a href="/edit"> <a href="/edit" class={styles.shoutStatsItemInner}>
<Icon name="edit" /> <Icon name="edit" class={clsx(styles.icon, styles.iconEdit)} />
{t('Edit')} {t('Edit')}
</a> </a>
</div> </div>

View File

@ -10,6 +10,7 @@ type Props = {
loading?: boolean loading?: boolean
disabled?: boolean disabled?: boolean
onClick?: () => void onClick?: () => void
className?: string | ''
} }
export const Button = (props: Props) => { export const Button = (props: Props) => {
@ -18,9 +19,15 @@ export const Button = (props: Props) => {
onClick={props.onClick} onClick={props.onClick}
type={props.type ?? 'button'} type={props.type ?? 'button'}
disabled={props.loading || props.disabled} disabled={props.loading || props.disabled}
class={clsx(styles.button, styles[props.size ?? 'M'], styles[props.variant ?? 'primary'], { class={clsx(
styles.button,
styles[props.size ?? 'M'],
styles[props.variant ?? 'primary'],
{
[styles.loading]: props.loading [styles.loading]: props.loading
})} },
props.className
)}
> >
{props.value} {props.value}
</button> </button>