diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index 12028b6de..1fce8fb04 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -42,7 +42,10 @@ type Props = { isReply: boolean, activeChannel: string, activeChannelClaim: ?ChannelClaim, - livestream?: boolean, + bottom: boolean, + onSubmit: (string, string) => void, + livestream: boolean, + embed?: boolean, toast: (string) => void, claimIsMine: boolean, sendTip: ({}, (any) => void, (any) => void) => void, @@ -63,7 +66,11 @@ export function CommentCreate(props: Props) { isReply, parentId, activeChannelClaim, + onSubmit, + bottom, livestream, + embed, + toast, claimIsMine, sendTip, doToast, @@ -106,7 +113,7 @@ export function CommentCreate(props: Props) { function altEnterListener(e: SyntheticKeyboardEvent<*>) { const KEYCODE_ENTER = 13; - if ((e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) { + if ((livestream || e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) { e.preventDefault(); buttonref.current.click(); } @@ -256,6 +263,10 @@ export function CommentCreate(props: Props) { setIsSupportComment(false); setCommentFailure(false); + if (onSubmit) { + onSubmit(commentValue, activeChannelClaim.name); + } + if (onDoneReplying) { onDoneReplying(); } @@ -280,6 +291,11 @@ export function CommentCreate(props: Props) {
{ + if (embed) { + window.open(`https://odysee.com/$/${PAGES.AUTH}?redirect=/$/${PAGES.LIVESTREAM}`); + return; + } + const pathPlusRedirect = `/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`; if (livestream) { window.open(pathPlusRedirect); @@ -344,6 +360,7 @@ export function CommentCreate(props: Props) { className={classnames('comment__create', { 'comment__create--reply': isReply, 'comment__create--nested-reply': isNested, + 'comment__create--bottom': bottom, })} > { - if (claimId) { + function fetchReactions() { doFetchReactions(claimId); } - }, [claimId, doFetchReactions]); + + let fetchInterval; + if (claimId) { + fetchReactions(); + + if (livestream) { + fetchInterval = setInterval(fetchReactions, 45000); + } + } + + return () => { + if (fetchInterval) { + clearInterval(fetchInterval); + } + }; + }, [claimId, doFetchReactions, livestream]); return ( <> @@ -41,20 +68,46 @@ function FileReactions(props: Props) { title={__('I like this')} requiresAuth={IS_WEB} authSrc="filereaction_like" - className={classnames('button--file-action')} - label={formatNumberWithCommas(likeCount, 0)} + className={classnames('button--file-action', { 'button--fire': myReaction === REACTION_TYPES.LIKE })} + label={ + <> + {myReaction === REACTION_TYPES.LIKE && ( + <> +
+
+
+
+
+
+
+ + )} + {formatNumberWithCommas(likeCount, 0)} + + } iconSize={18} - icon={ICONS.UPVOTE} + icon={myReaction === REACTION_TYPES.LIKE ? ICONS.FIRE_ACTIVE : ICONS.FIRE} onClick={() => doReactionLike(uri)} />