mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 17:06:37 +08:00
Refactor
This commit is contained in:
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
|
||||
import TagLabel from './TagLabel';
|
||||
import CommentTimestamp from 'coral-framework/components/CommentTimestamp';
|
||||
import { ReplyButton } from 'talk-plugin-replies';
|
||||
import ReplyButton from './ReplyButton';
|
||||
import ReplyBox from './ReplyBox';
|
||||
import { FlagComment } from 'talk-plugin-flags';
|
||||
import { can } from 'coral-framework/services/perms';
|
||||
@@ -80,6 +80,11 @@ const ActionButton = ({ children }) => {
|
||||
);
|
||||
};
|
||||
|
||||
ActionButton.propTypes = {
|
||||
// id of currently opened ReplyBox. tracked in Stream.js
|
||||
children: PropTypes.node,
|
||||
};
|
||||
|
||||
// Determine whether the comment with id is in the part of the comments tree.
|
||||
function containsCommentId(props, id) {
|
||||
if (props.comment.id === id) {
|
||||
@@ -155,6 +160,7 @@ export default class Comment extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
// id of currently opened ReplyBox. tracked in Stream.js
|
||||
children: PropTypes.node,
|
||||
activeReplyBox: PropTypes.string.isRequired,
|
||||
disableReply: PropTypes.bool,
|
||||
setActiveReplyBox: PropTypes.func.isRequired,
|
||||
@@ -173,6 +179,12 @@ export default class Comment extends React.Component {
|
||||
}),
|
||||
charCountEnable: PropTypes.bool.isRequired,
|
||||
maxCharCount: PropTypes.number,
|
||||
data: PropTypes.object,
|
||||
root: PropTypes.object,
|
||||
loadMore: PropTypes.func,
|
||||
postDontAgree: PropTypes.func,
|
||||
animateEnter: PropTypes.bool,
|
||||
commentClassNames: PropTypes.array,
|
||||
comment: PropTypes.shape({
|
||||
depth: PropTypes.number,
|
||||
action_summaries: PropTypes.array.isRequired,
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ import t from 'coral-framework/services/i18n';
|
||||
import cn from 'classnames';
|
||||
import styles from './ReplyButton.css';
|
||||
|
||||
// @TODO: remove this.
|
||||
const name = 'talk-plugin-replies';
|
||||
|
||||
const ReplyButton = ({ onClick }) => {
|
||||
@@ -1 +0,0 @@
|
||||
export { default as ReplyButton } from './ReplyButton';
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import t from 'coral-framework/services/i18n';
|
||||
import { ReplyButton } from 'talk-plugin-replies';
|
||||
import ReplyButton from 'coral-embed-stream/src/tabs/stream/components/ReplyButton';
|
||||
import styles from './FakeComment.css';
|
||||
import { Icon } from 'plugin-api/beta/client/components/ui';
|
||||
import { CommentTimestamp } from 'plugin-api/beta/client/components';
|
||||
|
||||
Reference in New Issue
Block a user