diff --git a/.env.defaults b/.env.defaults index f5e43ecce..ea7120e6a 100644 --- a/.env.defaults +++ b/.env.defaults @@ -46,6 +46,7 @@ YRBL_SAD_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649 #LOGO_TEXT_LIGHT=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd #LOGO_TEXT_DARK=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd #AVATAR_DEFAULT= +#FAVICON= # LOCALE DEFAULT_LANGUAGE=en @@ -77,6 +78,8 @@ CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4 CHANNEL_STAKED_LEVEL_LIVESTREAM=5 WEB_PUBLISH_SIZE_LIMIT_GB=4 LOADING_BAR_COLOR=#2bbb90 +LIGHTHOUSE_DEFAULT_TYPES=audio,video,text,image,application + SHOW_ADS=true ## SIMPLE_SITE REPLACEMENTS diff --git a/config.js b/config.js index 36b982ff6..2620d4863 100644 --- a/config.js +++ b/config.js @@ -25,9 +25,10 @@ const config = { // LOGO LOGO_TITLE: process.env.LOGO_TITLE, FAVICON: process.env.FAVICON, - LOGO_URL: process.env.LOGO_URL, - LOGO_TEXT_LIGHT_URL: process.env.LOGO_TEXT_LIGHT_URL, - LOGO_TEXT_DARK_URL: process.env.LOGO_TEXT_DARK_URL, + LOGO: process.env.LOGO, + LOGO_TEXT_LIGHT: process.env.LOGO_TEXT_LIGHT, + LOGO_TEXT_DARK: process.env.LOGO_TEXT_DARK, + AVATAR_DEFAULT: process.env.AVATAR_DEFAULT, // OG OG_TITLE_SUFFIX: process.env.OG_TITLE_SUFFIX, OG_HOMEPAGE_TITLE: process.env.OG_HOMEPAGE_TITLE, @@ -40,6 +41,7 @@ const config = { DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE, AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS, UNSYNCED_SETTINGS: process.env.UNSYNCED_SETTINGS, + AVATAR_DEFAULT: process.env.AVATAR_DEFAULT, // ENABLE FEATURES ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true', @@ -63,6 +65,7 @@ const config = { ENABLE_MATURE: process.env.ENABLE_MATURE === 'true', CUSTOM_HOMEPAGE: process.env.CUSTOM_HOMEPAGE === 'true', SHOW_TAGS_INTRO: process.env.SHOW_TAGS_INTRO === 'true', + LIGHTHOUSE_DEFAULT_TYPES: process.env.LIGHTHOUSE_DEFAULT_TYPES, }; config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; diff --git a/flow-typed/homepage.js b/flow-typed/homepage.js index bf00bed7c..f1696840f 100644 --- a/flow-typed/homepage.js +++ b/flow-typed/homepage.js @@ -17,7 +17,7 @@ declare type RowDataItem = { help?: any, icon?: string, extra?: any, - pinUrls?: Array, + pinnedUrls?: Array, options?: { channelIds?: Array, limitClaimsPerChannel?: number, diff --git a/homepages/meme/index.js b/homepages/meme/index.js new file mode 100644 index 000000000..a182a2ec4 --- /dev/null +++ b/homepages/meme/index.js @@ -0,0 +1,4 @@ +module.exports = { + text: `This is LBRY`, + url: 'https://odysee.com/@Odysee:8?view=discussion', +}; diff --git a/static/app-strings.json b/static/app-strings.json index 66d71822b..e0e559fa5 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -375,6 +375,10 @@ "Got it": "Got it", "View your channels": "View your channels", "Unfollow": "Unfollow", + "Follow @%channelName%": "Follow @%channelName%", + "Unfollow @%channelName%": "Unfollow @%channelName%", + "Item removed from %name%": "Item removed from %name%", + "Item added to %name%": "Item added to %name%", "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.": "These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.", "Create channel": "Create channel", "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.": "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.", @@ -390,7 +394,6 @@ "Share on Telegram": "Share on Telegram", "Share via...": "Share via...", "View on lbry.tv": "View on lbry.tv", - "You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.": "You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.", "Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?": "Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?", "You currently have the highest bid for this name.": "You currently have the highest bid for this name.", "You can generate a new address at any time, and any previous addresses will continue to work.": "You can generate a new address at any time, and any previous addresses will continue to work.", @@ -623,7 +626,7 @@ "If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.": "If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.", "Your update is now pending on LBRY. It will take a few minutes to appear for other users.": "Your update is now pending on LBRY. It will take a few minutes to appear for other users.", "Your livestream is now pending. You will be able to start shortly at the streaming dashboard.": "Your livestream is now pending. You will be able to start shortly at the streaming dashboard.", - "Your file is now pending on LBRY. It will take a few minutes to appear for other users.": "Your file is now pending on LBRY. It will take a few minutes to appear for other users.", + "Your content will be live shortly.": "Your content will be live shortly.", "Your video will appear on Odysee shortly.": "Your video will appear on Odysee shortly.", "Upload will continue in the background, please do not shut down immediately. Leaving the app running helps the network, thank you!": "Upload will continue in the background, please do not shut down immediately. Leaving the app running helps the network, thank you!", "No results for %query%": "No results for %query%", @@ -740,7 +743,6 @@ "Livestream Created": "Livestream Created", "Delete this file from my computer": "Delete this file from my computer", "Are you sure you'd like to remove %title%?": "Are you sure you'd like to remove %title%?", - "reclaim %amount%": "reclaim %amount%", "Remove from blockchain (%lbc%)": "Remove from blockchain (%lbc%)", "Abandon on blockchain (reclaim %lbc%)": "Abandon on blockchain (reclaim %lbc%)", "This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.": "This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.", @@ -859,7 +861,7 @@ "This will permanently remove your channel. Content published under this channel will be orphaned.": "This will permanently remove your channel. Content published under this channel will be orphaned.", "Are you sure you'd like to remove \"%title%\"?": "Are you sure you'd like to remove \"%title%\"?", "You are signed into lbry.tv which automatically shares data with LBRY inc. %signout_button%.": "You are signed into lbry.tv which automatically shares data with LBRY inc. %signout_button%.", - "LBRY works better if you find and follow a couple creators you like. You can also block channels you never want to see.": "LBRY works better if you find and follow a couple creators you like. You can also block channels you never want to see.", + "%SITE_NAME% works better if you find and follow a couple creators you like. You can also block channels you never want to see.": "%SITE_NAME% works better if you find and follow a couple creators you like. You can also block channels you never want to see.", "Nice! You are currently following %followingCount% creator": "Nice! You are currently following %followingCount% creator", "Nice! You are currently following %followingCount% creators": "Nice! You are currently following %followingCount% creators", "Get Validated": "Get Validated", @@ -997,7 +999,7 @@ "You sent %amount% LBRY Credits as a tip, Mahalo!": "You sent %amount% LBRY Credits as a tip, Mahalo!", "You sent %amount% LBRY Credits": "You sent %amount% LBRY Credits", "No stats found": "No stats found", - "Sorry about that. Try refreshing or something else.": "Sorry about that. Try refreshing or something else.", + "Sorry about that. Contact %SITE_HELP_EMAIL% if you continue to have issues.": "Sorry about that. Contact %SITE_HELP_EMAIL% if you continue to have issues.", "You are not able to see this channel's stats. Make sure you are signed in with the correct email and have data sharing turned on.": "You are not able to see this channel's stats. Make sure you are signed in with the correct email and have data sharing turned on.", "%follower_count% followers": "%follower_count% followers", "Sign Up": "Sign Up", @@ -1414,15 +1416,13 @@ "Confirm Edit": "Confirm Edit", "Create Livestream": "Create Livestream", "File": "File", - "Video/audio file": "Video/audio file", "Transcode": "Transcode", "Estimated transaction fee:": "Estimated transaction fee:", "Est. transaction fee:": "Est. transaction fee:", "Skip preview and confirmation": "Skip preview and confirmation", "Upload settings": "Upload settings", - "Currently uploading": "Currently uploading", - "Your files are currently uploading.": "Your files are currently uploading.", - "Your file is currently uploading.": "Your file is currently uploading.", + "Currently Uploading": "Currently Uploading", + "Leave the app running until upload is complete": "Leave the app running until upload is complete", "Enable Sync": "Enable Sync", "Disable Sync": "Disable Sync", "Getting your profiles...": "Getting your profiles...", @@ -1453,6 +1453,7 @@ "Unable to comment. This channel has blocked you.": "Unable to comment. This channel has blocked you.", "Unable to comment. Your channel has been blocked by an admin.": "Unable to comment. Your channel has been blocked by an admin.", "Unable to comment. The content owner has disabled comments.": "Unable to comment. The content owner has disabled comments.", + "Please do not spam.": "Please do not spam.", "Slow mode is on. Please wait up to %value% seconds before commenting again.": "Slow mode is on. Please wait up to %value% seconds before commenting again.", "The comment contains contents that are blocked by %author%": "The comment contains contents that are blocked by %author%", "Your channel is still being setup, try again in a few moments.": "Your channel is still being setup, try again in a few moments.", @@ -1495,7 +1496,7 @@ "Earn a random reward of at least %lbc% for watching anything at all.": "Earn a random reward of at least %lbc% for watching anything at all.", "You have already claimed this reward within the last 24 hours.": "You have already claimed this reward within the last 24 hours.", "Please watch some content to earn this reward.": "Please watch some content to earn this reward.", - "You will receive an SMS text message confirming your phone number is valid.": "You will receive an SMS text message confirming your phone number is valid.", + "You will receive an SMS text message confirming your phone number is valid. May not be available in all regions.": "You will receive an SMS text message confirming your phone number is valid. May not be available in all regions.", "Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.": "Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.", "Your First Nickel": "Your First Nickel", "Your First Credit": "Your First Credit", @@ -1735,11 +1736,14 @@ "Moderator Block": "Moderator Block", "Block this channel on behalf of %creator%": "Block this channel on behalf of %creator%", "creator": "creator", + "Create a channel to change this setting.": "Create a channel to change this setting.", "Invalid channel URL \"%url%\"": "Invalid channel URL \"%url%\"", "Delegation": "Delegation", "Add moderator": "Add moderator", - "Add moderators": "Add moderators", - "Add moderator channel URL (e.g. \"@lbry#3f\")": "Add moderator channel URL (e.g. \"@lbry#3f\")", + "Enter a @username or URL": "Enter a @username or URL", + "examples: @channel, @channel#3, https://odysee.com/@Odysee:8, lbry://@Odysee#8": "examples: @channel, @channel#3, https://odysee.com/@Odysee:8, lbry://@Odysee#8", + "Moderators": "Moderators", + "Add as moderator": "Add as moderator", "Mute (m)": "Mute (m)", "Playback Rate (<, >)": "Playback Rate (<, >)", "Fullscreen (f)": "Fullscreen (f)", @@ -1763,9 +1767,10 @@ "Stay up to date on the latest content from your favorite creators.": "Stay up to date on the latest content from your favorite creators.", "Receive tutorial emails related to LBRY ": "Receive tutorial emails related to LBRY ", "Create A LiveStream": "Create A LiveStream", - "This channel": "This channel", "%channel% has disabled chat for this stream. Enjoy the stream!": "%channel% has disabled chat for this stream. Enjoy the stream!", + "This channel has disabled chat for this stream. Enjoy the stream!": "This channel has disabled chat for this stream. Enjoy the stream!", "%channel% isn't live right now, but the chat is! Check back later to watch the stream.": "%channel% isn't live right now, but the chat is! Check back later to watch the stream.", + "This channel isn't live right now, but the chat is! Check back later to watch the stream.": "This channel isn't live right now, but the chat is! Check back later to watch the stream.", "Right now": "Right now", "%viewer_count% currently watching": "%viewer_count% currently watching", "Slowmode is on. You can comment again in %time% seconds.": "Slowmode is on. You can comment again in %time% seconds.", @@ -1781,6 +1786,9 @@ "Nothing here yet. %check_again%": "Nothing here yet. %check_again%", "Check again": "Check again", "Check again...": "Check again...", + "Only visible to you": "Only visible to you", + "People who view this link will be redirected to your livestream. Make sure to use this for sharing so your title and thumbnail are displayed properly.": "People who view this link will be redirected to your livestream. Make sure to use this for sharing so your title and thumbnail are displayed properly.", + "View livestream": "View livestream", "You need to upload your livestream details before you can go live. If you already created one in this channel, it should appear soon.": "You need to upload your livestream details before you can go live. If you already created one in this channel, it should appear soon.", "Create A Livestream": "Create A Livestream", "Create a Livestream by first submitting your livestream details and waiting for approval confirmation. This can be done well in advance and will take a few minutes.": "Create a Livestream by first submitting your livestream details and waiting for approval confirmation. This can be done well in advance and will take a few minutes.", @@ -1803,7 +1811,7 @@ "Update your livestream": "Update your livestream", "Prepare an upcoming livestream": "Prepare an upcoming livestream", "Edit your post": "Edit your post", - "Update your video": "Update your video", + "Update your content": "Update your content", "Go Live on Odysee": "Go Live on Odysee", "You're invited to try out our new livestreaming service while in beta!": "You're invited to try out our new livestreaming service while in beta!", "lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead": "lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead", @@ -1951,7 +1959,6 @@ "Failed to process fetched data.": "Failed to process fetched data.", "More from %claim_name%": "More from %claim_name%", "Update your video/audio": "Update your video/audio", - "Upload that unlabeled video you found behind the TV in 1991": "Upload that unlabeled video you found behind the TV in 1991", "Upload that unlabeled video or cassette you found behind the TV in 1991": "Upload that unlabeled video or cassette you found behind the TV in 1991", "Select Replay": "Select Replay", "Craft an epic post clearly explaining... whatever.": "Craft an epic post clearly explaining... whatever.", @@ -2049,7 +2056,6 @@ "Tip Creators": "Tip Creators", "Only select creators can receive tips at this time": "Only select creators can receive tips at this time", "The payment will be made from your saved card": "The payment will be made from your saved card", - "A channel is required to comment on lbry.tv": "A channel is required to comment on lbry.tv", "Commenting...": "Commenting...", "Show %count% replies": "Show %count% replies", "Show reply": "Show reply", diff --git a/static/index-web.html b/static/index-web.html index f34303615..248dcd0e6 100644 --- a/static/index-web.html +++ b/static/index-web.html @@ -5,7 +5,6 @@ - diff --git a/ui/analytics.js b/ui/analytics.js index 7b3762c4d..69c52f3a5 100644 --- a/ui/analytics.js +++ b/ui/analytics.js @@ -12,7 +12,7 @@ import { generateInitialUrl } from 'util/url'; import { MATOMO_ID, MATOMO_URL, LBRY_WEB_BUFFER_API } from 'config'; const isProduction = process.env.NODE_ENV === 'production'; -const devInternalApis = process.env.LBRY_API_URL; +const devInternalApis = process.env.LBRY_API_URL && process.env.LBRY_API_URL.includes('dev'); export const SHARE_INTERNAL = 'shareInternal'; const SHARE_THIRD_PARTY = 'shareThirdParty'; diff --git a/ui/component/channelContent/view.jsx b/ui/component/channelContent/view.jsx index ac1d1f233..3498e5799 100644 --- a/ui/component/channelContent/view.jsx +++ b/ui/component/channelContent/view.jsx @@ -1,5 +1,5 @@ // @flow -import { SHOW_ADS, ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config'; +import { SHOW_ADS, SIMPLE_SITE } from 'config'; import * as CS from 'constants/claim_search'; import * as ICONS from 'constants/icons'; import React, { Fragment } from 'react'; @@ -136,7 +136,7 @@ function ChannelContent(props: Props) { {!channelIsMine && claimsInChannel > 0 && } setThumbError(true)} // if thumb fails (including due to https replace, show gerbil. /> @@ -99,7 +101,7 @@ function ChannelThumbnail(props: Props) { setThumbError(true)} // if thumb fails (including due to https replace, show gerbil. /> diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index 6220cc783..66535b73d 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -98,10 +98,13 @@ function ClaimMenuList(props: Props) { const isChannel = !incognitoClaim && !contentSigningChannel; const { channelName } = parseURI(contentChannelUri); const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)); - const subscriptionLabel = __('%action%' + '%user%', { - action: isSubscribed ? __('Unfollow') : __('Follow'), - user: repostedClaim ? __(' @' + channelName) : '', - }); + const subscriptionLabel = repostedClaim + ? isSubscribed + ? __('Unfollow @%channelName%', { channelName }) + : __('Follow @%channelName%', { channelName }) + : isSubscribed + ? __('Unfollow') + : __('Follow'); const lastCollectionName = 'Favorites'; const lastCollectionId = COLLECTIONS_CONSTS.FAVORITES_ID; diff --git a/ui/component/claimPreview/claim-preview-loading.jsx b/ui/component/claimPreview/claim-preview-loading.jsx index 53f3ade50..e7d313d7f 100644 --- a/ui/component/claimPreview/claim-preview-loading.jsx +++ b/ui/component/claimPreview/claim-preview-loading.jsx @@ -14,6 +14,7 @@ function ClaimPreviewLoading(props: Props) { className={classnames('claim-preview__wrapper', { 'claim-preview__wrapper--channel': isChannel && type !== 'inline', 'claim-preview__wrapper--inline': type === 'inline', + 'claim-preview__wrapper--small': type === 'small', })} >
diff --git a/ui/component/claimTilesDiscover/view.jsx b/ui/component/claimTilesDiscover/view.jsx index 069c8f7ca..a54c04a73 100644 --- a/ui/component/claimTilesDiscover/view.jsx +++ b/ui/component/claimTilesDiscover/view.jsx @@ -114,7 +114,6 @@ type Props = { renderProperties?: (Claim) => ?Node, liveLivestreamsFirst?: boolean, livestreamMap?: { [string]: any }, - pin?: boolean, pinUrls?: Array, showNoSourceClaims?: boolean, }; @@ -147,7 +146,6 @@ function ClaimTilesDiscover(props: Props) { mutedUris, liveLivestreamsFirst, livestreamMap, - pin, pinUrls, prefixUris, showNoSourceClaims, @@ -291,9 +289,9 @@ function ClaimTilesDiscover(props: Props) { }; const modifiedUris = uris ? uris.slice() : []; - const fixUris = pinUrls || ['lbry://@AlisonMorrow#6/LBRY#8']; + const fixUris = pinUrls || []; - if (pin && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') { + if (pinUrls && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') { fixUris.forEach((fixUri) => { if (modifiedUris.indexOf(fixUri) !== -1) { modifiedUris.splice(modifiedUris.indexOf(fixUri), 1); @@ -308,7 +306,13 @@ function ClaimTilesDiscover(props: Props) {
    {modifiedUris && modifiedUris.length ? modifiedUris.map((uri, index) => ( - + )) : new Array(pageSize) .fill(1) diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx index 12028b6de..bdf515e4e 100644 --- a/ui/component/commentCreate/view.jsx +++ b/ui/component/commentCreate/view.jsx @@ -42,7 +42,9 @@ type Props = { isReply: boolean, activeChannel: string, activeChannelClaim: ?ChannelClaim, + bottom: boolean, livestream?: boolean, + embed?: boolean, toast: (string) => void, claimIsMine: boolean, sendTip: ({}, (any) => void, (any) => void) => void, @@ -63,7 +65,9 @@ export function CommentCreate(props: Props) { isReply, parentId, activeChannelClaim, + bottom, livestream, + embed, claimIsMine, sendTip, doToast, @@ -106,7 +110,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(); } @@ -147,8 +151,6 @@ export function CommentCreate(props: Props) { const activeChannelName = activeChannelClaim && activeChannelClaim.name; const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id; - console.log(activeChannelClaim); - setIsSubmitting(true); if (activeTab === TAB_LBC) { @@ -280,6 +282,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 +351,7 @@ export function CommentCreate(props: Props) { className={classnames('comment__create', { 'comment__create--reply': isReply, 'comment__create--nested-reply': isNested, + 'comment__create--bottom': bottom, })} > ), + [ICONS.MUSIC]: buildIcon( + + + + + + + ), }; diff --git a/ui/component/fileReactions/view.jsx b/ui/component/fileReactions/view.jsx index 7221b40ea..e8c10ae4f 100644 --- a/ui/component/fileReactions/view.jsx +++ b/ui/component/fileReactions/view.jsx @@ -1,10 +1,12 @@ // @flow +import * as REACTION_TYPES from 'constants/reactions'; import * as ICONS from 'constants/icons'; import React from 'react'; import classnames from 'classnames'; import Button from 'component/button'; import { formatNumberWithCommas } from 'util/number'; import NudgeFloating from 'component/nudgeFloating'; +import { SIMPLE_SITE } from 'config'; type Props = { claim: StreamClaim, @@ -15,18 +17,51 @@ type Props = { likeCount: number, dislikeCount: number, myReaction: ?string, + livestream?: boolean, }; function FileReactions(props: Props) { - const { claim, uri, doFetchReactions, doReactionLike, doReactionDislike, likeCount, dislikeCount } = props; + const { + claim, + uri, + doFetchReactions, + doReactionLike, + doReactionDislike, + myReaction, + likeCount, + dislikeCount, + livestream, + } = props; + const claimId = claim && claim.claim_id; const channel = claim && claim.signing_channel && claim.signing_channel.name; const isCollection = claim && claim.value_type === 'collection'; // hack because nudge gets cut off by card on cols. + const likeIcon = SIMPLE_SITE ? (myReaction === REACTION_TYPES.LIKE ? ICONS.FIRE_ACTIVE : ICONS.FIRE) : ICONS.UPVOTE; + const dislikeIcon = SIMPLE_SITE + ? myReaction === REACTION_TYPES.DISLIKE + ? ICONS.SLIME_ACTIVE + : ICONS.SLIME + : ICONS.DOWNVOTE; React.useEffect(() => { - 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 +76,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 && SIMPLE_SITE && ( + <> +
    +
    +
    +
    +
    +
    +
    + + )} + {formatNumberWithCommas(likeCount, 0)} + + } iconSize={18} - icon={ICONS.UPVOTE} + icon={likeIcon} onClick={() => doReactionLike(uri)} /> {isInApp && }
    diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx index c5ee304d0..09a4753c6 100644 --- a/ui/component/header/view.jsx +++ b/ui/component/header/view.jsx @@ -1,5 +1,5 @@ // @flow -import { LOGO_TITLE, ENABLE_NO_SOURCE_CLAIMS, CHANNEL_STAKED_LEVEL_LIVESTREAM, ENABLE_UI_NOTIFICATIONS } from 'config'; +import { ENABLE_NO_SOURCE_CLAIMS, CHANNEL_STAKED_LEVEL_LIVESTREAM, ENABLE_UI_NOTIFICATIONS } from 'config'; import * as ICONS from 'constants/icons'; import { SETTINGS } from 'lbry-redux'; import * as PAGES from 'constants/pages'; @@ -16,6 +16,7 @@ import NotificationBubble from 'component/notificationBubble'; import NotificationHeaderButton from 'component/notificationHeaderButton'; import ChannelThumbnail from 'component/channelThumbnail'; import SkipNavigationButton from 'component/skipNavigationButton'; +import Logo from 'component/logo'; // @if TARGET='app' import { remote } from 'electron'; import { IS_MAC } from 'component/app/view'; @@ -254,15 +255,8 @@ const Header = (props: Props) => { )} {!authHeader && (
    {/* @if TARGET='app' */} diff --git a/ui/component/livestreamLayout/view.jsx b/ui/component/livestreamLayout/view.jsx index 92c44fb71..5c1de8097 100644 --- a/ui/component/livestreamLayout/view.jsx +++ b/ui/component/livestreamLayout/view.jsx @@ -1,5 +1,5 @@ // @flow -import { BITWAVE_EMBED_URL } from 'constants/livestream'; +import { LIVESTREAM_EMBED_URL } from 'constants/livestream'; import React from 'react'; import FileTitleSection from 'component/fileTitleSection'; import LivestreamComments from 'component/livestreamComments'; @@ -29,7 +29,7 @@ export default function LivestreamLayout(props: Props) {