mirror of
https://github.com/wassname/talk.git
synced 2026-07-20 12:40:47 +08:00
New API for comment input tags
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
export {
|
||||
addCommentClassName,
|
||||
removeCommentClassName,
|
||||
// @Deprecated
|
||||
addCommentBoxTag as addTag,
|
||||
// @Deprecated
|
||||
removeCommentBoxTag as removeTag,
|
||||
} from 'coral-embed-stream/src/actions/stream';
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
export const commentBoxTagsSelector = state => state.stream.commentBoxTags;
|
||||
import once from 'lodash/once';
|
||||
|
||||
// @Deprecated
|
||||
const showOldTagsWarningOnce = once(() => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.warn(
|
||||
'`commentBoxTagsSelector` is deprecated. Please switch to `input.tags` instead'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
export const commentBoxTagsSelector = state => {
|
||||
showOldTagsWarningOnce();
|
||||
return state.stream.commentBoxTags;
|
||||
};
|
||||
|
||||
export const commentClassNamesSelector = state =>
|
||||
state.stream.commentClassNames;
|
||||
|
||||
Reference in New Issue
Block a user