From 85354ca207c3ae884403d56c4711844a1c50a145 Mon Sep 17 00:00:00 2001 From: lungsangg Date: Mon, 28 Oct 2024 17:48:08 +0530 Subject: [PATCH] commentary_share_option_update --- sefaria/local_settings.py | 2 +- static/js/TextList.jsx | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/sefaria/local_settings.py b/sefaria/local_settings.py index dd89cba4e5..5ab31bef0a 100644 --- a/sefaria/local_settings.py +++ b/sefaria/local_settings.py @@ -129,7 +129,7 @@ ################ These are things you DO NOT NEED to touch unless you know what you are doing. ############################## -DEBUG = os.getenv("DEBUG", False) +DEBUG = os.getenv("DEBUG", True) REMOTE_HOSTS = os.getenv('REMOTE_HOSTS', 'staging.pecha.org').replace(" ", "") diff --git a/static/js/TextList.jsx b/static/js/TextList.jsx index a091d23ad6..b9a996bef9 100644 --- a/static/js/TextList.jsx +++ b/static/js/TextList.jsx @@ -234,6 +234,7 @@ class TextList extends Component { + {Sefaria.is_moderator ? : null } @@ -357,6 +358,26 @@ const AddConnectionToSheetButton = ({srefs, addToSheetCallback, versions= {"en": ); } + +const ShareConnectionButton = ({srefs, setConnectionsMode}) => { + /* + ConnectionButton composite element. Goes inside a ConnectionButtons + Takes a ref(s) and callback to open sharing UI + */ + const handleShare = () => { + setConnectionsMode("Share", {"connectionRefs": srefs}); + } + + return ( + + ); +} + const ConnectionButtons = ({children}) =>{ /* This is basically just a composition container, and allows to apply css rules to a container for connection buttons. can also be expanded to use a default set of connection buttons, if not children are present? @@ -369,4 +390,4 @@ const ConnectionButtons = ({children}) =>{ } -export {TextList as default, ConnectionButtons, AddConnectionToSheetButton, OpenConnectionTabButton, DeleteConnectionButton}; +export {TextList as default, ConnectionButtons, AddConnectionToSheetButton, OpenConnectionTabButton, DeleteConnectionButton, ShareConnectionButton};