diff --git a/.env.defaults b/.env.defaults index 0275b72af..ac24fc739 100644 --- a/.env.defaults +++ b/.env.defaults @@ -24,7 +24,7 @@ SIMPLE_SITE=false SHOW_ADS=true YRBL_HAPPY_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a YRBL_SAD_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd - +ENABLE_COMMENT_REACTIONS=false # OG OG_TITLE_SUFFIX=| lbry.tv diff --git a/config.js b/config.js index 52788fa05..09c7f23c6 100644 --- a/config.js +++ b/config.js @@ -35,6 +35,7 @@ const config = { PINNED_LABEL_1: process.env.PINNED_LABEL_1, PINNED_URI_2: process.env.PINNED_URI_2, PINNED_LABEL_2: process.env.PINNED_LABEL_2, + ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true', }; config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; diff --git a/ui/component/commentReactions/view.jsx b/ui/component/commentReactions/view.jsx index 5aa5fad2c..a921e3cb0 100644 --- a/ui/component/commentReactions/view.jsx +++ b/ui/component/commentReactions/view.jsx @@ -1,58 +1,60 @@ // @flow -// import * as ICONS from 'constants/icons'; -// import * as REACTION_TYPES from 'constants/reactions'; -// import React from 'react'; -// import classnames from 'classnames'; -// import Button from 'component/button'; -// import usePersistedState from 'effects/use-persisted-state'; +import { ENABLE_COMMENT_REACTIONS } from 'config'; +import * as ICONS from 'constants/icons'; +import * as REACTION_TYPES from 'constants/reactions'; +import React from 'react'; +import classnames from 'classnames'; +import Button from 'component/button'; +import usePersistedState from 'effects/use-persisted-state'; type Props = { myReacts: Array, othersReacts: any, react: (string, string) => void, commentId: string, - typesReacting: Array, }; export default function CommentReactions(props: Props) { - // const { myReacts, othersReacts, commentId, react, typesReacting } = props; - // const [activeChannel] = usePersistedState('comment-channel'); + const { myReacts, othersReacts, commentId, react } = props; + const [activeChannel] = usePersistedState('comment-channel'); - // const getCountForReact = type => { - // let count = 0; - // if (othersReacts && othersReacts[type]) { - // count += othersReacts[type]; - // } - // if (myReacts && myReacts.includes(type)) { - // count += 1; - // } - // return count; - // }; + const getCountForReact = type => { + let count = 0; + if (othersReacts && othersReacts[type]) { + count += othersReacts[type]; + } + if (myReacts && myReacts.includes(type)) { + count += 1; + } + return count; + }; - return null; + if (!ENABLE_COMMENT_REACTIONS) { + return null; + } - // return ( - // <> - //