mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 19:33:59 +08:00
Merge branch 'master' into talk-plugin-avatar
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
import update from 'immutability-helper';
|
||||
import {THREADING_LEVEL} from '../constants/stream';
|
||||
function determineCommentDepth(comment) {
|
||||
let depth = 0;
|
||||
let cur = comment;
|
||||
while (cur.parent) {
|
||||
cur = cur.parent;
|
||||
depth++;
|
||||
}
|
||||
return depth;
|
||||
}
|
||||
|
||||
function applyToCommentsOrigin(root, callback) {
|
||||
if (root.comment) {
|
||||
let comment = root.comment;
|
||||
for (let depth = 0; depth <= THREADING_LEVEL; depth++) {
|
||||
for (let depth = 0; depth <= determineCommentDepth(comment); depth++) {
|
||||
let changes = {$apply: (node) => node ? callback(node) : node};
|
||||
for (let i = 0; i < depth; i++) {
|
||||
changes = {parent: changes};
|
||||
|
||||
@@ -459,14 +459,3 @@ button.comment__action-button[disabled],
|
||||
width: initial;
|
||||
}
|
||||
|
||||
|
||||
@media (min-device-width : 300px) and (max-device-width : 420px) {
|
||||
.commentActionsLeft.comment__action-container .coral-plugin-replies-reply-button {
|
||||
visibility: collapse;
|
||||
margin-left: -30px;
|
||||
}
|
||||
|
||||
.commentActionsLeft.comment__action-container .coral-plugin-replies-reply-button .coral-plugin-replies-icon {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
@media (max-width: 425px) {
|
||||
.label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,19 @@ import React, {PropTypes} from 'react';
|
||||
|
||||
import t from 'coral-framework/services/i18n';
|
||||
|
||||
import classnames from 'classnames';
|
||||
import cn from 'classnames';
|
||||
import styles from './ReplyButton.css';
|
||||
|
||||
const name = 'coral-plugin-replies';
|
||||
|
||||
const ReplyButton = ({onClick}) => {
|
||||
return (
|
||||
<button
|
||||
className={classnames(`${name}-reply-button`)}
|
||||
className={cn(`${name}-reply-button`)}
|
||||
onClick={onClick}>
|
||||
{t('reply')}
|
||||
<span className={cn(`${name}-label`, styles.label)}>
|
||||
{t('reply')}
|
||||
</span>
|
||||
<i className={`${name}-icon material-icons`}
|
||||
aria-hidden={true}>reply</i>
|
||||
</button>
|
||||
|
||||
@@ -45,7 +45,9 @@ class LikeButton extends React.Component {
|
||||
className={cn(styles.button, {[styles.liked]: alreadyReacted}, `${plugin}-button`)}
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
<span>{t(alreadyReacted ? 'coral-plugin-like.liked' : 'coral-plugin-like.like')}</span>
|
||||
<span className={cn(`${plugin}-label`, styles.label)}>
|
||||
{t(alreadyReacted ? 'coral-plugin-like.liked' : 'coral-plugin-like.like')}
|
||||
</span>
|
||||
<Icon name="thumb_up" className={`${plugin}-icon`} />
|
||||
<span className={`${plugin}-count`}>{count > 0 && count}</span>
|
||||
</button>
|
||||
|
||||
@@ -23,3 +23,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 425px) {
|
||||
.label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ class LoveButton extends React.Component {
|
||||
className={cn(styles.button, {[styles.loved]: alreadyReacted}, `${plugin}-button`)}
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
<span>{t(alreadyReacted ? 'coral-plugin-love.loved' : 'coral-plugin-love.love')}</span>
|
||||
<span className={cn(`${plugin}-label`, styles.label)}>
|
||||
{t(alreadyReacted ? 'coral-plugin-love.loved' : 'coral-plugin-love.love')}
|
||||
</span>
|
||||
<Icon name="favorite" className={`${plugin}-icon`} />
|
||||
<span className={`${plugin}-count`}>{count > 0 && count}</span>
|
||||
</button>
|
||||
|
||||
@@ -23,3 +23,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 425px) {
|
||||
.label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +45,11 @@ class RespectButton extends React.Component {
|
||||
className={cn(styles.button, {[styles.respected]: alreadyReacted}, `${plugin}-button`)}
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
<span className={`${plugin}-button-text`}>
|
||||
<span className={cn(`${plugin}-label`, styles.label)}>
|
||||
{t(alreadyReacted ? 'coral-plugin-respect.respected' : 'coral-plugin-respect.respect')}
|
||||
</span>
|
||||
<Icon className={cn(styles.icon, `${plugin}-icon`)} />
|
||||
<span className={cn(styles.icon, `${plugin}-count`)}>{count > 0 && count}</span>
|
||||
<span className={cn(`${plugin}-count`)}>{count > 0 && count}</span>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,3 +28,9 @@
|
||||
.icon {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 425px) {
|
||||
.label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user