From eb84a366d224c76cd38de09d0dffaf979c743e2e Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 2 Oct 2020 15:18:53 -0400 Subject: [PATCH] add file reactions code from odysee --- .env.defaults | 1 + config.js | 1 + ui/component/fileActions/view.jsx | 4 +- ui/component/fileReactions/index.js | 26 ++++++++++ ui/component/fileReactions/view.jsx | 52 ++++++++++++++++++++ ui/constants/action_types.js | 8 +++ ui/reducers.js | 2 + ui/redux/actions/reactions.js | 70 ++++++++++++++++++++++++++ ui/redux/reducers/reactions.js | 55 +++++++++++++++++++++ ui/redux/selectors/reactions.js | 76 +++++++++++++++++++++++++++++ 10 files changed, 294 insertions(+), 1 deletion(-) create mode 100644 ui/component/fileReactions/index.js create mode 100644 ui/component/fileReactions/view.jsx create mode 100644 ui/redux/actions/reactions.js create mode 100644 ui/redux/reducers/reactions.js create mode 100644 ui/redux/selectors/reactions.js diff --git a/.env.defaults b/.env.defaults index ac24fc739..6dc6ffc7a 100644 --- a/.env.defaults +++ b/.env.defaults @@ -25,6 +25,7 @@ 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 +ENABLE_FILE_REACTIONS=false # OG OG_TITLE_SUFFIX=| lbry.tv diff --git a/config.js b/config.js index cbbcfeb89..e1c0cbcad 100644 --- a/config.js +++ b/config.js @@ -30,6 +30,7 @@ const config = { AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS, UNSYNCED_SETTINGS: process.env.UNSYNCED_SETTINGS, ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true', + ENABLE_FILE_REACTIONS: process.env.ENABLE_FILE_REACTIONS === 'true', SIMPLE_SITE: process.env.SIMPLE_SITE === 'true', SHOW_ADS: process.env.SHOW_ADS === 'true', PINNED_URI_1: process.env.PINNED_URI_1, diff --git a/ui/component/fileActions/view.jsx b/ui/component/fileActions/view.jsx index 90d3b4fd7..d06b2b37b 100644 --- a/ui/component/fileActions/view.jsx +++ b/ui/component/fileActions/view.jsx @@ -1,5 +1,5 @@ // @flow -import { SIMPLE_SITE, SITE_NAME } from 'config'; +import { SIMPLE_SITE, SITE_NAME, ENABLE_FILE_REACTIONS } from 'config'; import * as PAGES from 'constants/pages'; import * as MODALS from 'constants/modal_types'; import * as ICONS from 'constants/icons'; @@ -11,6 +11,7 @@ import * as RENDER_MODES from 'constants/file_render_modes'; import { useIsMobile } from 'effects/use-screensize'; import ClaimSupportButton from 'component/claimSupportButton'; import { useHistory } from 'react-router'; +import FileReactions from 'component/fileReactions'; type Props = { uri: string, @@ -79,6 +80,7 @@ function FileActions(props: Props) { const lhsSection = ( <> + {ENABLE_FILE_REACTIONS && }