Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60ec0468e6 |
No files matched your search
@@ -30,7 +30,6 @@ YRBL_SAD_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649
|
||||
ENABLE_COMMENT_REACTIONS=true
|
||||
ENABLE_FILE_REACTIONS=false
|
||||
ENABLE_CREATOR_REACTIONS=false
|
||||
ENABLE_NO_SOURCE_CLAIMS=false
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4
|
||||
|
||||
# OG
|
||||
|
||||
@@ -72,8 +72,6 @@ jobs:
|
||||
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: true
|
||||
ENABLE_NO_SOURCE_CLAIMS: false
|
||||
|
||||
DEFAULT_LANGUAGE: en
|
||||
KNOWN_APP_DOMAINS: lbry.tv,lbry.lat,odysee.com
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: 0
|
||||
|
||||
@@ -4,32 +4,11 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [Unreleased for Desktop]
|
||||
## [Unreleased on desktop]
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
- Keyboard shortcut additions and changes _community pr!_ ([#5717](https://github.com/lbryio/lbry-desktop/pull/5717))
|
||||
- Removed the 10k character-limit when editing _Posts_ ([#5719](https://github.com/lbryio/lbry-desktop/pull/5719))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Autoplay looping to a previous video or itself ([#5711](https://github.com/lbryio/lbry-desktop/pull/5711))
|
||||
- Autoplay not working in mini-player mode ([#5716](https://github.com/lbryio/lbry-desktop/pull/5716))
|
||||
|
||||
## [0.50.1] - [2021-03-18]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Upgrade modal extended beyond the height of the app ([#5709](https://github.com/lbryio/lbry-desktop/pull/5709))
|
||||
|
||||
## [0.50.0] - [2021-03-18]
|
||||
|
||||
### Added
|
||||
|
||||
- New moderation tools: block & mute ([#5572](https://github.com/lbryio/lbry-desktop/pull/5572))
|
||||
- Improved markdown file styling ([#5659](https://github.com/lbryio/lbry-desktop/pull/5659))
|
||||
- Wallet balance UI improvements ([#5276](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Mass tip unlock ([#5409](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Zoomable image viewer in Markdown (posts and comments) _community pr!_ ([#5387](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Enable PDF Viewer in App _community pr!_ ([#2903](https://github.com/lbryio/lbry-desktop/issues/2903))
|
||||
@@ -39,7 +18,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated lbry-sdk to [0.92.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.92.0)
|
||||
- Re-enable PDF Viewer in desktop app _community pr!_ ([#5420](https://github.com/lbryio/lbry-desktop/issues/5420))
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -35,7 +35,6 @@ const config = {
|
||||
ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true',
|
||||
ENABLE_FILE_REACTIONS: process.env.ENABLE_FILE_REACTIONS === 'true',
|
||||
ENABLE_CREATOR_REACTIONS: process.env.ENABLE_CREATOR_REACTIONS === 'true',
|
||||
ENABLE_NO_SOURCE_CLAIMS: process.env.ENABLE_NO_SOURCE_CLAIMS === 'true',
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: process.env.CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS,
|
||||
SIMPLE_SITE: process.env.SIMPLE_SITE === 'true',
|
||||
SHOW_ADS: process.env.SHOW_ADS === 'true',
|
||||
|
||||
@@ -4,12 +4,12 @@ declare type HomepageObject = {
|
||||
options: any,
|
||||
route: string,
|
||||
title: string,
|
||||
};
|
||||
}
|
||||
|
||||
declare type HomepageData = {
|
||||
[string]: HomepageObject,
|
||||
default: any => any,
|
||||
};
|
||||
}
|
||||
|
||||
declare type RowDataItem = {
|
||||
title: any,
|
||||
@@ -19,7 +19,6 @@ declare type RowDataItem = {
|
||||
extra?: any,
|
||||
options?: {
|
||||
channelIds?: Array<string>,
|
||||
limitClaimsPerChannel?: number,
|
||||
pageSize: number,
|
||||
},
|
||||
route?: string,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.50.1",
|
||||
"version": "0.49.4",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
@@ -142,7 +142,7 @@
|
||||
"imagesloaded": "^4.1.4",
|
||||
"json-loader": "^0.5.4",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#9a1701372829c21cefbedacfc6033aec4dc7fa3c",
|
||||
"lbry-redux": "lbryio/lbry-redux#bf728f8716385749370de9a1edee50b267d61fa4",
|
||||
"lbryinc": "lbryio/lbryinc#7faea40d87b78ec91b901c62f501499dc4737025",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
@@ -225,7 +225,7 @@
|
||||
"yarn": "^1.3"
|
||||
},
|
||||
"lbrySettings": {
|
||||
"lbrynetDaemonVersion": "0.92.0",
|
||||
"lbrynetDaemonVersion": "0.88.0",
|
||||
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
||||
"lbrynetDaemonDir": "static/daemon",
|
||||
"lbrynetDaemonFileName": "lbrynet",
|
||||
|
||||
@@ -316,7 +316,6 @@
|
||||
"This file is downloaded.": "This file is downloaded.",
|
||||
"Featured content. Earn rewards for watching.": "Featured content. Earn rewards for watching.",
|
||||
"You are subscribed to this channel.": "You are subscribed to this channel.",
|
||||
"Your settings.": "Your settings.",
|
||||
"Remove from your library": "Remove from your library",
|
||||
"View tag": "View tag",
|
||||
"Customize Your Tags": "Customize Your Tags",
|
||||
@@ -424,9 +423,6 @@
|
||||
"Redeem a custom reward code for": "Redeem a custom reward code for",
|
||||
"Redeem": "Redeem",
|
||||
"Code": "Code",
|
||||
"reward code not found": "reward code not found",
|
||||
"reward code required": "reward code required",
|
||||
"this code has expired": "this code has expired",
|
||||
"Nothing here": "Nothing here",
|
||||
"Upload something and claim this spot!": "Upload something and claim this spot!",
|
||||
"File Size": "File Size",
|
||||
@@ -606,7 +602,6 @@
|
||||
"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 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 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%",
|
||||
"You haven't downloaded anything from LBRY yet": "You haven't downloaded anything from LBRY yet",
|
||||
@@ -718,7 +713,6 @@
|
||||
"Are you sure you'd like to remove %title% from LBRY?": "Are you sure you'd like to remove %title% from LBRY?",
|
||||
"reclaim %amount%": "reclaim %amount%",
|
||||
"Abandon on blockchain (%lbc%)": "Abandon on 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.",
|
||||
"Show this channel your appreciation by sending a donation.": "Show this channel your appreciation by sending a donation.",
|
||||
"LBRY Link": "LBRY Link",
|
||||
@@ -761,7 +755,6 @@
|
||||
"Invite sent to %email_address%": "Invite sent to %email_address%",
|
||||
"Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.": "Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.",
|
||||
"Earn %lbc% for inviting a friend, an enemy, a frenemy, or an enefriend. Everyone needs content freedom.": "Earn %lbc% for inviting a friend, an enemy, a frenemy, or an enefriend. Everyone needs content freedom.",
|
||||
"You earned %lbc% for helping LBRY grow. Friendship is magic.": "You earned %lbc% for helping LBRY grow. Friendship is magic.",
|
||||
"This content requires LBRY Desktop to display.": "This content requires LBRY Desktop to display.",
|
||||
"Get the App": "Get the App",
|
||||
"Get The App": "Get The App",
|
||||
@@ -858,6 +851,7 @@
|
||||
"Tag selection": "Tag selection",
|
||||
"Select some tags to help us show you interesting things.": "Select some tags to help us show you interesting things.",
|
||||
"You are currently following %followingCount% tags": "You are currently following %followingCount% tags",
|
||||
"You are currently following %followingCount% tag": "You are currently following %followingCount% tag",
|
||||
"Back": "Back",
|
||||
"Experimental Transcoding": "Experimental Transcoding",
|
||||
"A Folder containing FFmpeg": "A Folder containing FFmpeg",
|
||||
@@ -886,7 +880,6 @@
|
||||
"Total Staked Amount": "Total Staked Amount",
|
||||
"Set Inviter": "Set Inviter",
|
||||
"Change Inviter": "Change Inviter",
|
||||
"Reward claimed.": "Reward claimed.",
|
||||
"You haven't uploaded anything yet. This is where you can find them when you do!": "You haven't uploaded anything yet. This is where you can find them when you do!",
|
||||
"You haven't uploaded anything with this channel yet!": "You haven't uploaded anything with this channel yet!",
|
||||
"You haven't uploaded anything": "You haven't uploaded anything",
|
||||
@@ -919,7 +912,6 @@
|
||||
"Embed this content": "Embed this content",
|
||||
"More actions": "More actions",
|
||||
"music": "music",
|
||||
"Music": "Music",
|
||||
"Transactions": "Transactions",
|
||||
"Payment": "Payment",
|
||||
"Stream": "Stream",
|
||||
@@ -963,9 +955,6 @@
|
||||
"Successfully abandoned your support.": "Successfully abandoned your support.",
|
||||
"Transaction failed": "Transaction failed",
|
||||
"Insufficient credits": "Insufficient credits",
|
||||
"Error abandoning your claim/support": "Error abandoning your claim/support",
|
||||
"Error unlocking your tip": "Error unlocking your tip",
|
||||
"You deposited %lbc% as a support!": "You deposited %lbc% as a support!",
|
||||
"You deposited %amount% LBRY Credits as a support!": "You deposited %amount% LBRY Credits as a support!",
|
||||
"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",
|
||||
@@ -1171,13 +1160,12 @@
|
||||
"Changelog": "Changelog",
|
||||
"Boost your content": "Boost your content",
|
||||
"Boost This Video": "Boost This Video",
|
||||
"Boost This Content": "Boost This Content",
|
||||
"Boost": "Boost",
|
||||
"Send Revocable Support": "Send Revocable Support",
|
||||
"Send a %amount% Tip": "Send a %amount% Tip",
|
||||
"Channel to show support as": "Channel to show support as",
|
||||
"Buy more LBRY Credits": "Buy more LBRY Credits",
|
||||
"Support this content": "Support this content",
|
||||
"Make this a tip": "Make this a tip",
|
||||
"Custom support amount": "Custom support amount",
|
||||
"(%lbc_balance% Credits available)": "(%lbc_balance% Credits available)",
|
||||
"Loading your channels...": "Loading your channels...",
|
||||
@@ -1210,11 +1198,6 @@
|
||||
"CableTube Escape Artists": "CableTube Escape Artists",
|
||||
"Unlink YouTube Channel": "Unlink YouTube Channel",
|
||||
"Log In With YouTube": "Log In With YouTube",
|
||||
"You're free!": "You're free!",
|
||||
"Welcome to Odysee": "Welcome to Odysee",
|
||||
"You've escaped the land of spying, censorship, and exploitation.": "You've escaped the land of spying, censorship, and exploitation.",
|
||||
"Welcome to the land of content freedom.": "Welcome to the land of content freedom.",
|
||||
"You make the party extra special!": "You make the party extra special!",
|
||||
"Cover": "Cover",
|
||||
"A name is required for your url": "A name is required for your url",
|
||||
"Create Channel": "Create Channel",
|
||||
@@ -1279,18 +1262,16 @@
|
||||
"Unmute": "Unmute",
|
||||
"Manage notifications": "Manage notifications",
|
||||
"Uploads": "Uploads",
|
||||
"All uploads": "All uploads",
|
||||
"Advanced settings": "Advanced settings",
|
||||
"Browse": "Browse",
|
||||
"Automatic transcoding": "Automatic transcoding",
|
||||
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'.": "Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'.",
|
||||
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If mature content, ensure it is tagged mature. Tag abuse and missing mature tags will not be tolerated.": "Add tags that are relevant to your content so those who're looking for it can find it more easily. If mature content, ensure it is tagged mature. Tag abuse and missing mature tags will not be tolerated.",
|
||||
"%site_name% Terms of Service": "%site_name% Terms of Service",
|
||||
"Descriptive titles work best": "Descriptive titles work best",
|
||||
"What is your content about? Use this space to include any other relevant details you may like to share about your content and channel.": "What is your content about? Use this space to include any other relevant details you may like to share about your content and channel.",
|
||||
"Nothing uploaded to LBRY yet.": "Nothing uploaded to LBRY yet.",
|
||||
"Copyright notice": "Copyright notice",
|
||||
"Upload complete.": "Upload complete.",
|
||||
"Upload Complete": "Upload Complete",
|
||||
"Uploading": "Uploading",
|
||||
"View My Uploads": "View My Uploads",
|
||||
"No recent uploads": "No recent uploads",
|
||||
@@ -1334,7 +1315,6 @@
|
||||
"Tech": "Tech",
|
||||
"Lab": "Lab",
|
||||
"Technology": "Technology",
|
||||
"Movies": "Movies",
|
||||
"News": "News",
|
||||
"News & Politics": "News & Politics",
|
||||
"Finance 2.0": "Finance 2.0",
|
||||
@@ -1349,7 +1329,6 @@
|
||||
"Daily watch reminders": "Daily watch reminders",
|
||||
"New content": "New content",
|
||||
"No notifications": "No notifications",
|
||||
"Try selecting another filter.": "Try selecting another filter.",
|
||||
"You don't have any notifications yet, but they will be here when you do!": "You don't have any notifications yet, but they will be here when you do!",
|
||||
"I like this": "I like this",
|
||||
"I dislike this": "I dislike this",
|
||||
@@ -1416,25 +1395,18 @@
|
||||
"Never fear though, there are tons of ways to earn %lbc%. You can earn or purchase %lbc%, or you can have your friends send you some.": "Never fear though, there are tons of ways to earn %lbc%. You can earn or purchase %lbc%, or you can have your friends send you some.",
|
||||
"gaming, comedy, educational": "gaming, comedy, educational",
|
||||
"A channel is required to comment on %SITE_NAME%": "A channel is required to comment on %SITE_NAME%",
|
||||
"A channel is required to comment on lbry.tv": "A channel is required to comment on lbry.tv",
|
||||
"A welcome bonus and thank you for your contribution to content freedom.": "A welcome bonus and thank you for your contribution to content freedom.",
|
||||
"You earned %lbc% new user reward.": "You earned %lbc% LBC new user reward.",
|
||||
"Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.": "Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.",
|
||||
"Claim your channel! Create an identity used to securely publish content.": "Claim your channel! Create an identity used to securely publish content.",
|
||||
"You earned %lbc% for creating a channel.": "You earned %lbc% for creating a channel.",
|
||||
"Launch your own channel by sharing a video.": "Launch your own channel by sharing a video.",
|
||||
"You earned %lbc% for making your first upload.": "You earned %lbc% for making your first upload.",
|
||||
"Your First Credit:": "Your First Credit:",
|
||||
"Return to the app 24-48 hours following your first use of the app. This reward will self destruct after that time span.": "Return to the app 24-48 hours following your first use of the app. This reward will self destruct after that time span.",
|
||||
"Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 2). Only up to 10 views per day count.": "Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 2). Only up to 10 views per day count.",
|
||||
"Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 1).": "Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 1).",
|
||||
"A small amount of Credits to get you started.": "A small amount of Credits to get you started.",
|
||||
"Gain a following to earn this reward. 1 validated followers needed for level 1 (Current Score: 0). This amount may not match your total followers.": "Gain a following to earn this reward. 1 validated followers needed for level 1 (Current Score: 0). This amount may not match your total followers.",
|
||||
"Some extra Credits for you and the person that brought you to us.": "Some extra Credits for you and the person that brought you to us.",
|
||||
"Daily Watch Reward": "Daily Watch Reward",
|
||||
"You earned %lbc% for looking at neat stuff. ": "You earned %lbc% for looking at neat stuff. ",
|
||||
"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.",
|
||||
"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",
|
||||
@@ -1443,18 +1415,12 @@
|
||||
"Channel Surfing": "Channel Surfing",
|
||||
"First Upload": "First Upload",
|
||||
"Welcome Back": "Welcome Back",
|
||||
"You earned %lbc% for coming back.": "You earned %lbc% for coming back.",
|
||||
"Email Verified": "Email Verified",
|
||||
"A small amount of LBC to get you started.": "A small amount of LBC to get you started.",
|
||||
"You earned %lbc% for adding your email.": "You earned %lbc% for adding your email.",
|
||||
"Inviter Bonus": "Inviter Bonus",
|
||||
"Some extra LBC for you and the person that brought you to us.": "Some extra LBC for you and the person that brought you to us.",
|
||||
"You earned %lbc% reward for you and your friend.": "You earned %lbc% LBC reward for you and your friend.",
|
||||
"Daily Watch Reward": "Daily Watch Reward",
|
||||
"Odyseenaut": "Odyseenaut",
|
||||
"Watch 10 things, like 5 things, and leave a comment on odysee.com.": "Watch 10 things, like 5 things, and leave a comment on odysee.com.",
|
||||
"You earned %lbc% for trying out Odysee.": "You earned %lbc% for trying out Odysee.",
|
||||
"Earn an upgrade reward with each LBRY update. Patches will not trigger a new reward.": "Earn an upgrade reward with each LBRY update. Patches will not trigger a new reward.",
|
||||
"You earned %lbc% for upgrading to the latest release of LBRY.": "You earned %lbc% LBC for upgrading to the latest release of LBRY.",
|
||||
"Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 1). Only up to 10 views per day count.": "Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 1). Only up to 10 views per day count.",
|
||||
"Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 12).": "Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 12).",
|
||||
"Create A Channel": "Create A Channel",
|
||||
@@ -1479,29 +1445,12 @@
|
||||
"You earned %lbc% for successfully completing Coveted Creator L3: Score of Subs.": "You earned %lbc% for successfully completing Coveted Creator L3: Score of Subs.",
|
||||
"You earned %lbc% for successfully completing Coveted Creator L2: High Five.": "You earned %lbc% for successfully completing Coveted Creator L2: High Five.",
|
||||
"You earned %lbc% for successfully completing Coveted Creator L1: Loneliest Number.": "You earned %lbc% for successfully completing Coveted Creator L1: Loneliest Number.",
|
||||
"Favorite Five 🖐️": "Favorite Five 🖐️",
|
||||
"When creators repost other creators, it makes a delicious shared audience fondue. Repost 5 of your favorite creators with the qualified channel.": "When creators repost other creators, it makes a delicious shared audience fondue. Repost 5 of your favorite creators with the qualified channel.",
|
||||
"You earned %lbc% for reposting your favorite creators.": "You earned %lbc% for reposting your favorite creators.",
|
||||
"\uD83C\uDF81 Treats are available": "\uD83C\uDF81 Treats are available",
|
||||
"Claiming your daily reward is as easy as pressing this bell \uD83D\uDD14": "Claiming your daily reward is as easy as pressing this bell \uD83D\uDD14",
|
||||
"Press ▶️ for \uD83C\uDF81": "Press ▶️ for \uD83C\uDF81",
|
||||
"Your daily watch reward is ready": "Your daily watch reward is ready",
|
||||
"Subscribe and s̶̶a̶̶v̶̶e̶ Earn": "Subscribe and s̶̶a̶̶v̶̶e̶ Earn",
|
||||
"Follow your first channel for a reward \uD83C\uDF81": "Follow your first channel for a reward \uD83C\uDF81",
|
||||
"Free LBC?": "Free LBC?",
|
||||
"You missed out on the daily view reward, sign up for our rewards program!": "You missed out on the daily view reward, sign up for our rewards program!",
|
||||
"A Welcome \uD83C\uDF81": "A Welcome \uD83C\uDF81",
|
||||
"Receive free credits for using LBRY": "Receive free credits for using LBRY",
|
||||
"Watch more content to get to the next level.": "Watch more content to get to the next level.",
|
||||
"Follow more channels to reach the next level.": "Follow more channels to reach the next level.",
|
||||
"You need to improve the cool-aid (gain more followers) to get to the next level.": "You need to improve the cool-aid (gain more followers) to get to the next level.",
|
||||
"A channel is required to repost on %SITE_NAME%": "A channel is required to repost on %SITE_NAME%",
|
||||
"A channel is required to repost on lbry.tv": "A channel is required to repost on lbry.tv",
|
||||
"No channels": "No channels",
|
||||
"You haven't created a channel yet. All of your beautiful channels will be listed here!": "You haven't created a channel yet. All of your beautiful channels will be listed here!",
|
||||
"Something didn't work. Please try again.": "Something didn't work. Please try again.",
|
||||
"Sync your YouTube channel to %site_name%": "Sync your YouTube channel to %site_name%",
|
||||
"You earned %lbc% for syncing your YouTube channel.": "You earned %lbc% for syncing your YouTube channel.",
|
||||
"Get your YouTube videos in front of the %site_name% audience.": "Get your YouTube videos in front of the %site_name% audience.",
|
||||
"Your %site_name% channel name": "Your %site_name% channel name",
|
||||
"these terms": "these terms",
|
||||
@@ -1544,7 +1493,6 @@
|
||||
"Pin": "Pin",
|
||||
"Unpin": "Unpin",
|
||||
"LBRY leveled up": "LBRY leveled up",
|
||||
"Channel language": "Channel language",
|
||||
"Primary Language": "Primary Language",
|
||||
"Your main content language": "Your main content language",
|
||||
"None selected": "None selected",
|
||||
@@ -1557,7 +1505,6 @@
|
||||
"Watch on lbry.tv": "Watch on lbry.tv",
|
||||
"Paid content cannot be embedded.": "Paid content cannot be embedded.",
|
||||
"Please wait a bit, we are still getting your account ready.": "Please wait a bit, we are still getting your account ready.",
|
||||
"this channel is connected to a different account. Contact hello@lbry.com for help.": "this channel is connected to a different account. Contact hello@lbry.com for help.",
|
||||
"Most supported": "Most supported",
|
||||
"Most Supported": "Most Supported",
|
||||
"Search Results": "Search Results",
|
||||
@@ -1597,7 +1544,6 @@
|
||||
"Try refreshing to fix the issue. If that doesn't work, email %SITE_HELP_EMAIL% for support.": "Try refreshing to fix the issue. If that doesn't work, email %SITE_HELP_EMAIL% for support.",
|
||||
"Content preview": "Content preview",
|
||||
"Repost url": "Repost url",
|
||||
"Repost URL": "Repost URL",
|
||||
"Close sidebar - hide channels you are following": "Close sidebar - hide channels you are following",
|
||||
"Expand sidebar - view channels you are following.": "Expand sidebar - view channels you are following.",
|
||||
"You have found the edge of the internet. %repost% or %publish% your stuff here to claim this spot.": "You have found the edge of the internet. %repost% or %publish% your stuff here to claim this spot.",
|
||||
@@ -1638,7 +1584,7 @@
|
||||
"%balance% available.": "%balance% available.",
|
||||
"Unlock all tips": "Unlock all tips",
|
||||
"Unlock All": "Unlock All",
|
||||
"Obviously, You're Not A Golfer.": "Obviously, You're Not A Golfer.",
|
||||
"Yeah, well, that's just, like, your opinion, man.": "Yeah, well, that's just, like, your opinion, man.",
|
||||
"Moon cheese is an acquired taste": "Moon cheese is an acquired taste",
|
||||
"Level %current_level%": "Level %current_level%",
|
||||
"Creator tools": "Creator tools",
|
||||
@@ -1665,36 +1611,6 @@
|
||||
"Exit Fullscreen (f)": "Exit Fullscreen (f)",
|
||||
"Toggle Theater mode (t)": "Toggle Theater mode (t)",
|
||||
"Quality": "Quality",
|
||||
"Announcements, updates, and rewards specific to users of LBRY Android.": "Announcements, updates, and rewards specific to users of LBRY Android.",
|
||||
"LBRY has special programs and opportunities for people in school.": "LBRY has special programs and opportunities for people in school.",
|
||||
"Creator specific news, automated reports, and other updates.": "Creator specific news, automated reports, and other updates.",
|
||||
"Get notified when other channels repost your content.": "Get notified when other channels repost your content.",
|
||||
"Technical updates and other news for software engineers and technical users.": "Technical updates and other news for software engineers and technical users.",
|
||||
"Be an iOS alpha tester, earn LBC, and receive notification when the app goes live!": "Be an iOS alpha tester, earn LBC, and receive notification when the app goes live!",
|
||||
"News and updates from LBRY": "News and updates from LBRY",
|
||||
"Announcements, updates, and rewards specific to users of LBRY Desktop": "Announcements, updates, and rewards specific to users of LBRY Desktop",
|
||||
"Communications about lbry.org, the community-owned and operated LBRY group": "Communications about lbry.org, the community-owned and operated LBRY group",
|
||||
"Announcements, updates, and rewards specific to users of lbry.tv": "Announcements, updates, and rewards specific to users of lbry.tv",
|
||||
"Receive emails about the latest rewards that are available to LBRY users.": "Receive emails about the latest rewards that are available to LBRY users.",
|
||||
"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",
|
||||
"--end--": "--end--",
|
||||
"Create A LiveStream": "Create A LiveStream",
|
||||
"%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.",
|
||||
"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.",
|
||||
"Live stream in progress": "Live stream in progress",
|
||||
"Live discussion": "Live discussion",
|
||||
"Livestream": "Livestream",
|
||||
"Your stream key": "Your stream key",
|
||||
"Stream server": "Stream server",
|
||||
"Stream key": "Stream key",
|
||||
"Your livestream uploads": "Your livestream uploads",
|
||||
"No livestream publishes found": "No livestream publishes found",
|
||||
"You need to upload your livestream details before you can go live.": "You need to upload your livestream details before you can go live.",
|
||||
"Create A Livestream": "Create A Livestream",
|
||||
"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",
|
||||
"lbry.tv is being retired in favor of %odysee%": "lbry.tv is being retired in favor of %odysee%",
|
||||
"You will have to switch to the %desktop_app% or %odysee% in the near future. Your existing login details will work on %odysee% and all of your %credits% and other settings will be there.": "You will have to switch to the %desktop_app% or %odysee% in the near future. Your existing login details will work on %odysee% and all of your %credits% and other settings will be there.",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -26,10 +26,10 @@ if (isProduction) {
|
||||
// @endif
|
||||
|
||||
type Analytics = {
|
||||
error: (string) => Promise<any>,
|
||||
error: string => Promise<any>,
|
||||
sentryError: ({} | string, {}) => Promise<any>,
|
||||
pageView: (string, ?string) => void,
|
||||
setUser: (Object) => void,
|
||||
setUser: Object => void,
|
||||
toggleInternal: (boolean, ?boolean) => void,
|
||||
apiLogView: (string, string, string, ?number, ?() => void) => Promise<any>,
|
||||
apiLogPublish: (ChannelClaim | StreamClaim) => void,
|
||||
@@ -39,9 +39,6 @@ type Analytics = {
|
||||
playerStartedEvent: (?boolean) => void,
|
||||
videoFetchDuration: (string, number) => void,
|
||||
videoStartEvent: (string, number) => void,
|
||||
adsFetchedEvent: () => void,
|
||||
adsReceivedEvent: (any) => void,
|
||||
adsErrorEvent: (any) => void,
|
||||
videoBufferEvent: (
|
||||
StreamClaim,
|
||||
{
|
||||
@@ -58,9 +55,9 @@ type Analytics = {
|
||||
emailVerifiedEvent: () => void,
|
||||
rewardEligibleEvent: () => void,
|
||||
startupEvent: () => void,
|
||||
purchaseEvent: (number) => void,
|
||||
readyEvent: (number) => void,
|
||||
openUrlEvent: (string) => void,
|
||||
purchaseEvent: number => void,
|
||||
readyEvent: number => void,
|
||||
openUrlEvent: string => void,
|
||||
};
|
||||
|
||||
type LogPublishParams = {
|
||||
@@ -78,8 +75,8 @@ if (window.localStorage.getItem(SHARE_INTERNAL) === 'true') internalAnalyticsEna
|
||||
// @endif
|
||||
|
||||
const analytics: Analytics = {
|
||||
error: (message) => {
|
||||
return new Promise((resolve) => {
|
||||
error: message => {
|
||||
return new Promise(resolve => {
|
||||
if (internalAnalyticsEnabled && isProduction) {
|
||||
return Lbryio.call('event', 'desktop_error', { error_message: message }).then(() => {
|
||||
resolve(true);
|
||||
@@ -90,9 +87,9 @@ const analytics: Analytics = {
|
||||
});
|
||||
},
|
||||
sentryError: (error, errorInfo) => {
|
||||
return new Promise((resolve) => {
|
||||
return new Promise(resolve => {
|
||||
if (internalAnalyticsEnabled && isProduction) {
|
||||
Sentry.withScope((scope) => {
|
||||
Sentry.withScope(scope => {
|
||||
scope.setExtras(errorInfo);
|
||||
const eventId = Sentry.captureException(error);
|
||||
resolve(eventId);
|
||||
@@ -117,7 +114,7 @@ const analytics: Analytics = {
|
||||
MatomoInstance.trackPageView(params);
|
||||
}
|
||||
},
|
||||
setUser: (userId) => {
|
||||
setUser: userId => {
|
||||
if (internalAnalyticsEnabled && userId) {
|
||||
window._paq.push(['setUserId', String(userId)]);
|
||||
// @if TARGET='app'
|
||||
@@ -191,7 +188,7 @@ const analytics: Analytics = {
|
||||
}
|
||||
},
|
||||
|
||||
apiSyncTags: (params) => {
|
||||
apiSyncTags: params => {
|
||||
if (internalAnalyticsEnabled && isProduction) {
|
||||
Lbryio.call('content_tags', 'sync', params);
|
||||
}
|
||||
@@ -241,21 +238,12 @@ const analytics: Analytics = {
|
||||
});
|
||||
}
|
||||
},
|
||||
playerLoadedEvent: (embedded) => {
|
||||
playerLoadedEvent: embedded => {
|
||||
sendMatomoEvent('Player', 'Loaded', embedded ? 'embedded' : 'onsite');
|
||||
},
|
||||
playerStartedEvent: (embedded) => {
|
||||
playerStartedEvent: embedded => {
|
||||
sendMatomoEvent('Player', 'Started', embedded ? 'embedded' : 'onsite');
|
||||
},
|
||||
adsFetchedEvent: () => {
|
||||
sendMatomoEvent('Media', 'AdsFetched');
|
||||
},
|
||||
adsReceivedEvent: (response) => {
|
||||
sendMatomoEvent('Media', 'AdsReceived', JSON.stringify(response));
|
||||
},
|
||||
adsErrorEvent: (response) => {
|
||||
sendMatomoEvent('Media', 'AdsError', JSON.stringify(response));
|
||||
},
|
||||
tagFollowEvent: (tag, following) => {
|
||||
sendMatomoEvent('Tag', following ? 'Tag-Follow' : 'Tag-Unfollow', tag);
|
||||
},
|
||||
@@ -328,7 +316,7 @@ analytics.pageView(
|
||||
|
||||
// Listen for url changes and report
|
||||
// This will include search queries
|
||||
history.listen((location) => {
|
||||
history.listen(location => {
|
||||
const { pathname, search } = location;
|
||||
|
||||
const page = `${pathname}${search}`;
|
||||
|
||||
@@ -352,13 +352,7 @@ function App(props: Props) {
|
||||
// @endif
|
||||
|
||||
if (syncFatalError) {
|
||||
return (
|
||||
<SyncFatalError
|
||||
// @if TARGET='web'
|
||||
lbryTvApiStatus={lbryTvApiStatus}
|
||||
// @endif
|
||||
/>
|
||||
);
|
||||
return <SyncFatalError lbryTvApiStatus={lbryTvApiStatus} />;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -399,12 +393,12 @@ function App(props: Props) {
|
||||
|
||||
{/* @if TARGET='web' */}
|
||||
<YoutubeWelcome />
|
||||
{false && !shouldHideNag && <OpenInAppLink uri={uri} />}
|
||||
{!shouldHideNag && <OpenInAppLink uri={uri} />}
|
||||
{!shouldHideNag && <NagContinueFirstRun />}
|
||||
{(lbryTvApiStatus === STATUS_DEGRADED || lbryTvApiStatus === STATUS_FAILING) && !shouldHideNag && (
|
||||
<NagDegradedPerformance onClose={() => setLbryTvApiStatus(STATUS_OK)} />
|
||||
)}
|
||||
{false && lbryTvApiStatus === STATUS_OK && showAnalyticsNag && !shouldHideNag && (
|
||||
{lbryTvApiStatus === STATUS_OK && showAnalyticsNag && !shouldHideNag && (
|
||||
<NagDataCollection onClose={handleAnalyticsDismiss} />
|
||||
)}
|
||||
{/* @endif */}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { withRouter } from 'react-router';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { makeSelectClientSetting, selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
import ChannelPage from './view';
|
||||
|
||||
@@ -28,7 +28,7 @@ const select = (state, props) => {
|
||||
channelIsBlocked: makeSelectChannelIsMuted(props.uri)(state),
|
||||
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
showMature: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
tileLayout: makeSelectClientSetting(SETTINGS.TILE_LAYOUT)(state),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@ import Button from 'component/button';
|
||||
import ClaimListDiscover from 'component/claimListDiscover';
|
||||
import Ads from 'web/component/ads';
|
||||
import Icon from 'component/common/icon';
|
||||
import LivestreamLink from 'component/livestreamLink';
|
||||
import { Form, FormField } from 'component/common/form';
|
||||
import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search';
|
||||
import { lighthouse } from 'redux/actions/search';
|
||||
@@ -73,7 +72,7 @@ function ChannelContent(props: Props) {
|
||||
lighthouse
|
||||
.search(
|
||||
`s=${encodeURIComponent(searchQuery)}&channel_id=${encodeURIComponent(claimId)}${
|
||||
!showMature ? '&nsfw=false&size=50&from=0' : ''
|
||||
!showMature ? '&nsfw=false&size=25&from=0' : ''
|
||||
}`
|
||||
)
|
||||
.then((results) => {
|
||||
@@ -107,8 +106,6 @@ function ChannelContent(props: Props) {
|
||||
<HiddenNsfwClaims uri={uri} />
|
||||
)}
|
||||
|
||||
<LivestreamLink uri={uri} />
|
||||
|
||||
{!fetching && channelIsBlackListed && (
|
||||
<section className="card card--section">
|
||||
<p>
|
||||
@@ -132,12 +129,10 @@ function ChannelContent(props: Props) {
|
||||
|
||||
{claim && claimsInChannel > 0 ? (
|
||||
<ClaimListDiscover
|
||||
hideLivestreamClaims
|
||||
showHiddenByUser={viewHiddenChannels}
|
||||
forceShowReposts
|
||||
tileLayout={tileLayout}
|
||||
uris={searchResults}
|
||||
streamType={CS.CONTENT_ALL}
|
||||
channelIds={[claim.claim_id]}
|
||||
feeAmount={CS.FEE_AMOUNT_ANY}
|
||||
defaultOrderBy={CS.ORDER_BY_NEW}
|
||||
|
||||
@@ -20,7 +20,6 @@ import analytics from 'analytics';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import WalletSpendableBalanceHelp from 'component/walletSpendableBalanceHelp';
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
|
||||
const LANG_NONE = 'none';
|
||||
|
||||
@@ -359,7 +358,7 @@ function ChannelForm(props: Props) {
|
||||
<Card
|
||||
body={
|
||||
<TagsSearch
|
||||
suggestMature={!SIMPLE_SITE}
|
||||
suggestMature
|
||||
disableAutoFocus
|
||||
limitSelect={MAX_TAG_SELECT}
|
||||
tagsPassedIn={params.tags || []}
|
||||
|
||||
|
Before Width: | Height: | Size: 8.1 KiB |
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import classnames from 'classnames';
|
||||
import Spaceman from './spaceman.png';
|
||||
import Gerbil from './gerbil.png';
|
||||
import FreezeframeWrapper from 'component/fileThumbnail/FreezeframeWrapper';
|
||||
import ChannelStakedIndicator from 'component/channelStakedIndicator';
|
||||
|
||||
@@ -79,7 +79,7 @@ function ChannelThumbnail(props: Props) {
|
||||
<img
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__default"
|
||||
src={!thumbError && thumbnailPreview ? thumbnailPreview : Spaceman}
|
||||
src={!thumbError && thumbnailPreview ? thumbnailPreview : Gerbil}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
)}
|
||||
@@ -91,7 +91,7 @@ function ChannelThumbnail(props: Props) {
|
||||
<img
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__custom"
|
||||
src={!thumbError ? thumbnailPreview || thumbnail : Spaceman}
|
||||
src={!thumbError ? thumbnailPreview || thumbnail : Gerbil}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -38,7 +38,6 @@ type Props = {
|
||||
renderActions?: (Claim) => ?Node,
|
||||
searchInLanguage: boolean,
|
||||
hideMenu?: boolean,
|
||||
hideLivestreamClaims?: boolean,
|
||||
};
|
||||
|
||||
export default function ClaimList(props: Props) {
|
||||
@@ -64,7 +63,6 @@ export default function ClaimList(props: Props) {
|
||||
renderActions,
|
||||
searchInLanguage,
|
||||
hideMenu,
|
||||
hideLivestreamClaims,
|
||||
} = props;
|
||||
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||
@@ -103,14 +101,7 @@ export default function ClaimList(props: Props) {
|
||||
return tileLayout && !header ? (
|
||||
<section className="claim-grid">
|
||||
{urisLength > 0 &&
|
||||
uris.map((uri) => (
|
||||
<ClaimPreviewTile
|
||||
key={uri}
|
||||
uri={uri}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
/>
|
||||
))}
|
||||
uris.map((uri) => <ClaimPreviewTile key={uri} uri={uri} showHiddenByUser={showHiddenByUser} />)}
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
|
||||
{timedOut && timedOutMessage && <div className="empty main--empty">{timedOutMessage}</div>}
|
||||
</section>
|
||||
@@ -166,7 +157,6 @@ export default function ClaimList(props: Props) {
|
||||
renderActions={renderActions}
|
||||
showUserBlocked={showHiddenByUser}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
customShouldHide={(claim: StreamClaim) => {
|
||||
// Hack to hide spee.ch thumbnail publishes
|
||||
// If it meets these requirements, it was probably uploaded here:
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectShowMatureContent, selectLanguage } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import { selectModerationBlockList } from 'redux/selectors/comments';
|
||||
import ClaimListDiscover from './view';
|
||||
|
||||
@@ -18,7 +18,7 @@ const select = (state) => ({
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
claimSearchByQueryLastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: selectShowMatureContent(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
languageSetting: selectLanguage(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import type { Node } from 'react';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import React from 'react';
|
||||
@@ -23,7 +22,7 @@ type Props = {
|
||||
personalView: boolean,
|
||||
doToggleTagFollowDesktop: (string) => void,
|
||||
meta?: Node,
|
||||
// showNsfw: boolean,
|
||||
showNsfw: boolean,
|
||||
hideReposts: boolean,
|
||||
history: { action: string, push: (string) => void, replace: (string) => void },
|
||||
location: { search: string, pathname: string },
|
||||
@@ -46,7 +45,7 @@ type Props = {
|
||||
headerLabel?: string | Node,
|
||||
name?: string,
|
||||
hideAdvancedFilter?: boolean,
|
||||
claimType?: string | Array<string>,
|
||||
claimType?: Array<string>,
|
||||
defaultClaimType?: Array<string>,
|
||||
streamType?: string | Array<string>,
|
||||
defaultStreamType?: string | Array<string>,
|
||||
@@ -66,9 +65,6 @@ type Props = {
|
||||
searchInLanguage: boolean,
|
||||
scrollAnchor?: string,
|
||||
showHiddenByUser?: boolean,
|
||||
limitClaimsPerChannel?: number,
|
||||
releaseTime?: string,
|
||||
hideLivestreamClaims?: boolean,
|
||||
};
|
||||
|
||||
function ClaimListDiscover(props: Props) {
|
||||
@@ -81,7 +77,7 @@ function ClaimListDiscover(props: Props) {
|
||||
loading,
|
||||
meta,
|
||||
channelIds,
|
||||
// showNsfw,
|
||||
showNsfw,
|
||||
hideReposts,
|
||||
history,
|
||||
location,
|
||||
@@ -96,8 +92,8 @@ function ClaimListDiscover(props: Props) {
|
||||
claimType,
|
||||
pageSize,
|
||||
defaultClaimType,
|
||||
streamType = CS.FILE_VIDEO,
|
||||
defaultStreamType = CS.FILE_VIDEO,
|
||||
streamType,
|
||||
defaultStreamType,
|
||||
freshness,
|
||||
defaultFreshness = CS.FRESH_WEEK,
|
||||
renderProperties,
|
||||
@@ -116,11 +112,8 @@ function ClaimListDiscover(props: Props) {
|
||||
forceShowReposts = false,
|
||||
languageSetting,
|
||||
searchInLanguage,
|
||||
limitClaimsPerChannel,
|
||||
releaseTime,
|
||||
scrollAnchor,
|
||||
showHiddenByUser = false,
|
||||
hideLivestreamClaims,
|
||||
} = props;
|
||||
const didNavigateForward = history.action === 'PUSH';
|
||||
const { search } = location;
|
||||
@@ -159,12 +152,12 @@ function ClaimListDiscover(props: Props) {
|
||||
const durationParam = urlParams.get(CS.DURATION_KEY) || null;
|
||||
const channelIdsInUrl = urlParams.get(CS.CHANNEL_IDS_KEY);
|
||||
const channelIdsParam = channelIdsInUrl ? channelIdsInUrl.split(',') : channelIds;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount || CS.FEE_AMOUNT_ONLY_FREE;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount;
|
||||
const originalPageSize = pageSize || CS.PAGE_SIZE;
|
||||
const dynamicPageSize = isLargeScreen ? Math.ceil(originalPageSize * (3 / 2)) : originalPageSize;
|
||||
const historyAction = history.action;
|
||||
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy || orderParamEntry;
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
|
||||
|
||||
if (!orderParam) {
|
||||
if (historyAction === 'POP') {
|
||||
@@ -200,15 +193,12 @@ function ClaimListDiscover(props: Props) {
|
||||
not_channel_ids: Array<string>,
|
||||
order_by: Array<string>,
|
||||
release_time?: string,
|
||||
claim_type?: string | Array<string>,
|
||||
claim_type?: Array<string>,
|
||||
name?: string,
|
||||
duration?: string,
|
||||
reposted_claim_id?: string,
|
||||
stream_types?: any,
|
||||
fee_amount?: string,
|
||||
has_source?: boolean,
|
||||
has_no_source?: boolean,
|
||||
limit_claims_per_channel?: number,
|
||||
} = {
|
||||
page_size: dynamicPageSize,
|
||||
page,
|
||||
@@ -220,7 +210,7 @@ function ClaimListDiscover(props: Props) {
|
||||
not_channel_ids:
|
||||
// If channelIdsParam were passed in, we don't need not_channel_ids
|
||||
!channelIdsParam ? mutedAndBlockedChannelIds : [],
|
||||
not_tags: MATURE_TAGS,
|
||||
not_tags: !showNsfw ? MATURE_TAGS : [],
|
||||
order_by:
|
||||
orderParam === CS.ORDER_BY_TRENDING
|
||||
? CS.ORDER_BY_TRENDING_VALUE
|
||||
@@ -229,14 +219,6 @@ function ClaimListDiscover(props: Props) {
|
||||
: CS.ORDER_BY_TOP_VALUE, // Sort by top
|
||||
};
|
||||
|
||||
if (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === CS.CLAIM_STREAM)) {
|
||||
options.has_source = true;
|
||||
}
|
||||
|
||||
if (limitClaimsPerChannel) {
|
||||
options.limit_claims_per_channel = limitClaimsPerChannel;
|
||||
}
|
||||
|
||||
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
||||
options.fee_amount = feeAmountParam;
|
||||
}
|
||||
@@ -266,9 +248,7 @@ function ClaimListDiscover(props: Props) {
|
||||
options.reposted_claim_id = repostedClaimId;
|
||||
}
|
||||
|
||||
if (releaseTime) {
|
||||
options.release_time = releaseTime;
|
||||
} else if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
|
||||
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
||||
@@ -346,25 +326,9 @@ function ClaimListDiscover(props: Props) {
|
||||
|
||||
const hasMatureTags = tagsParam && tagsParam.split(',').some((t) => MATURE_TAGS.includes(t));
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
let claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
const claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
const claimSearchResultLastPageReached = claimSearchByQueryLastPageReached[claimSearchCacheQuery];
|
||||
|
||||
// uncomment to fix an item on a page
|
||||
// const fixUri = 'lbry://@corbettreport#0/lbryodysee#5';
|
||||
// if (
|
||||
// orderParam === CS.ORDER_BY_NEW &&
|
||||
// claimSearchResult &&
|
||||
// claimSearchResult.length > 2 &&
|
||||
// window.location.pathname === '/$/rabbithole'
|
||||
// ) {
|
||||
// if (claimSearchResult.indexOf(fixUri) !== -1) {
|
||||
// claimSearchResult.splice(claimSearchResult.indexOf(fixUri), 1);
|
||||
// } else {
|
||||
// claimSearchResult.pop();
|
||||
// }
|
||||
// claimSearchResult.splice(2, 0, fixUri);
|
||||
// }
|
||||
|
||||
const [prevOptions, setPrevOptions] = React.useState(null);
|
||||
|
||||
if (!isJustScrollingToNewPage(prevOptions, options)) {
|
||||
@@ -484,7 +448,7 @@ function ClaimListDiscover(props: Props) {
|
||||
claimType={claimType}
|
||||
streamType={streamType}
|
||||
defaultStreamType={defaultStreamType}
|
||||
// feeAmount={feeAmount}
|
||||
feeAmount={feeAmount}
|
||||
orderBy={orderBy}
|
||||
defaultOrderBy={defaultOrderBy}
|
||||
hideAdvancedFilter={hideAdvancedFilter}
|
||||
@@ -521,7 +485,6 @@ function ClaimListDiscover(props: Props) {
|
||||
includeSupportAction={includeSupportAction}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
/>
|
||||
{loading && (
|
||||
<div className="claim-grid">
|
||||
@@ -550,7 +513,6 @@ function ClaimListDiscover(props: Props) {
|
||||
includeSupportAction={includeSupportAction}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
/>
|
||||
{loading && new Array(dynamicPageSize).fill(1).map((x, i) => <ClaimPreview key={i} placeholder="loading" />)}
|
||||
</div>
|
||||
|
||||
@@ -2,14 +2,14 @@ import { connect } from 'react-redux';
|
||||
import { selectFetchingClaimSearch, SETTINGS } from 'lbry-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectShowMatureContent, selectLanguage } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import ClaimListHeader from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
const select = state => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: selectShowMatureContent(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
languageSetting: selectLanguage(state),
|
||||
});
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
makeSelectReflectingClaimForUri,
|
||||
makeSelectClaimWasPurchased,
|
||||
makeSelectStreamingUrlForUri,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
} from 'lbry-redux';
|
||||
import { selectMutedChannels, makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
@@ -39,7 +38,6 @@ const select = (state, props) => ({
|
||||
isSubscribed: props.uri && makeSelectIsSubscribed(props.uri, true)(state),
|
||||
streamingUrl: props.uri && makeSelectStreamingUrlForUri(props.uri)(state),
|
||||
wasPurchased: props.uri && makeSelectClaimWasPurchased(props.uri)(state),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
||||
@@ -24,7 +24,6 @@ import ClaimMenuList from 'component/claimMenuList';
|
||||
import ClaimPreviewLoading from './claim-preview-loading';
|
||||
import ClaimPreviewHidden from './claim-preview-no-mature';
|
||||
import ClaimPreviewNoContent from './claim-preview-no-content';
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -69,7 +68,6 @@ type Props = {
|
||||
hideRepostLabel?: boolean,
|
||||
repostUrl?: string,
|
||||
hideMenu?: boolean,
|
||||
isLivestream?: boolean,
|
||||
};
|
||||
|
||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
@@ -119,7 +117,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
renderActions,
|
||||
hideMenu = false,
|
||||
// repostUrl,
|
||||
isLivestream,
|
||||
} = props;
|
||||
const WrapperElement = wrapperElement || 'li';
|
||||
const shouldFetch =
|
||||
@@ -127,7 +124,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
const abandoned = !isResolvingUri && !claim;
|
||||
const shouldHideActions = hideActions || type === 'small' || type === 'tooltip';
|
||||
const canonicalUrl = claim && claim.canonical_url;
|
||||
|
||||
let isValid = false;
|
||||
if (uri) {
|
||||
try {
|
||||
@@ -205,7 +201,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
}
|
||||
}, [isValid, uri, isResolvingUri, shouldFetch, resolveUri]);
|
||||
|
||||
if ((shouldHide && !showNullPlaceholder) || (isLivestream && !ENABLE_NO_SOURCE_CLAIMS)) {
|
||||
if (shouldHide && !showNullPlaceholder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -249,110 +245,106 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
'claim-preview__wrapper--small': type === 'small',
|
||||
})}
|
||||
>
|
||||
<>
|
||||
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
|
||||
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
|
||||
|
||||
<div
|
||||
className={classnames('claim-preview', {
|
||||
'claim-preview--small': type === 'small' || type === 'tooltip',
|
||||
'claim-preview--large': type === 'large',
|
||||
'claim-preview--inline': type === 'inline',
|
||||
'claim-preview--tooltip': type === 'tooltip',
|
||||
'claim-preview--channel': isChannelUri,
|
||||
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--pending': pending,
|
||||
})}
|
||||
>
|
||||
{isChannelUri && claim ? (
|
||||
<UriIndicator uri={contentUri} link>
|
||||
<ChannelThumbnail uri={contentUri} />
|
||||
</UriIndicator>
|
||||
) : (
|
||||
<>
|
||||
{!pending ? (
|
||||
<NavLink {...navLinkProps}>
|
||||
<FileThumbnail thumbnail={thumbnailUrl}>
|
||||
{/* @if TARGET='app' */}
|
||||
{claim && (
|
||||
<div className="claim-preview__hover-actions">
|
||||
<FileDownloadLink uri={canonicalUrl} hideOpenButton hideDownloadStatus />
|
||||
</div>
|
||||
)}
|
||||
{/* @endif */}
|
||||
{!isRepost && !isChannelUri && !isLivestream && (
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<FileProperties uri={contentUri} small />
|
||||
</div>
|
||||
)}
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
<div
|
||||
className={classnames('claim-preview', {
|
||||
'claim-preview--small': type === 'small' || type === 'tooltip',
|
||||
'claim-preview--large': type === 'large',
|
||||
'claim-preview--inline': type === 'inline',
|
||||
'claim-preview--tooltip': type === 'tooltip',
|
||||
'claim-preview--channel': isChannelUri,
|
||||
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--pending': pending,
|
||||
})}
|
||||
>
|
||||
{isChannelUri && claim ? (
|
||||
<UriIndicator uri={contentUri} link>
|
||||
<ChannelThumbnail uri={contentUri} />
|
||||
</UriIndicator>
|
||||
) : (
|
||||
<>
|
||||
{!pending ? (
|
||||
<NavLink {...navLinkProps}>
|
||||
<FileThumbnail thumbnail={thumbnailUrl}>
|
||||
{/* @if TARGET='app' */}
|
||||
{claim && (
|
||||
<div className="claim-preview__hover-actions">
|
||||
<FileDownloadLink uri={canonicalUrl} hideOpenButton hideDownloadStatus />
|
||||
</div>
|
||||
)}
|
||||
{/* @endif */}
|
||||
{!isRepost && !isChannelUri && (
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<FileProperties uri={contentUri} small />
|
||||
</div>
|
||||
)}
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
) : (
|
||||
<FileThumbnail thumbnail={thumbnailUrl} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="claim-preview__text">
|
||||
<div className="claim-preview-metadata">
|
||||
<div className="claim-preview-info">
|
||||
{pending ? (
|
||||
<ClaimPreviewTitle uri={contentUri} />
|
||||
) : (
|
||||
<FileThumbnail thumbnail={thumbnailUrl} />
|
||||
<NavLink {...navLinkProps}>
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
</NavLink>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="claim-preview__text">
|
||||
<div className="claim-preview-metadata">
|
||||
<div className="claim-preview-info">
|
||||
{pending ? (
|
||||
<ClaimPreviewTitle uri={contentUri} />
|
||||
) : (
|
||||
<NavLink {...navLinkProps}>
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
</NavLink>
|
||||
)}
|
||||
|
||||
{/* {type !== 'small' && !isChannelUri && signingChannel && SIMPLE_SITE && (
|
||||
{/* {type !== 'small' && !isChannelUri && signingChannel && SIMPLE_SITE && (
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
)} */}
|
||||
</div>
|
||||
<ClaimPreviewSubtitle uri={uri} type={type} />
|
||||
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
|
||||
</div>
|
||||
{type !== 'small' && (
|
||||
<div className="claim-preview__actions">
|
||||
{!pending && (
|
||||
<>
|
||||
{renderActions && claim && renderActions(claim)}
|
||||
{shouldHideActions || renderActions ? null : actions !== undefined ? (
|
||||
actions
|
||||
) : (
|
||||
<div className="claim-preview__primary-actions">
|
||||
{!isChannelUri && signingChannel && (
|
||||
<div className="claim-preview__channel-staked">
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isChannelUri && !channelIsBlocked && !claimIsMine && (
|
||||
<SubscribeButton
|
||||
uri={contentUri.startsWith('lbry://') ? contentUri : `lbry://${contentUri}`}
|
||||
/>
|
||||
)}
|
||||
|
||||
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{claim && (
|
||||
<React.Fragment>
|
||||
{typeof properties === 'function' ? (
|
||||
properties(claim)
|
||||
) : properties !== undefined ? (
|
||||
properties
|
||||
) : (
|
||||
<ClaimTags uri={uri} type={type} />
|
||||
)}
|
||||
</React.Fragment>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<ClaimPreviewSubtitle uri={uri} type={type} />
|
||||
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
|
||||
</div>
|
||||
{type !== 'small' && (
|
||||
<div className="claim-preview__actions">
|
||||
{!pending && (
|
||||
<>
|
||||
{renderActions && claim && renderActions(claim)}
|
||||
{shouldHideActions || renderActions ? null : actions !== undefined ? (
|
||||
actions
|
||||
) : (
|
||||
<div className="claim-preview__primary-actions">
|
||||
{!isChannelUri && signingChannel && (
|
||||
<div className="claim-preview__channel-staked">
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isChannelUri && !channelIsBlocked && !claimIsMine && (
|
||||
<SubscribeButton uri={contentUri.startsWith('lbry://') ? contentUri : `lbry://${contentUri}`} />
|
||||
)}
|
||||
|
||||
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{claim && (
|
||||
<React.Fragment>
|
||||
{typeof properties === 'function' ? (
|
||||
properties(claim)
|
||||
) : properties !== undefined ? (
|
||||
properties
|
||||
) : (
|
||||
<ClaimTags uri={uri} type={type} />
|
||||
)}
|
||||
</React.Fragment>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!hideMenu && <ClaimMenuList uri={uri} />}
|
||||
</>
|
||||
</div>
|
||||
{!hideMenu && <ClaimMenuList uri={uri} />}
|
||||
</WrapperElement>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
import * as PAGES from 'constants/pages';
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsPending,
|
||||
doClearPublish,
|
||||
doPrepareEdit,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectClaimForUri, makeSelectClaimIsPending, doClearPublish, doPrepareEdit } from 'lbry-redux';
|
||||
import { push } from 'connected-react-router';
|
||||
import ClaimPreviewSubtitle from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
pending: makeSelectClaimIsPending(props.uri)(state),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
beginPublish: (name) => {
|
||||
const perform = dispatch => ({
|
||||
beginPublish: name => {
|
||||
dispatch(doClearPublish());
|
||||
dispatch(doPrepareEdit({ name }));
|
||||
dispatch(push(`/$/${PAGES.UPLOAD}`));
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import React from 'react';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import DateTime from 'component/dateTime';
|
||||
@@ -12,11 +11,10 @@ type Props = {
|
||||
pending?: boolean,
|
||||
type: string,
|
||||
beginPublish: (string) => void,
|
||||
isLivestream: boolean,
|
||||
};
|
||||
|
||||
function ClaimPreviewSubtitle(props: Props) {
|
||||
const { pending, uri, claim, type, beginPublish, isLivestream } = props;
|
||||
const { pending, uri, claim, type, beginPublish } = props;
|
||||
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
||||
|
||||
let isChannel;
|
||||
@@ -30,16 +28,13 @@ function ClaimPreviewSubtitle(props: Props) {
|
||||
{claim ? (
|
||||
<React.Fragment>
|
||||
<UriIndicator uri={uri} link />{' '}
|
||||
{!pending && claim && (
|
||||
<>
|
||||
{isChannel &&
|
||||
type !== 'inline' &&
|
||||
`${claimsInChannel} ${claimsInChannel === 1 ? __('upload') : __('uploads')}`}
|
||||
|
||||
{!isChannel &&
|
||||
(isLivestream && ENABLE_NO_SOURCE_CLAIMS ? __('Livestream') : <DateTime timeAgo uri={uri} />)}
|
||||
</>
|
||||
)}
|
||||
{!pending &&
|
||||
claim &&
|
||||
(isChannel ? (
|
||||
type !== 'inline' && `${claimsInChannel} ${claimsInChannel === 1 ? __('upload') : __('uploads')}`
|
||||
) : (
|
||||
<DateTime timeAgo uri={uri} />
|
||||
))}
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
doFileGet,
|
||||
makeSelectChannelForClaimUri,
|
||||
makeSelectClaimIsNsfw,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
} from 'lbry-redux';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
@@ -26,7 +25,6 @@ const select = (state, props) => ({
|
||||
blockedChannelUris: selectMutedChannels(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
isMature: makeSelectClaimIsNsfw(props.uri)(state),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
||||
@@ -40,8 +40,6 @@ type Props = {
|
||||
isMature: boolean,
|
||||
showMature: boolean,
|
||||
showHiddenByUser?: boolean,
|
||||
hideLivestreamClaims?: boolean,
|
||||
isLivestream: boolean,
|
||||
};
|
||||
|
||||
function ClaimPreviewTile(props: Props) {
|
||||
@@ -62,8 +60,6 @@ function ClaimPreviewTile(props: Props) {
|
||||
isMature,
|
||||
showMature,
|
||||
showHiddenByUser,
|
||||
hideLivestreamClaims,
|
||||
isLivestream,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
const shouldFetch = claim === undefined;
|
||||
@@ -141,11 +137,11 @@ function ClaimPreviewTile(props: Props) {
|
||||
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url);
|
||||
}
|
||||
|
||||
if (shouldHide || (isLivestream && hideLivestreamClaims)) {
|
||||
if (shouldHide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (placeholder || (!claim && isResolvingUri)) {
|
||||
if (placeholder || isResolvingUri) {
|
||||
return (
|
||||
<li className={classnames('claim-preview--tile', {})}>
|
||||
<div className="placeholder media__thumb" />
|
||||
@@ -186,7 +182,7 @@ function ClaimPreviewTile(props: Props) {
|
||||
<TruncatedText text={title || (claim && claim.name)} lines={isChannel ? 1 : 2} />
|
||||
{isChannel && (
|
||||
<div className="claim-tile__about">
|
||||
<UriIndicator uri={uri} />
|
||||
<UriIndicator uri={uri} link />
|
||||
</div>
|
||||
)}
|
||||
<ClaimMenuList uri={uri} />
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doClaimSearch, selectClaimSearchByQuery, selectFetchingClaimSearchByQuery, SETTINGS } from 'lbry-redux';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import ClaimListDiscover from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
fetchingClaimSearchByQuery: selectFetchingClaimSearchByQuery(state),
|
||||
showNsfw: selectShowMatureContent(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
});
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
// @flow
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import React from 'react';
|
||||
import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
import { useHistory } from 'react-router';
|
||||
|
||||
type Props = {
|
||||
prefixUris?: Array<string>,
|
||||
uris: Array<string>,
|
||||
doClaimSearch: ({}) => void,
|
||||
showNsfw: boolean,
|
||||
@@ -28,12 +27,10 @@ type Props = {
|
||||
orderBy?: Array<string>,
|
||||
releaseTime?: string,
|
||||
languages?: Array<string>,
|
||||
claimType?: string | Array<string>,
|
||||
claimType?: Array<string>,
|
||||
timestamp?: string,
|
||||
feeAmount?: string,
|
||||
limitClaimsPerChannel?: number,
|
||||
streamTypes?: Array<string>,
|
||||
pin?: boolean,
|
||||
};
|
||||
|
||||
function ClaimTilesDiscover(props: Props) {
|
||||
@@ -51,18 +48,16 @@ function ClaimTilesDiscover(props: Props) {
|
||||
releaseTime,
|
||||
languages,
|
||||
claimType,
|
||||
prefixUris,
|
||||
timestamp,
|
||||
feeAmount,
|
||||
limitClaimsPerChannel,
|
||||
fetchingClaimSearchByQuery,
|
||||
streamTypes,
|
||||
pin,
|
||||
} = props;
|
||||
const { location } = useHistory();
|
||||
const urlParams = new URLSearchParams(location.search);
|
||||
const feeAmountInUrl = urlParams.get('fee_amount');
|
||||
const feeAmountParam = feeAmountInUrl || feeAmount || CS.FEE_AMOUNT_ONLY_FREE;
|
||||
|
||||
const feeAmountParam = feeAmountInUrl || feeAmount;
|
||||
const options: {
|
||||
page_size: number,
|
||||
no_totals: boolean,
|
||||
@@ -74,13 +69,11 @@ function ClaimTilesDiscover(props: Props) {
|
||||
order_by: Array<string>,
|
||||
languages?: Array<string>,
|
||||
release_time?: string,
|
||||
claim_type?: string | Array<string>,
|
||||
claim_type?: Array<string>,
|
||||
timestamp?: string,
|
||||
fee_amount?: string,
|
||||
limit_claims_per_channel?: number,
|
||||
stream_types?: Array<string>,
|
||||
has_source?: boolean,
|
||||
has_no_source?: boolean,
|
||||
} = {
|
||||
page_size: pageSize,
|
||||
claim_type: claimType || undefined,
|
||||
@@ -93,13 +86,8 @@ function ClaimTilesDiscover(props: Props) {
|
||||
channel_ids: channelIds || [],
|
||||
not_channel_ids: [],
|
||||
order_by: orderBy || ['trending_group', 'trending_mixed'],
|
||||
stream_types: streamTypes || [CS.FILE_VIDEO],
|
||||
};
|
||||
|
||||
if (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream')) {
|
||||
options.has_source = true;
|
||||
}
|
||||
|
||||
if (releaseTime) {
|
||||
options.release_time = releaseTime;
|
||||
}
|
||||
@@ -134,23 +122,12 @@ function ClaimTilesDiscover(props: Props) {
|
||||
}
|
||||
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
const uris = claimSearchByQuery[claimSearchCacheQuery] || [];
|
||||
|
||||
const uris = (prefixUris || []).concat(claimSearchByQuery[claimSearchCacheQuery] || []);
|
||||
// Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time
|
||||
const optionsStringForEffect = JSON.stringify(options);
|
||||
const isLoading = fetchingClaimSearchByQuery[claimSearchCacheQuery];
|
||||
const shouldPerformSearch = !isLoading && uris.length === 0;
|
||||
|
||||
const fixUri = 'lbry://@samtime#1/us-gov-tries-suing-a-cryptocurrency-lbry#8';
|
||||
if (pin && uris && uris.length > 2 && window.location.pathname === '/') {
|
||||
if (uris.indexOf(fixUri) !== -1) {
|
||||
uris.splice(uris.indexOf(fixUri), 1);
|
||||
} else {
|
||||
uris.pop();
|
||||
}
|
||||
uris.splice(2, 0, fixUri);
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (shouldPerformSearch) {
|
||||
const searchOptions = JSON.parse(optionsStringForEffect);
|
||||
|
||||
@@ -50,7 +50,6 @@ type Props = {
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
playingUri: ?PlayingUri,
|
||||
stakedLevel: number,
|
||||
livestream?: boolean,
|
||||
};
|
||||
|
||||
const LENGTH_TO_COLLAPSE = 300;
|
||||
@@ -78,7 +77,6 @@ function Comment(props: Props) {
|
||||
othersReacts,
|
||||
playingUri,
|
||||
stakedLevel,
|
||||
livestream,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -164,7 +162,6 @@ function Comment(props: Props) {
|
||||
className={classnames('comment', {
|
||||
'comment--top-level': isTopLevel,
|
||||
'comment--reply': !isTopLevel,
|
||||
'comment--livestream': livestream,
|
||||
})}
|
||||
id={commentId}
|
||||
onMouseOver={() => setMouseHover(true)}
|
||||
@@ -176,20 +173,13 @@ function Comment(props: Props) {
|
||||
'comment--slimed': slimedToDeath && !displayDeadComment,
|
||||
})}
|
||||
>
|
||||
{!livestream && (
|
||||
<div className="comment__thumbnail-wrapper">
|
||||
{authorUri ? (
|
||||
<ChannelThumbnail
|
||||
uri={authorUri}
|
||||
obscure={channelIsBlocked}
|
||||
small
|
||||
className="comment__author-thumbnail"
|
||||
/>
|
||||
) : (
|
||||
<ChannelThumbnail small className="comment__author-thumbnail" />
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="comment__thumbnail-wrapper">
|
||||
{authorUri ? (
|
||||
<ChannelThumbnail uri={authorUri} obscure={channelIsBlocked} small className="comment__author-thumbnail" />
|
||||
) : (
|
||||
<ChannelThumbnail small className="comment__author-thumbnail" />
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="comment__body_container">
|
||||
<div className="comment__meta">
|
||||
@@ -197,15 +187,13 @@ function Comment(props: Props) {
|
||||
{!author ? (
|
||||
<span className="comment__author">{__('Anonymous')}</span>
|
||||
) : (
|
||||
<UriIndicator link external={livestream} uri={authorUri} />
|
||||
)}
|
||||
{!livestream && (
|
||||
<Button
|
||||
className="comment__time"
|
||||
onClick={handleTimeClick}
|
||||
label={<DateTime date={timePosted} timeAgo />}
|
||||
/>
|
||||
<UriIndicator link uri={authorUri} />
|
||||
)}
|
||||
<Button
|
||||
className="comment__time"
|
||||
onClick={handleTimeClick}
|
||||
label={<DateTime date={timePosted} timeAgo />}
|
||||
/>
|
||||
|
||||
{isPinned && (
|
||||
<span className="comment__pin">
|
||||
@@ -285,20 +273,18 @@ function Comment(props: Props) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{!livestream && (
|
||||
<div className="comment__actions">
|
||||
{threadDepth !== 0 && (
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
label={commentingEnabled ? __('Reply') : __('Log in to reply')}
|
||||
className="comment__action"
|
||||
onClick={handleCommentReply}
|
||||
icon={ICONS.REPLY}
|
||||
/>
|
||||
)}
|
||||
{ENABLE_COMMENT_REACTIONS && <CommentReactions uri={uri} commentId={commentId} />}
|
||||
</div>
|
||||
)}
|
||||
<div className="comment__actions">
|
||||
{threadDepth !== 0 && (
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
label={commentingEnabled ? __('Reply') : __('Log in to reply')}
|
||||
className="comment__action"
|
||||
onClick={handleCommentReply}
|
||||
icon={ICONS.REPLY}
|
||||
/>
|
||||
)}
|
||||
{ENABLE_COMMENT_REACTIONS && <CommentReactions uri={uri} commentId={commentId} />}
|
||||
</div>
|
||||
|
||||
{isReplying && (
|
||||
<CommentCreate
|
||||
|
||||
@@ -24,8 +24,7 @@ const select = (state, props) => ({
|
||||
});
|
||||
|
||||
const perform = (dispatch, ownProps) => ({
|
||||
createComment: (comment, claimId, parentId) =>
|
||||
dispatch(doCommentCreate(comment, claimId, parentId, ownProps.uri, ownProps.livestream)),
|
||||
createComment: (comment, claimId, parentId) => dispatch(doCommentCreate(comment, claimId, parentId, ownProps.uri)),
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
setActiveChannel: (claimId) => dispatch(doSetActiveChannel(claimId)),
|
||||
toast: (message) => dispatch(doToast({ message, isError: true })),
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FormField, Form } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import SelectChannel from 'component/selectChannel';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import { FF_MAX_CHARS_IN_COMMENT, FF_MAX_CHARS_IN_LIVESTREAM_COMMENT } from 'constants/form-field';
|
||||
import { FF_MAX_CHARS_IN_COMMENT } from 'constants/form-field';
|
||||
import { useHistory } from 'react-router';
|
||||
import type { ElementRef } from 'react';
|
||||
import emoji from 'emoji-dictionary';
|
||||
@@ -33,15 +33,11 @@ type Props = {
|
||||
parentId: string,
|
||||
isReply: boolean,
|
||||
isPostingComment: boolean,
|
||||
activeChannel: string,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
bottom: boolean,
|
||||
onSubmit: (string, string) => void,
|
||||
livestream: boolean,
|
||||
authenticated: boolean,
|
||||
embed?: boolean,
|
||||
livestream?: boolean,
|
||||
toast: (string) => void,
|
||||
claimIsMine: boolean,
|
||||
commentingEnabled: boolean,
|
||||
};
|
||||
|
||||
export function CommentCreate(props: Props) {
|
||||
@@ -57,20 +53,12 @@ export function CommentCreate(props: Props) {
|
||||
parentId,
|
||||
isPostingComment,
|
||||
activeChannelClaim,
|
||||
onSubmit,
|
||||
bottom,
|
||||
livestream,
|
||||
authenticated,
|
||||
embed,
|
||||
toast,
|
||||
claimIsMine,
|
||||
commentingEnabled,
|
||||
} = props;
|
||||
const buttonref: ElementRef<any> = React.useRef();
|
||||
const {
|
||||
push,
|
||||
location: { pathname },
|
||||
} = useHistory();
|
||||
const { push } = useHistory();
|
||||
const { claim_id: claimId } = claim;
|
||||
const [commentValue, setCommentValue] = React.useState('');
|
||||
const [lastCommentTime, setLastCommentTime] = React.useState();
|
||||
@@ -92,7 +80,7 @@ export function CommentCreate(props: Props) {
|
||||
|
||||
function altEnterListener(e: SyntheticKeyboardEvent<*>) {
|
||||
const KEYCODE_ENTER = 13;
|
||||
if ((livestream || e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) {
|
||||
if ((e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) {
|
||||
e.preventDefault();
|
||||
buttonref.current.click();
|
||||
}
|
||||
@@ -110,21 +98,18 @@ export function CommentCreate(props: Props) {
|
||||
if (activeChannelClaim && commentValue.length) {
|
||||
const timeUntilCanComment = !lastCommentTime
|
||||
? 0
|
||||
: (lastCommentTime - Date.now()) / 1000 + COMMENT_SLOW_MODE_SECONDS;
|
||||
: lastCommentTime / 1000 - Date.now() / 1000 + COMMENT_SLOW_MODE_SECONDS;
|
||||
|
||||
if (livestream && !claimIsMine && timeUntilCanComment > 0) {
|
||||
toast(__('Slowmode is on. You can comment again in %time% seconds.', { time: Math.ceil(timeUntilCanComment) }));
|
||||
toast(
|
||||
__('Slowmode is on. You can comment again in %time% seconds.', { time: Math.floor(timeUntilCanComment) })
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
createComment(commentValue, claimId, parentId).then((res) => {
|
||||
if (res && res.signature) {
|
||||
setCommentValue('');
|
||||
setLastCommentTime(Date.now());
|
||||
|
||||
if (onSubmit) {
|
||||
onSubmit(commentValue, activeChannelClaim.name);
|
||||
}
|
||||
|
||||
if (onDoneReplying) {
|
||||
onDoneReplying();
|
||||
@@ -140,18 +125,9 @@ export function CommentCreate(props: Props) {
|
||||
|
||||
useEffect(() => setCharCount(commentValue.length), [commentValue]);
|
||||
|
||||
if (!commentingEnabled || !hasChannels) {
|
||||
if (!hasChannels) {
|
||||
return (
|
||||
<div
|
||||
role="button"
|
||||
onClick={() =>
|
||||
embed
|
||||
? window.open(`https://odysee.com/$/${PAGES.AUTH}?redirect=/$/${PAGES.LIVESTREAM}`)
|
||||
: authenticated
|
||||
? push(`/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`)
|
||||
: push(`/$/${PAGES.AUTH}?redirect=${pathname}`)
|
||||
}
|
||||
>
|
||||
<div role="button" onClick={() => push(`/$/${PAGES.CHANNEL_NEW}`)}>
|
||||
<FormField
|
||||
type="textarea"
|
||||
name={'comment_signup_prompt'}
|
||||
@@ -159,7 +135,7 @@ export function CommentCreate(props: Props) {
|
||||
label={isFetchingChannels ? __('Comment') : undefined}
|
||||
/>
|
||||
<div className="section__actions">
|
||||
<Button disabled button="primary" label={__('Post --[button to submit something]--')} />
|
||||
<Button disabled button="primary" label={__('Post --[button to submit something]--')} requiresAuth={IS_WEB} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -171,7 +147,6 @@ export function CommentCreate(props: Props) {
|
||||
className={classnames('comment__create', {
|
||||
'comment__create--reply': isReply,
|
||||
'comment__create--nested-reply': isNested,
|
||||
'comment__create--bottom': bottom,
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
@@ -195,7 +170,7 @@ export function CommentCreate(props: Props) {
|
||||
charCount={charCount}
|
||||
onChange={handleCommentChange}
|
||||
autoFocus={isReply}
|
||||
textAreaMaxLength={livestream ? FF_MAX_CHARS_IN_LIVESTREAM_COMMENT : FF_MAX_CHARS_IN_COMMENT}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_COMMENT}
|
||||
/>
|
||||
{livestream && hasChannels && (
|
||||
<div className="livestream__emoji-actions">
|
||||
@@ -214,11 +189,7 @@ export function CommentCreate(props: Props) {
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div
|
||||
className={classnames('section__actions', {
|
||||
'section__actions--no-margin': !livestream,
|
||||
})}
|
||||
>
|
||||
<div className="section__actions section__actions--no-margin">
|
||||
<Button
|
||||
ref={buttonref}
|
||||
button="primary"
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function CommentReactions(props: Props) {
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
title={__('Upvote')}
|
||||
icon={myReacts.includes(REACTION_TYPES.LIKE) ? ICONS.FIRE_ACTIVE : ICONS.FIRE}
|
||||
icon={ICONS.UPVOTE}
|
||||
className={classnames('comment__action', {
|
||||
'comment__action--active': myReacts && myReacts.includes(REACTION_TYPES.LIKE),
|
||||
})}
|
||||
@@ -87,7 +87,7 @@ export default function CommentReactions(props: Props) {
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
title={__('Downvote')}
|
||||
icon={myReacts.includes(REACTION_TYPES.DISLIKE) ? ICONS.SLIME_ACTIVE : ICONS.SLIME}
|
||||
icon={ICONS.DOWNVOTE}
|
||||
className={classnames('comment__action', {
|
||||
'comment__action--active': myReacts && myReacts.includes(REACTION_TYPES.DISLIKE),
|
||||
})}
|
||||
|
||||
@@ -20,8 +20,6 @@ type Props = {
|
||||
defaultExpand?: boolean,
|
||||
nag?: Node,
|
||||
smallTitle?: boolean,
|
||||
onClick?: () => void,
|
||||
children?: any, // not sure how this works
|
||||
};
|
||||
|
||||
export default function Card(props: Props) {
|
||||
@@ -39,21 +37,12 @@ export default function Card(props: Props) {
|
||||
smallTitle = false,
|
||||
defaultExpand,
|
||||
nag,
|
||||
onClick,
|
||||
children,
|
||||
} = props;
|
||||
const [expanded, setExpanded] = useState(defaultExpand);
|
||||
const expandable = defaultExpand !== undefined;
|
||||
|
||||
return (
|
||||
<section
|
||||
className={classnames(className, 'card')}
|
||||
onClick={() => {
|
||||
if (onClick) {
|
||||
onClick();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<section className={classnames(className, 'card')}>
|
||||
{(title || subtitle) && (
|
||||
<div
|
||||
className={classnames('card__header--between', {
|
||||
@@ -104,7 +93,6 @@ export default function Card(props: Props) {
|
||||
</div>
|
||||
)}
|
||||
{actions && <div className="card__main-actions">{actions}</div>}
|
||||
{children && <div className="card__main-actions">{children}</div>}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ export class FormField extends React.PureComponent<Props> {
|
||||
labelOnLeft,
|
||||
blockWrap,
|
||||
charCount,
|
||||
textAreaMaxLength,
|
||||
textAreaMaxLength = FF_MAX_CHARS_DEFAULT,
|
||||
quickActionLabel,
|
||||
quickActionHandler,
|
||||
...inputProps
|
||||
@@ -208,7 +208,7 @@ export class FormField extends React.PureComponent<Props> {
|
||||
// to pass the current value to it's callback, nor query the current
|
||||
// text length from the callback. So, we'll use our own widget.
|
||||
const hasCharCount = charCount !== undefined && charCount >= 0;
|
||||
const countInfo = hasCharCount && textAreaMaxLength !== undefined && (
|
||||
const countInfo = hasCharCount && (
|
||||
<span className="comment__char-count-mde">{`${charCount || '0'}/${textAreaMaxLength}`}</span>
|
||||
);
|
||||
|
||||
@@ -242,7 +242,7 @@ export class FormField extends React.PureComponent<Props> {
|
||||
);
|
||||
} else if (type === 'textarea') {
|
||||
const hasCharCount = charCount !== undefined && charCount >= 0;
|
||||
const countInfo = hasCharCount && textAreaMaxLength !== undefined && (
|
||||
const countInfo = hasCharCount && (
|
||||
<span className="comment__char-count">{`${charCount || '0'}/${textAreaMaxLength}`}</span>
|
||||
);
|
||||
input = (
|
||||
@@ -255,13 +255,7 @@ export class FormField extends React.PureComponent<Props> {
|
||||
{quickAction}
|
||||
</div>
|
||||
)}
|
||||
<textarea
|
||||
type={type}
|
||||
id={name}
|
||||
maxLength={textAreaMaxLength || FF_MAX_CHARS_DEFAULT}
|
||||
ref={this.input}
|
||||
{...inputProps}
|
||||
/>
|
||||
<textarea type={type} id={name} maxLength={textAreaMaxLength} ref={this.input} {...inputProps} />
|
||||
{countInfo}
|
||||
</fieldset-section>
|
||||
);
|
||||
|
||||
@@ -1240,6 +1240,12 @@ export const icons = {
|
||||
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
|
||||
</g>
|
||||
),
|
||||
[ICONS.LIVESTREAM]: buildIcon(
|
||||
<g>
|
||||
<polygon points="23 7 16 12 23 17 23 7" />
|
||||
<rect x="1" y="5" width="15" height="14" rx="2" ry="2" />
|
||||
</g>
|
||||
),
|
||||
[ICONS.CHANNEL_LEVEL_1]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
@@ -1670,265 +1676,4 @@ export const icons = {
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.LIVESTREAM]: (props: CustomProps) => (
|
||||
<svg
|
||||
version="1.1"
|
||||
id="Layer_1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlnsXlink="http://www.w3.org/1999/xlink"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 36 36"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
>
|
||||
<g id="XMLID_505_">
|
||||
<linearGradient
|
||||
id="XMLID_420_"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="-519.065"
|
||||
y1="1525.4059"
|
||||
x2="-508.6628"
|
||||
y2="1525.4059"
|
||||
>
|
||||
<stop offset="1.970443e-002" stopColor="#FFC200" />
|
||||
<stop offset="0.3866" stopColor="#FF31BD" />
|
||||
<stop offset="0.6245" stopColor="#8E31BD" />
|
||||
<stop offset="0.7758" stopColor="#6E8EDE" />
|
||||
<stop offset="1" stopColor="#57EABA" />
|
||||
</linearGradient>
|
||||
<circle
|
||||
id="XMLID_508_"
|
||||
fill="none"
|
||||
stroke="url(XMLID_420_)"
|
||||
strokeWidth="2.4678"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit="10"
|
||||
cx="-513.9"
|
||||
cy="1525.4"
|
||||
r="4"
|
||||
/>
|
||||
<path
|
||||
id="XMLID_507_"
|
||||
fill="#FF7B5B"
|
||||
d="M-521,1518.3c-1.8,1.8-2.9,4.3-2.9,7.1c0,2.6,1,4.9,2.5,6.7L-521,1518.3z"
|
||||
/>
|
||||
<path
|
||||
id="XMLID_506_"
|
||||
fill="#FF7B5B"
|
||||
d="M-506.9,1532.1c1.8-1.8,2.9-4.3,2.9-7.1c0-2.6-1-4.9-2.5-6.7L-506.9,1532.1z"
|
||||
/>
|
||||
</g>
|
||||
<rect id="XMLID_125_" x="0" y="0" fill="none" width="36" height="36" stroke="none" /> {/* }//fill="#FFFFFF" */}
|
||||
<linearGradient
|
||||
id="XMLID_421_"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="-1625.151"
|
||||
y1="-2518.4661"
|
||||
x2="-1596.6696"
|
||||
y2="-2518.4661"
|
||||
gradientTransform="matrix(-1 0 0 -1 -1589.489 -2500.4661)"
|
||||
>
|
||||
<stop offset="1.970443e-002" stopColor="#FFC200" />
|
||||
<stop offset="0.4731" stopColor="#FF31BD" />
|
||||
<stop offset="0.6947" stopColor="#8E31BD" />
|
||||
<stop offset="1" stopColor="#57EABA" />
|
||||
</linearGradient>
|
||||
<path
|
||||
id="XMLID_124_"
|
||||
fill="none"
|
||||
stroke="url(#XMLID_421_)"
|
||||
strokeWidth="2.94"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit="10"
|
||||
d="M21.4,5.2L21.4,5.2c7.1,0,12.8,5.7,12.8,12.8v0c0,7.1-5.7,12.8-12.8,12.8H8.7V18C8.7,10.9,14.4,5.2,21.4,5.2z"
|
||||
/>
|
||||
<linearGradient id="XMLID_422_" gradientUnits="userSpaceOnUse" x1="18.041" y1="32.147" x2="38.7776" y2="-0.9289">
|
||||
<stop offset="1.970443e-002" stopColor="#FFC200" />
|
||||
<stop offset="0.4731" stopColor="#FF31BD" />
|
||||
<stop offset="0.6947" stopColor="#8E31BD" />
|
||||
<stop offset="1" stopColor="#57EABA" />
|
||||
</linearGradient>
|
||||
<rect id="XMLID_123_" x="26.9" y="13.8" fill="url(#XMLID_422_)" stroke="none" width="2.8" height="3.8" />
|
||||
<linearGradient
|
||||
id="XMLID_423_"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="13.0856"
|
||||
y1="29.0402"
|
||||
x2="33.8223"
|
||||
y2="-4.0356"
|
||||
>
|
||||
<stop offset="1.970443e-002" stopColor="#FFC200" />
|
||||
<stop offset="0.4731" stopColor="#FF31BD" />
|
||||
<stop offset="0.6947" stopColor="#8E31BD" />
|
||||
<stop offset="1" stopColor="#57EABA" />
|
||||
</linearGradient>
|
||||
<rect id="XMLID_122_" x="20" y="13.8" fill="url(#XMLID_422_)" stroke="none" width="2.8" height="3.8" />
|
||||
<linearGradient id="XMLID_424_" gradientUnits="userSpaceOnUse" x1="0.338" y1="17.7555" x2="17.2654" y2="17.7555">
|
||||
<stop offset="1.970443e-002" stopColor="#FFC200" />
|
||||
<stop offset="0.4731" stopColor="#FF31BD" />
|
||||
<stop offset="0.6947" stopColor="#8E31BD" />
|
||||
<stop offset="1" stopColor="#57EABA" />
|
||||
</linearGradient>
|
||||
<circle
|
||||
id="XMLID_121_"
|
||||
fill="none"
|
||||
stroke="#6E8EDE"
|
||||
strokeWidth="2.94"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit="10"
|
||||
cx="8.8"
|
||||
cy="17.8"
|
||||
r="6"
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.LIVESTREAM_SOLID]: (props: CustomProps) => (
|
||||
<svg
|
||||
id="prefix__Layer_1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
x={0}
|
||||
y={0}
|
||||
fill="none"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
viewBox="0 0 36 36"
|
||||
xmlSpace="preserve"
|
||||
{...props}
|
||||
>
|
||||
<style>{'.prefix__st1{fill:#ff7b5b}.prefix__st3{fill:#79d1b6}'}</style>
|
||||
<g id="prefix__XMLID_505_">
|
||||
<linearGradient
|
||||
id="prefix__XMLID_410_"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1={-571.815}
|
||||
y1={1525.406}
|
||||
x2={-561.413}
|
||||
y2={1525.406}
|
||||
>
|
||||
<stop offset={0.02} stopColor="#ffc200" />
|
||||
<stop offset={0.387} stopColor="#ff31bd" />
|
||||
<stop offset={0.625} stopColor="#8e31bd" />
|
||||
<stop offset={0.776} stopColor="#6e8ede" />
|
||||
<stop offset={1} stopColor="#57eaba" />
|
||||
</linearGradient>
|
||||
<circle
|
||||
id="prefix__XMLID_508_"
|
||||
cx={-566.6}
|
||||
cy={1525.4}
|
||||
r={4}
|
||||
fill="none"
|
||||
stroke="url(#prefix__XMLID_410_)"
|
||||
strokeWidth={2.468}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit={10}
|
||||
/>
|
||||
<path
|
||||
id="prefix__XMLID_507_"
|
||||
className="prefix__st1"
|
||||
d="M-573.7 1518.3c-1.8 1.8-2.9 4.3-2.9 7.1 0 2.6 1 4.9 2.5 6.7l.4-13.8z"
|
||||
/>
|
||||
<path
|
||||
id="prefix__XMLID_506_"
|
||||
className="prefix__st1"
|
||||
d="M-559.6 1532.1c1.8-1.8 2.9-4.3 2.9-7.1 0-2.6-1-4.9-2.5-6.7l-.4 13.8z"
|
||||
/>
|
||||
</g>
|
||||
<path
|
||||
id="prefix__XMLID_20_"
|
||||
d="M21.4 5.2h0c7.1 0 12.8 5.7 12.8 12.8v0c0 7.1-5.7 12.8-12.8 12.8H8.7V18c0-7.1 5.7-12.8 12.7-12.8z"
|
||||
fill="none"
|
||||
stroke="#e729e1"
|
||||
strokeWidth={2.94}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit={10}
|
||||
/>
|
||||
<path id="prefix__XMLID_19_" className="prefix__st3" stroke="none" d="M26.9 13.8h2.8v3.8h-2.8z" />
|
||||
<path id="prefix__XMLID_18_" className="prefix__st3" stroke="none" d="M20 13.8h2.8v3.8H20z" />
|
||||
<circle
|
||||
id="prefix__XMLID_17_"
|
||||
cx={8.8}
|
||||
cy={17.8}
|
||||
r={6}
|
||||
fill="none"
|
||||
stroke="#ffa100"
|
||||
strokeWidth={2.94}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit={10}
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.LIVESTREAM_MONOCHROME]: (props: CustomProps) => (
|
||||
<svg
|
||||
id="prefix__Layer_1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
x={0}
|
||||
y={0}
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
viewBox="0 0 36 36"
|
||||
xmlSpace="preserve"
|
||||
{...props}
|
||||
>
|
||||
<g id="prefix__XMLID_505_">
|
||||
<linearGradient
|
||||
id="prefix__XMLID_410_"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1={-571.815}
|
||||
y1={1525.406}
|
||||
x2={-561.413}
|
||||
y2={1525.406}
|
||||
>
|
||||
<stop offset={0.02} stopColor="#ffc200" />
|
||||
<stop offset={0.387} stopColor="#ff31bd" />
|
||||
<stop offset={0.625} stopColor="#8e31bd" />
|
||||
<stop offset={0.776} stopColor="#6e8ede" />
|
||||
<stop offset={1} stopColor="#57eaba" />
|
||||
</linearGradient>
|
||||
<circle
|
||||
id="prefix__XMLID_508_"
|
||||
cx={-566.6}
|
||||
cy={1525.4}
|
||||
r={4}
|
||||
fill="none"
|
||||
strokeWidth={2.468}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit={10}
|
||||
/>
|
||||
<path id="prefix__XMLID_507_" d="M-573.7 1518.3c-1.8 1.8-2.9 4.3-2.9 7.1 0 2.6 1 4.9 2.5 6.7l.4-13.8z" />
|
||||
<path id="prefix__XMLID_506_" d="M-559.6 1532.1c1.8-1.8 2.9-4.3 2.9-7.1 0-2.6-1-4.9-2.5-6.7l-.4 13.8z" />
|
||||
</g>
|
||||
<path
|
||||
id="prefix__XMLID_20_"
|
||||
d="M21.4 5.2h0c7.1 0 12.8 5.7 12.8 12.8v0c0 7.1-5.7 12.8-12.8 12.8H8.7V18c0-7.1 5.7-12.8 12.7-12.8z"
|
||||
fill="none"
|
||||
strokeWidth={2.94}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit={10}
|
||||
/>
|
||||
<path id="prefix__XMLID_19_" d="M26.9 13.8h2.8v3.8h-2.8z" />
|
||||
<path id="prefix__XMLID_18_" d="M20 13.8h2.8v3.8H20z" />
|
||||
<circle
|
||||
id="prefix__XMLID_17_"
|
||||
cx={8.8}
|
||||
cy={17.8}
|
||||
r={6}
|
||||
fill="none"
|
||||
strokeWidth={2.94}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeMiterlimit={10}
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
};
|
||||
@@ -10,11 +10,10 @@ type Props = {
|
||||
doToast: ({ message: string }) => void,
|
||||
label?: string,
|
||||
primaryButton?: boolean,
|
||||
name?: string,
|
||||
};
|
||||
|
||||
export default function CopyableText(props: Props) {
|
||||
const { copyable, doToast, snackMessage, label, primaryButton = false, name } = props;
|
||||
const { copyable, doToast, snackMessage, label, primaryButton = false } = props;
|
||||
|
||||
const input = useRef();
|
||||
|
||||
@@ -39,7 +38,6 @@ export default function CopyableText(props: Props) {
|
||||
type="text"
|
||||
className="form-field--copyable"
|
||||
readOnly
|
||||
name={name}
|
||||
label={label}
|
||||
value={copyable || ''}
|
||||
ref={input}
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
makeSelectClaimForUri,
|
||||
doPrepareEdit,
|
||||
selectMyChannelClaims,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
@@ -22,7 +21,6 @@ const select = (state, props) => ({
|
||||
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
|
||||
costInfo: makeSelectCostInfoForUri(props.uri)(state),
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
isLivestreamClaim: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
||||
@@ -3,7 +3,6 @@ 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';
|
||||
import * as PUBLISH_MODES from 'constants/publish_types';
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import FileDownloadLink from 'component/fileDownloadLink';
|
||||
@@ -26,8 +25,6 @@ type Props = {
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
doToast: ({ message: string }) => void,
|
||||
clearPlayingUri: () => void,
|
||||
hideRepost?: boolean,
|
||||
isLivestreamClaim: boolean,
|
||||
};
|
||||
|
||||
function FileActions(props: Props) {
|
||||
@@ -43,8 +40,6 @@ function FileActions(props: Props) {
|
||||
myChannels,
|
||||
clearPlayingUri,
|
||||
doToast,
|
||||
hideRepost,
|
||||
isLivestreamClaim,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -85,25 +80,23 @@ function FileActions(props: Props) {
|
||||
|
||||
const lhsSection = (
|
||||
<>
|
||||
{ENABLE_FILE_REACTIONS && <FileReactions uri={uri} livestream={isLivestreamClaim} />}
|
||||
{ENABLE_FILE_REACTIONS && <FileReactions uri={uri} />}
|
||||
<ClaimSupportButton uri={uri} fileAction />
|
||||
{!hideRepost && (
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={handleRepostClick}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={handleRepostClick}
|
||||
/>
|
||||
<Button
|
||||
className="button--file-action"
|
||||
icon={ICONS.SHARE}
|
||||
label={isMobile ? undefined : __('Share')}
|
||||
label={__('Share')}
|
||||
title={__('Share')}
|
||||
onClick={() => openModal(MODALS.SOCIAL_SHARE, { uri, webShareable })}
|
||||
/>
|
||||
@@ -119,18 +112,7 @@ function FileActions(props: Props) {
|
||||
className="button--file-action"
|
||||
icon={ICONS.EDIT}
|
||||
label={__('Edit')}
|
||||
navigate={`/$/${PAGES.UPLOAD}${isLivestreamClaim ? `?type=${PUBLISH_MODES.LIVESTREAM}` : ''}`}
|
||||
onClick={() => {
|
||||
prepareEdit(claim, editUri, fileInfo);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{claimIsMine && isLivestreamClaim && (
|
||||
<Button
|
||||
className="button--file-action"
|
||||
icon={ICONS.PUBLISH}
|
||||
label={__('Publish Replay')}
|
||||
navigate={`/$/${PAGES.UPLOAD}?type=${PUBLISH_MODES.FILE}`}
|
||||
navigate="/$/upload"
|
||||
onClick={() => {
|
||||
prepareEdit(claim, editUri, fileInfo);
|
||||
}}
|
||||
|
||||
@@ -50,7 +50,7 @@ function FileDescription(props: Props) {
|
||||
<FileDetails uri={uri} />
|
||||
</div>
|
||||
|
||||
<div className="card__bottom-actions">
|
||||
<div className="section__actions--between">
|
||||
{expanded ? (
|
||||
<Button button="link" label={__('Less')} onClick={() => setExpanded(!expanded)} />
|
||||
) : (
|
||||
@@ -63,7 +63,6 @@ function FileDescription(props: Props) {
|
||||
button="link"
|
||||
className="expandable__button"
|
||||
icon={ICONS.UNLOCK}
|
||||
aria-label={__('Unlock tips')}
|
||||
onClick={() => {
|
||||
doOpenModal(MODALS.LIQUIDATE_SUPPORTS, { uri });
|
||||
}}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import * as REACTION_TYPES from 'constants/reactions';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
@@ -9,51 +8,25 @@ import NudgeFloating from 'component/nudgeFloating';
|
||||
|
||||
type Props = {
|
||||
claim: StreamClaim,
|
||||
doFetchReactions: (string) => void,
|
||||
doReactionLike: (string) => void,
|
||||
doReactionDislike: (string) => void,
|
||||
doFetchReactions: string => void,
|
||||
doReactionLike: string => void,
|
||||
doReactionDislike: string => void,
|
||||
uri: string,
|
||||
likeCount: number,
|
||||
dislikeCount: number,
|
||||
myReaction: ?string,
|
||||
livestream?: boolean,
|
||||
};
|
||||
|
||||
function FileReactions(props: Props) {
|
||||
const {
|
||||
claim,
|
||||
uri,
|
||||
doFetchReactions,
|
||||
doReactionLike,
|
||||
doReactionDislike,
|
||||
myReaction,
|
||||
likeCount,
|
||||
dislikeCount,
|
||||
livestream,
|
||||
} = props;
|
||||
const { claim, uri, doFetchReactions, doReactionLike, doReactionDislike, likeCount, dislikeCount } = props;
|
||||
const claimId = claim && claim.claim_id;
|
||||
const channel = claim && claim.signing_channel && claim.signing_channel.name;
|
||||
|
||||
React.useEffect(() => {
|
||||
function fetchReactions() {
|
||||
if (claimId) {
|
||||
doFetchReactions(claimId);
|
||||
}
|
||||
|
||||
let fetchInterval;
|
||||
if (claimId) {
|
||||
fetchReactions();
|
||||
|
||||
if (livestream) {
|
||||
fetchInterval = setInterval(fetchReactions, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (fetchInterval) {
|
||||
clearInterval(fetchInterval);
|
||||
}
|
||||
};
|
||||
}, [claimId, doFetchReactions, livestream]);
|
||||
}, [claimId, doFetchReactions]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -68,46 +41,20 @@ function FileReactions(props: Props) {
|
||||
title={__('I like this')}
|
||||
requiresAuth={IS_WEB}
|
||||
authSrc="filereaction_like"
|
||||
className={classnames('button--file-action', { 'button--fire': myReaction === REACTION_TYPES.LIKE })}
|
||||
label={
|
||||
<>
|
||||
{myReaction === REACTION_TYPES.LIKE && (
|
||||
<>
|
||||
<div className="button__fire-glow" />
|
||||
<div className="button__fire-particle1" />
|
||||
<div className="button__fire-particle2" />
|
||||
<div className="button__fire-particle3" />
|
||||
<div className="button__fire-particle4" />
|
||||
<div className="button__fire-particle5" />
|
||||
<div className="button__fire-particle6" />
|
||||
</>
|
||||
)}
|
||||
{formatNumberWithCommas(likeCount, 0)}
|
||||
</>
|
||||
}
|
||||
className={classnames('button--file-action')}
|
||||
label={formatNumberWithCommas(likeCount, 0)}
|
||||
iconSize={18}
|
||||
icon={myReaction === REACTION_TYPES.LIKE ? ICONS.FIRE_ACTIVE : ICONS.FIRE}
|
||||
icon={ICONS.UPVOTE}
|
||||
onClick={() => doReactionLike(uri)}
|
||||
/>
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
authSrc={'filereaction_dislike'}
|
||||
title={__('I dislike this')}
|
||||
className={classnames('button--file-action', { 'button--slime': myReaction === REACTION_TYPES.DISLIKE })}
|
||||
label={
|
||||
<>
|
||||
{myReaction === REACTION_TYPES.DISLIKE && (
|
||||
<>
|
||||
<div className="button__slime-stain" />
|
||||
<div className="button__slime-drop1" />
|
||||
<div className="button__slime-drop2" />
|
||||
</>
|
||||
)}
|
||||
{formatNumberWithCommas(dislikeCount, 0)}
|
||||
</>
|
||||
}
|
||||
className={classnames('button--file-action')}
|
||||
label={formatNumberWithCommas(dislikeCount, 0)}
|
||||
iconSize={18}
|
||||
icon={myReaction === REACTION_TYPES.DISLIKE ? ICONS.SLIME_ACTIVE : ICONS.SLIME}
|
||||
icon={ICONS.DOWNVOTE}
|
||||
onClick={() => doReactionDislike(uri)}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -6,25 +6,19 @@ import FileActions from 'component/fileActions';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
livestream?: boolean,
|
||||
activeViewers?: number,
|
||||
};
|
||||
|
||||
function FileSubtitle(props: Props) {
|
||||
const { uri, livestream = false, activeViewers = 0 } = props;
|
||||
const { uri } = props;
|
||||
|
||||
return (
|
||||
<div className="media__subtitle--between">
|
||||
<div className="file__viewdate">
|
||||
{livestream ? <span>{__('Right now')}</span> : <DateTime uri={uri} show={DateTime.SHOW_DATE} />}
|
||||
{livestream ? (
|
||||
<span>{__('%viewer_count% currently watching', { viewer_count: activeViewers })}</span>
|
||||
) : (
|
||||
<FileViewCount uri={uri} />
|
||||
)}
|
||||
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
|
||||
<FileViewCount uri={uri} />
|
||||
</div>
|
||||
{ /* did I need these params? */ }
|
||||
<FileActions uri={uri} hideRepost={livestream} livestream={livestream} />
|
||||
|
||||
<FileActions uri={uri} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,12 +18,10 @@ type Props = {
|
||||
title: string,
|
||||
nsfw: boolean,
|
||||
isNsfwBlocked: boolean,
|
||||
livestream?: boolean,
|
||||
activeViewers?: number,
|
||||
};
|
||||
|
||||
function FileTitleSection(props: Props) {
|
||||
const { title, uri, nsfw, isNsfwBlocked, livestream = false, activeViewers } = props;
|
||||
const { title, uri, nsfw, isNsfwBlocked } = props;
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -43,7 +41,7 @@ function FileTitleSection(props: Props) {
|
||||
body={
|
||||
<React.Fragment>
|
||||
<ClaimInsufficientCredits uri={uri} />
|
||||
<FileSubtitle uri={uri} livestream={livestream} activeViewers={activeViewers} />
|
||||
<FileSubtitle uri={uri} />
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectMediaTypeForUri, makeSelectClaimIsStreamPlaceholder } from 'lbry-redux';
|
||||
import { makeSelectMediaTypeForUri } from 'lbry-redux';
|
||||
import FileType from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
mediaType: makeSelectMediaTypeForUri(props.uri)(state),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(FileType);
|
||||
@@ -6,17 +6,16 @@ import Icon from 'component/common/icon';
|
||||
type Props = {
|
||||
uri: string,
|
||||
mediaType: string,
|
||||
isLivestream: boolean,
|
||||
};
|
||||
|
||||
function FileType(props: Props) {
|
||||
const { mediaType, isLivestream } = props;
|
||||
const { mediaType } = props;
|
||||
|
||||
if (mediaType === 'image') {
|
||||
return <Icon icon={ICONS.IMAGE} />;
|
||||
} else if (mediaType === 'audio') {
|
||||
return <Icon icon={ICONS.AUDIO} />;
|
||||
} else if (mediaType === 'video' || isLivestream) {
|
||||
} else if (mediaType === 'video') {
|
||||
return <Icon icon={ICONS.VIDEO} />;
|
||||
} else if (mediaType === 'text') {
|
||||
return <Icon icon={ICONS.TEXT} />;
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
claim: StreamClaim,
|
||||
fileInfo: FileListItem,
|
||||
metadata: StreamMetadata,
|
||||
openFolder: (string) => void,
|
||||
openFolder: string => void,
|
||||
contentType: string,
|
||||
user: ?any,
|
||||
pendingAmount: string,
|
||||
@@ -62,7 +62,6 @@ class FileValues extends PureComponent<Props> {
|
||||
className="expandable__button"
|
||||
icon={ICONS.UNLOCK}
|
||||
label={<CreditAmount amount={Number(supportsAmount)} precision={2} />}
|
||||
aria-label={__('Unlock tips')}
|
||||
onClick={() => {
|
||||
openModal(MODALS.LIQUIDATE_SUPPORTS, { uri });
|
||||
}}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import React, { useEffect } from 'react';
|
||||
import HelpLink from 'component/common/help-link';
|
||||
|
||||
type Props = {
|
||||
claim: ?StreamClaim,
|
||||
fetchViewCount: (string) => void,
|
||||
fetchViewCount: string => void,
|
||||
uri: string,
|
||||
viewCount: string,
|
||||
};
|
||||
@@ -13,6 +12,7 @@ type Props = {
|
||||
function FileViewCount(props: Props) {
|
||||
const { claim, uri, fetchViewCount, viewCount } = props;
|
||||
const claimId = claim && claim.claim_id;
|
||||
|
||||
useEffect(() => {
|
||||
if (claimId) {
|
||||
fetchViewCount(claimId);
|
||||
@@ -24,7 +24,7 @@ function FileViewCount(props: Props) {
|
||||
return (
|
||||
<span className="media__subtitle--centered">
|
||||
{viewCount !== 1 ? __('%view_count% views', { view_count: formattedViewCount }) : __('1 view')}
|
||||
{!SIMPLE_SITE && <HelpLink href="https://lbry.com/faq/views" />}
|
||||
<HelpLink href="https://lbry.com/faq/views" />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ import FilePrice from 'component/filePrice';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { withRouter } from 'react-router';
|
||||
import { URL } from 'config';
|
||||
import OdyseeLogo from 'component/header/odysee_logo.png';
|
||||
import OdyseeLogoWithText from 'component/header/odysee_white.png';
|
||||
import * as ICONS from 'constants/icons';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -37,10 +36,7 @@ function FileViewerEmbeddedTitle(props: Props) {
|
||||
{...contentLinkProps}
|
||||
/>
|
||||
<div className="file-viewer__embedded-info">
|
||||
<Button className="file-viewer__overlay-logo" aria-label={__('Home')} {...lbryLinkProps}>
|
||||
<img src={OdyseeLogo} className=" mobile-only" />
|
||||
<img src={OdyseeLogoWithText} className=" mobile-hidden" />
|
||||
</Button>
|
||||
<Button className="file-viewer__overlay-logo" icon={ICONS.LBRY} aria-label={__('Home')} {...lbryLinkProps} />
|
||||
{isInApp && <FilePrice uri={uri} />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 29 KiB |
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import { LOGO_TITLE, ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
import * as PAGES from 'constants/pages';
|
||||
@@ -11,6 +10,7 @@ import WunderBar from 'component/wunderbar';
|
||||
import Icon from 'component/common/icon';
|
||||
import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button';
|
||||
import NavigationButton from 'component/navigationButton';
|
||||
import { LOGO_TITLE } from 'config';
|
||||
import { useIsMobile } from 'effects/use-screensize';
|
||||
import NotificationBubble from 'component/notificationBubble';
|
||||
import NotificationHeaderButton from 'component/notificationHeaderButton';
|
||||
@@ -19,8 +19,6 @@ import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import { remote } from 'electron';
|
||||
import { IS_MAC } from 'component/app/view';
|
||||
// @endif
|
||||
import OdyseeLogoWithWhiteText from './odysee_white.png';
|
||||
import OdyseeLogoWithText from './odysee.png';
|
||||
|
||||
type Props = {
|
||||
user: ?User,
|
||||
@@ -88,8 +86,8 @@ const Header = (props: Props) => {
|
||||
sidebarOpen,
|
||||
setSidebarOpen,
|
||||
isAbsoluteSideNavHidden,
|
||||
hideCancel,
|
||||
user,
|
||||
hideCancel,
|
||||
activeChannelClaim,
|
||||
} = props;
|
||||
const isMobile = useIsMobile();
|
||||
@@ -100,8 +98,8 @@ const Header = (props: Props) => {
|
||||
const isPwdResetPage = history.location.pathname.includes(PAGES.AUTH_PASSWORD_RESET);
|
||||
const hasBackout = Boolean(backout);
|
||||
const { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
|
||||
// const notificationsEnabled = (user && user.experimental_ui) || false; // fix this
|
||||
const livestreamEnabled = (ENABLE_NO_SOURCE_CLAIMS && user && user.experimental_ui) || false;
|
||||
const notificationsEnabled = (user && user.experimental_ui) || false;
|
||||
const livestreamEnabled = (user && user.experimental_ui) || false;
|
||||
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url;
|
||||
|
||||
// Sign out if they click the "x" when they are on the password prompt
|
||||
@@ -235,12 +233,19 @@ const Header = (props: Props) => {
|
||||
icon={ICONS.MENU}
|
||||
onClick={() => setSidebarOpen(!sidebarOpen)}
|
||||
>
|
||||
{isAbsoluteSideNavHidden && isMobile && <NotificationBubble />}
|
||||
{isAbsoluteSideNavHidden && isMobile && notificationsEnabled && <NotificationBubble />}
|
||||
</Button>
|
||||
</span>
|
||||
)}
|
||||
<Button
|
||||
className="header__navigation-item header__navigation-item--lbry header__navigation-item--button-mobile"
|
||||
className="header__navigation-item header__navigation-item--lbry"
|
||||
// @if TARGET='app'
|
||||
label={'LBRY'}
|
||||
// @endif
|
||||
// @if TARGET='web'
|
||||
label={LOGO_TITLE} // eslint-disable-line
|
||||
// @endif
|
||||
icon={ICONS.LBRY}
|
||||
onClick={() => {
|
||||
if (history.location.pathname === '/') window.location.reload();
|
||||
}}
|
||||
@@ -250,12 +255,7 @@ const Header = (props: Props) => {
|
||||
}}
|
||||
// @endif
|
||||
{...homeButtonNavigationProps}
|
||||
>
|
||||
<img
|
||||
src={currentTheme === 'light' ? OdyseeLogoWithText : OdyseeLogoWithWhiteText}
|
||||
className="header__odysee"
|
||||
/>
|
||||
</Button>
|
||||
/>
|
||||
|
||||
{!authHeader && (
|
||||
<div className="header__center">
|
||||
@@ -272,10 +272,14 @@ const Header = (props: Props) => {
|
||||
|
||||
<HeaderMenuButtons
|
||||
authenticated={authenticated}
|
||||
notificationsEnabled
|
||||
notificationsEnabled={notificationsEnabled}
|
||||
history={history}
|
||||
handleThemeToggle={handleThemeToggle}
|
||||
currentTheme={currentTheme}
|
||||
activeChannelUrl={activeChannelUrl}
|
||||
openSignOutModal={openSignOutModal}
|
||||
email={email}
|
||||
signOut={signOut}
|
||||
livestreamEnabled={livestreamEnabled}
|
||||
/>
|
||||
</div>
|
||||
@@ -393,11 +397,26 @@ type HeaderMenuButtonProps = {
|
||||
history: { push: (string) => void },
|
||||
handleThemeToggle: (string) => void,
|
||||
currentTheme: string,
|
||||
activeChannelUrl: ?string,
|
||||
openSignOutModal: () => void,
|
||||
email: ?string,
|
||||
signOut: () => void,
|
||||
livestreamEnabled: boolean,
|
||||
};
|
||||
|
||||
function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
||||
const { authenticated, notificationsEnabled, history, handleThemeToggle, currentTheme, livestreamEnabled } = props;
|
||||
const {
|
||||
authenticated,
|
||||
notificationsEnabled,
|
||||
history,
|
||||
handleThemeToggle,
|
||||
currentTheme,
|
||||
activeChannelUrl,
|
||||
openSignOutModal,
|
||||
email,
|
||||
signOut,
|
||||
livestreamEnabled,
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<div className="header__buttons">
|
||||
@@ -425,17 +444,15 @@ function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
||||
<Icon aria-hidden icon={ICONS.CHANNEL} />
|
||||
{__('New Channel')}
|
||||
</MenuItem>
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.YOUTUBE_SYNC}`)}>
|
||||
<Icon aria-hidden icon={ICONS.YOUTUBE} />
|
||||
{__('Sync YouTube Channel')}
|
||||
</MenuItem>
|
||||
|
||||
{livestreamEnabled && (
|
||||
{/* Go Live Button for LiveStreaming */}
|
||||
{(livestreamEnabled) &&(
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.LIVESTREAM}`)}>
|
||||
<Icon aria-hidden icon={ICONS.VIDEO} />
|
||||
{__('Go Live')}
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
</MenuList>
|
||||
</Menu>
|
||||
)}
|
||||
@@ -457,7 +474,7 @@ function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list--header">
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.SETTINGS}`)}>
|
||||
<Icon aria-hidden tooltip icon={ICONS.SETTINGS} />
|
||||
<Icon aria-hidden tootlip icon={ICONS.SETTINGS} />
|
||||
{__('Settings')}
|
||||
</MenuItem>
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.HELP}`)}>
|
||||
|
||||
@@ -43,8 +43,8 @@ const LastReleaseChanges = (props: Props) => {
|
||||
|
||||
setFetchingReleaseChanges(true);
|
||||
fetch(lastReleaseUrl, options)
|
||||
.then((response) => response.json())
|
||||
.then((response) => {
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
setReleaseTag(response.tag_name);
|
||||
setReleaseChanges(response.body);
|
||||
setFetchingReleaseChanges(false);
|
||||
@@ -70,7 +70,7 @@ const LastReleaseChanges = (props: Props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="release__notes">
|
||||
<div>
|
||||
{releaseVersionTitle}
|
||||
<p>
|
||||
<MarkdownPreview content={releaseChanges} />
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import { doCommentSocketConnect, doCommentSocketDisconnect } from 'redux/actions/websocket';
|
||||
import { doCommentSocketConnect } from 'redux/actions/websocket';
|
||||
import { doCommentList } from 'redux/actions/comments';
|
||||
import { makeSelectTopLevelCommentsForUri, selectIsFetchingComments } from 'redux/selectors/comments';
|
||||
import LivestreamFeed from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
comments: makeSelectTopLevelCommentsForUri(props.uri)(state).slice(0, 25),
|
||||
comments: makeSelectTopLevelCommentsForUri(props.uri)(state),
|
||||
fetchingComments: selectIsFetchingComments(state),
|
||||
});
|
||||
|
||||
export default connect(select, { doCommentSocketConnect, doCommentSocketDisconnect, doCommentList })(LivestreamFeed);
|
||||
export default connect(select, { doCommentSocketConnect, doCommentList })(LivestreamFeed);
|
||||
@@ -4,31 +4,22 @@ import classnames from 'classnames';
|
||||
import Card from 'component/common/card';
|
||||
import Spinner from 'component/spinner';
|
||||
import CommentCreate from 'component/commentCreate';
|
||||
import CommentView from 'component/comment';
|
||||
import Button from 'component/button';
|
||||
import MarkdownPreview from 'component/common/markdown-preview';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?StreamClaim,
|
||||
activeViewers: number,
|
||||
embed?: boolean,
|
||||
doCommentSocketConnect: (string, string) => void,
|
||||
doCommentSocketDisconnect: (string) => void,
|
||||
doCommentSocketConnect: (string) => void,
|
||||
doCommentList: (string) => void,
|
||||
comments: Array<Comment>,
|
||||
fetchingComments: boolean,
|
||||
};
|
||||
|
||||
export default function LivestreamFeed(props: Props) {
|
||||
const {
|
||||
claim,
|
||||
uri,
|
||||
embed,
|
||||
doCommentSocketConnect,
|
||||
doCommentSocketDisconnect,
|
||||
comments,
|
||||
doCommentList,
|
||||
fetchingComments,
|
||||
} = props;
|
||||
const { claim, uri, embed, doCommentSocketConnect, comments, doCommentList, fetchingComments } = props;
|
||||
const commentsRef = React.createRef();
|
||||
const hasScrolledComments = React.useRef();
|
||||
const [performedInitialScroll, setPerformedInitialScroll] = React.useState(false);
|
||||
@@ -38,15 +29,9 @@ export default function LivestreamFeed(props: Props) {
|
||||
React.useEffect(() => {
|
||||
if (claimId) {
|
||||
doCommentList(uri);
|
||||
doCommentSocketConnect(uri, claimId);
|
||||
doCommentSocketConnect(claimId);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (claimId) {
|
||||
doCommentSocketDisconnect(claimId);
|
||||
}
|
||||
};
|
||||
}, [claimId, uri, doCommentList, doCommentSocketConnect, doCommentSocketDisconnect]);
|
||||
}, [claimId, uri]);
|
||||
|
||||
React.useEffect(() => {
|
||||
const element = commentsRef.current;
|
||||
@@ -54,7 +39,7 @@ export default function LivestreamFeed(props: Props) {
|
||||
function handleScroll() {
|
||||
if (element) {
|
||||
const scrollHeight = element.scrollHeight - element.offsetHeight;
|
||||
const isAtBottom = scrollHeight <= element.scrollTop + 100;
|
||||
const isAtBottom = scrollHeight === element.scrollTop;
|
||||
|
||||
if (!isAtBottom) {
|
||||
hasScrolledComments.current = true;
|
||||
@@ -71,7 +56,7 @@ export default function LivestreamFeed(props: Props) {
|
||||
// Only update comment scroll if the user hasn't scrolled up to view old comments
|
||||
// If they have, do nothing
|
||||
if (!hasScrolledComments.current || !performedInitialScroll) {
|
||||
setTimeout(() => (element.scrollTop = element.scrollHeight - element.offsetHeight + 100), 20);
|
||||
element.scrollTop = element.scrollHeight - element.offsetHeight;
|
||||
|
||||
if (!performedInitialScroll) {
|
||||
setPerformedInitialScroll(true);
|
||||
@@ -113,17 +98,20 @@ export default function LivestreamFeed(props: Props) {
|
||||
<div className="livestream__comments">
|
||||
{comments.map((comment) => (
|
||||
<div key={comment.comment_id} className={classnames('livestream__comment')}>
|
||||
<CommentView
|
||||
livestream
|
||||
isTopLevel
|
||||
uri={uri}
|
||||
authorUri={comment.channel_url}
|
||||
author={comment.channel_name}
|
||||
claimId={comment.claim_id}
|
||||
commentId={comment.comment_id}
|
||||
message={comment.comment}
|
||||
timePosted={comment.timestamp * 1000}
|
||||
/>
|
||||
{comment.channel_url ? (
|
||||
<Button
|
||||
target="_blank"
|
||||
className={classnames('livestream__comment-author', {
|
||||
'livestream__comment-author--streamer':
|
||||
claim.signing_channel && claim.signing_channel.claim_id === comment.channel_id,
|
||||
})}
|
||||
navigate={comment.channel_url}
|
||||
label={comment.channel_name}
|
||||
/>
|
||||
) : (
|
||||
<div className="livestream__comment-author">{comment.channel_name}</div>
|
||||
)}
|
||||
<MarkdownPreview content={comment.comment} simpleLinks />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import LivestreamFeed from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(LivestreamFeed);
|
||||
@@ -1,38 +0,0 @@
|
||||
// @flow
|
||||
import { BITWAVE_USERNAME, BITWAVE_EMBED_URL } from 'constants/livestream';
|
||||
import React from 'react';
|
||||
import FileTitleSection from 'component/fileTitleSection';
|
||||
import LivestreamComments from 'component/livestreamComments';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?StreamClaim,
|
||||
activeViewers: number,
|
||||
};
|
||||
|
||||
export default function LivestreamFeed(props: Props) {
|
||||
const { claim, uri, activeViewers } = props;
|
||||
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="section card-stack">
|
||||
<div className="file-render file-render--video livestream">
|
||||
<div className="file-viewer">
|
||||
<iframe
|
||||
src={`${BITWAVE_EMBED_URL}/${BITWAVE_USERNAME}?skin=odysee&autoplay=1`}
|
||||
scrolling="no"
|
||||
allowFullScreen
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FileTitleSection uri={uri} livestream activeViewers={activeViewers} />
|
||||
</div>
|
||||
<LivestreamComments uri={uri} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, makeSelectThumbnailForUri } from 'lbry-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import LivestreamLayout from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(LivestreamLayout);
|
||||
@@ -7,41 +7,26 @@ import LivestreamComments from 'component/livestreamComments';
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?StreamClaim,
|
||||
isLive: boolean,
|
||||
activeViewers: number,
|
||||
};
|
||||
|
||||
export default function LivestreamLayout(props: Props) {
|
||||
const { claim, uri, isLive, activeViewers } = props;
|
||||
const { claim, uri, activeViewers } = props;
|
||||
|
||||
if (!claim || !claim.signing_channel) {
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const channelName = claim.signing_channel.name;
|
||||
const channelClaimId = claim.signing_channel.claim_id;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="section card-stack">
|
||||
<div className="file-render file-render--video livestream">
|
||||
<div className="file-viewer">
|
||||
<iframe
|
||||
src={`${BITWAVE_EMBED_URL}/${channelClaimId}?skin=odysee&autoplay=1`}
|
||||
scrolling="no"
|
||||
allowFullScreen
|
||||
/>
|
||||
<iframe src={`${BITWAVE_EMBED_URL}/${'doomtube'}?skin=odysee&autoplay=1`} scrolling="no" allowFullScreen />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!isLive && (
|
||||
<div className="help--notice">
|
||||
{__("%channel% isn't live right now, but the chat is! Check back later to watch the stream.", {
|
||||
channel: channelName || __('This channel'),
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
<FileTitleSection uri={uri} livestream isLive={isLive} activeViewers={activeViewers} />
|
||||
<FileTitleSection uri={uri} livestream activeViewers={activeViewers} />
|
||||
</div>
|
||||
<LivestreamComments uri={uri} />
|
||||
</>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
import { BITWAVE_API } from 'constants/livestream';
|
||||
import { LIVE_STREAM_TAG } from 'constants/livestream';
|
||||
import React from 'react';
|
||||
import Card from 'component/common/card';
|
||||
import ClaimPreview from 'component/claimPreview';
|
||||
@@ -13,63 +13,56 @@ export default function LivestreamLink(props: Props) {
|
||||
const { channelClaim } = props;
|
||||
const [livestreamClaim, setLivestreamClaim] = React.useState(false);
|
||||
const [isLivestreaming, setIsLivestreaming] = React.useState(false);
|
||||
const livestreamChannelId = (channelClaim && channelClaim.claim_id) || ''; // TODO: fail in a safer way, probably
|
||||
const livestreamChannelId = channelClaim.claim_id;
|
||||
|
||||
React.useEffect(() => {
|
||||
if (livestreamChannelId) {
|
||||
Lbry.claim_search({
|
||||
channel_ids: [livestreamChannelId],
|
||||
has_no_source: true,
|
||||
claim_type: ['stream'],
|
||||
Lbry.claim_search({
|
||||
channel_ids: [livestreamChannelId],
|
||||
any_tags: [LIVE_STREAM_TAG],
|
||||
claim_type: ['stream'],
|
||||
})
|
||||
.then((res) => {
|
||||
if (res && res.items && res.items.length > 0) {
|
||||
const claim = res.items[0];
|
||||
setLivestreamClaim(claim);
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
if (res && res.items && res.items.length > 0) {
|
||||
const claim = res.items[res.items.length - 1];
|
||||
setLivestreamClaim(claim);
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
.catch(() => {});
|
||||
}, [livestreamChannelId]);
|
||||
|
||||
React.useEffect(() => {
|
||||
function fetchIsStreaming() {
|
||||
// $FlowFixMe Bitwave's API can handle garbage
|
||||
fetch(`${BITWAVE_API}/${livestreamChannelId}`)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
if (res && res.success && res.data && res.data.live) {
|
||||
setIsLivestreaming(true);
|
||||
} else {
|
||||
setIsLivestreaming(false);
|
||||
}
|
||||
})
|
||||
.catch((e) => {});
|
||||
}
|
||||
|
||||
let interval;
|
||||
if (livestreamChannelId) {
|
||||
if (!interval) fetchIsStreaming();
|
||||
interval = setInterval(fetchIsStreaming, 10 * 1000);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (interval) {
|
||||
clearInterval(interval);
|
||||
}
|
||||
};
|
||||
// function fetchIsStreaming() {
|
||||
// // fetch(``)
|
||||
// // .then((res) => res.json())
|
||||
// // .then((res) => {
|
||||
// // if (res && res.data && res.data.live) {
|
||||
// // setIsLivestreaming(true);
|
||||
// // } else {
|
||||
// // setIsLivestreaming(false);
|
||||
// // }
|
||||
// // })
|
||||
// // .catch((e) => {});
|
||||
// }
|
||||
// let interval;
|
||||
// if (livestreamChannelId) {
|
||||
// interval = setInterval(fetchIsStreaming, 5000);
|
||||
// }
|
||||
// return () => {
|
||||
// if (interval) {
|
||||
// clearInterval(interval);
|
||||
// }
|
||||
// };
|
||||
}, [livestreamChannelId]);
|
||||
|
||||
if (!livestreamClaim || !isLivestreaming) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// gonna pass the wrapper in so I don't have to rewrite the dmca/blocking logic in claimPreview.
|
||||
const element = (props: { children: any }) => (
|
||||
<Card className="livestream__channel-link" title={__('Live stream in progress')}>
|
||||
{props.children}
|
||||
</Card>
|
||||
return (
|
||||
<Card
|
||||
className="livestream__channel-link"
|
||||
title="Live stream in progress"
|
||||
actions={<ClaimPreview uri={livestreamClaim.canonical_url} livestream type="inline" />}
|
||||
/>
|
||||
);
|
||||
|
||||
return <ClaimPreview uri={livestreamClaim.canonical_url} wrapperElement={element} type="inline" />;
|
||||
}
|
||||
@@ -67,10 +67,7 @@ function MarkdownLink(props: Props) {
|
||||
const possibleLbryUrl = linkPathPlusHash ? `lbry://${linkPathPlusHash.replace(/:/g, '#')}` : undefined;
|
||||
|
||||
const lbryLinkIsValid = possibleLbryUrl && isURIValid(possibleLbryUrl);
|
||||
const isMarkdownLinkWithLabel =
|
||||
children && Array.isArray(children) && React.Children.count(children) === 1 && children.toString() !== href;
|
||||
|
||||
if (lbryLinkIsValid && !isMarkdownLinkWithLabel) {
|
||||
if (lbryLinkIsValid) {
|
||||
lbryUrlFromLink = possibleLbryUrl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
|
||||
import { selectUnreadNotificationCount } from 'redux/selectors/notifications';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import NotificationBubble from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
unseenCount: selectUnseenNotificationCount(state),
|
||||
const select = state => ({
|
||||
unreadCount: selectUnreadNotificationCount(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
|
||||
@@ -3,14 +3,16 @@ import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
unseenCount: number,
|
||||
unreadCount: number,
|
||||
inline: boolean,
|
||||
user: ?User,
|
||||
};
|
||||
|
||||
export default function NotificationHeaderButton(props: Props) {
|
||||
const { unseenCount, inline = false } = props;
|
||||
const { unreadCount, inline = false, user } = props;
|
||||
const notificationsEnabled = user && user.experimental_ui;
|
||||
|
||||
if (unseenCount === 0) {
|
||||
if (unreadCount === 0 || !notificationsEnabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -22,10 +24,10 @@ export default function NotificationHeaderButton(props: Props) {
|
||||
>
|
||||
<span
|
||||
className={classnames('notification__count', {
|
||||
'notification__bubble--small': unseenCount > 9,
|
||||
'notification__bubble--small': unreadCount > 9,
|
||||
})}
|
||||
>
|
||||
{unseenCount > 20 ? '20+' : unseenCount}
|
||||
{unreadCount > 20 ? '20+' : unreadCount}
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
|
||||
@@ -19,8 +19,9 @@ export default function NotificationHeaderButton(props: Props) {
|
||||
// notifications,
|
||||
// fetching,
|
||||
doSeeAllNotifications,
|
||||
// user,
|
||||
user,
|
||||
} = props;
|
||||
const notificationsEnabled = user && user.experimental_ui;
|
||||
const { push } = useHistory();
|
||||
|
||||
function handleMenuClick() {
|
||||
@@ -31,6 +32,10 @@ export default function NotificationHeaderButton(props: Props) {
|
||||
push(`/$/${PAGES.NOTIFICATIONS}`);
|
||||
}
|
||||
|
||||
if (!notificationsEnabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
onClick={handleMenuClick}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React, { Fragment } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import SideNavigation from 'component/sideNavigation';
|
||||
@@ -22,6 +21,7 @@ type Props = {
|
||||
isUpgradeAvailable: boolean,
|
||||
authPage: boolean,
|
||||
filePage: boolean,
|
||||
homePage: boolean,
|
||||
noHeader: boolean,
|
||||
noFooter: boolean,
|
||||
noSideNavigation: boolean,
|
||||
@@ -56,20 +56,16 @@ function Page(props: Props) {
|
||||
const {
|
||||
location: { pathname },
|
||||
} = useHistory();
|
||||
const [sidebarOpen, setSidebarOpen] = usePersistedState('sidebar', false);
|
||||
const [sidebarOpen, setSidebarOpen] = usePersistedState('sidebar', true);
|
||||
const isMediumScreen = useIsMediumScreen();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
let isOnFilePage = false;
|
||||
try {
|
||||
if (pathname.includes(`/$/${PAGES.LIVESTREAM}`)) {
|
||||
const url = pathname.slice(1).replace(/:/g, '#');
|
||||
const { isChannel } = parseURI(url);
|
||||
if (!isChannel) {
|
||||
isOnFilePage = true;
|
||||
} else {
|
||||
const url = pathname.slice(1).replace(/:/g, '#');
|
||||
const { isChannel } = parseURI(url);
|
||||
if (!isChannel) {
|
||||
isOnFilePage = true;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
import React, { useEffect } from 'react';
|
||||
import { FF_MAX_CHARS_IN_POST } from 'constants/form-field';
|
||||
import { FormField } from 'component/common/form';
|
||||
|
||||
type Props = {
|
||||
@@ -11,10 +12,10 @@ type Props = {
|
||||
fileMimeType: ?string,
|
||||
streamingUrl: ?string,
|
||||
isStillEditing: boolean,
|
||||
fetchStreamingUrl: (string) => void,
|
||||
setPrevFileText: (string) => void,
|
||||
fetchStreamingUrl: string => void,
|
||||
setPrevFileText: string => void,
|
||||
updatePublishForm: ({}) => void,
|
||||
setCurrentFileType: (string) => void,
|
||||
setCurrentFileType: string => void,
|
||||
};
|
||||
|
||||
function PostEditor(props: Props) {
|
||||
@@ -61,7 +62,7 @@ function PostEditor(props: Props) {
|
||||
|
||||
useEffect(() => {
|
||||
function readFileStream(url) {
|
||||
return fetch(url).then((res) => res.text());
|
||||
return fetch(url).then(res => res.text());
|
||||
}
|
||||
|
||||
async function updateEditorText(url) {
|
||||
@@ -106,7 +107,8 @@ function PostEditor(props: Props) {
|
||||
placeholder={__('My content for this post...')}
|
||||
value={ready ? fileText : __('Loading...')}
|
||||
disabled={!ready || disabled}
|
||||
onChange={(value) => updatePublishForm({ fileText: value })}
|
||||
onChange={value => updatePublishForm({ fileText: value })}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_POST}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import FileActions from 'component/fileActions';
|
||||
import FileRenderInitiator from 'component/fileRenderInitiator';
|
||||
import FileRenderInline from 'component/fileRenderInline';
|
||||
import FileViewCount from 'component/fileViewCount';
|
||||
import { formatCredits } from 'lbry-redux';
|
||||
import CreditAmount from 'component/common/credit-amount';
|
||||
import DateTime from 'component/dateTime';
|
||||
|
||||
@@ -22,6 +23,7 @@ function PostViewer(props: Props) {
|
||||
}
|
||||
|
||||
const amount = parseFloat(claim.amount) + parseFloat(claim.meta.support_amount);
|
||||
const formattedAmount = formatCredits(amount, 2, true);
|
||||
|
||||
return (
|
||||
<div className="post">
|
||||
@@ -31,7 +33,7 @@ function PostViewer(props: Props) {
|
||||
</span>
|
||||
</FileTitle>
|
||||
<div className="post__info">
|
||||
<CreditAmount amount={amount} />
|
||||
<CreditAmount amount={formattedAmount} />
|
||||
<FileViewCount uri={uri} />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ function PublishAdditionalOptions(props: Props) {
|
||||
type="select"
|
||||
name="content_language"
|
||||
value={language}
|
||||
onChange={(event) => updatePublishForm({ language: event.target.value })}
|
||||
onChange={event => updatePublishForm({ language: event.target.value })}
|
||||
>
|
||||
{Object.entries(SUPPORTED_LANGUAGES).map(([langkey, langName]) => (
|
||||
// $FlowFixMe
|
||||
@@ -176,12 +176,12 @@ function PublishAdditionalOptions(props: Props) {
|
||||
licenseUrl: newLicenseUrl,
|
||||
})
|
||||
}
|
||||
handleLicenseDescriptionChange={(event) =>
|
||||
handleLicenseDescriptionChange={event =>
|
||||
updatePublishForm({
|
||||
otherLicenseDescription: event.target.value,
|
||||
})
|
||||
}
|
||||
handleLicenseUrlChange={(event) => updatePublishForm({ licenseUrl: event.target.value })}
|
||||
handleLicenseUrlChange={event => updatePublishForm({ licenseUrl: event.target.value })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -328,6 +328,7 @@ function PublishFile(props: Props) {
|
||||
|
||||
const isPublishFile = mode === PUBLISH_MODES.FILE;
|
||||
const isPublishPost = mode === PUBLISH_MODES.POST;
|
||||
const isPublishLivestream = mode === PUBLISH_MODES.LIVESTREAM;
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -338,7 +339,7 @@ function PublishFile(props: Props) {
|
||||
{publishing && <Spinner type={'small'} />}
|
||||
{inProgress && (
|
||||
<div>
|
||||
<Button button="close" label={__('New')} icon={ICONS.REFRESH} onClick={clearPublish} />
|
||||
<Button button="close" label={__('Cancel')} icon={ICONS.REMOVE} onClick={clearPublish} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -346,8 +347,7 @@ function PublishFile(props: Props) {
|
||||
subtitle={isStillEditing && __('You are currently editing your upload.')}
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<PublishName uri={uri} />
|
||||
|
||||
<PublishName />
|
||||
<FormField
|
||||
type="text"
|
||||
name="content_title"
|
||||
@@ -357,18 +357,21 @@ function PublishFile(props: Props) {
|
||||
value={title}
|
||||
onChange={handleTitleChange}
|
||||
/>
|
||||
{isPublishFile && (
|
||||
{(isPublishFile || isPublishLivestream) && (
|
||||
<FileSelector
|
||||
label={__('Video file')}
|
||||
label={__('File')}
|
||||
disabled={disabled}
|
||||
currentPath={currentFile}
|
||||
onFileChosen={handleFileChange}
|
||||
// https://stackoverflow.com/questions/19107685/safari-input-type-file-accept-video-ignores-mp4-files
|
||||
accept="video/mp4,video/x-m4v,video/*"
|
||||
placeholder={__('Select video file to upload')}
|
||||
/>
|
||||
)}
|
||||
{isPublishFile && getMessage()}
|
||||
|
||||
{isPublishLivestream && (
|
||||
<div className="help--warning">
|
||||
While livestreaming is in beta, you still need to choose a file to upload. Please choose a small file. No
|
||||
one will see this file.
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isPublishPost && (
|
||||
<PostEditor
|
||||
@@ -380,7 +383,7 @@ function PublishFile(props: Props) {
|
||||
setCurrentFileType={setCurrentFileType}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isPublishFile && getMessage()}
|
||||
{/* @if TARGET='app' */}
|
||||
{isPublishFile && (
|
||||
<FormField
|
||||
|
||||
@@ -12,18 +12,15 @@ import {
|
||||
doPrepareEdit,
|
||||
doCheckPublishNameAvailability,
|
||||
SETTINGS,
|
||||
selectMyChannelClaims,
|
||||
} from 'lbry-redux';
|
||||
import { doPublishDesktop } from 'redux/actions/publish';
|
||||
import { selectUnclaimedRewardValue } from 'redux/selectors/rewards';
|
||||
import { selectModal, selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import PublishPage from './view';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
|
||||
const select = (state) => ({
|
||||
const select = state => ({
|
||||
...selectPublishFormValues(state),
|
||||
user: selectUser(state),
|
||||
// The winning claim for a short lbry uri
|
||||
amountNeededForTakeover: selectTakeOverAmount(state),
|
||||
// My previously published claims under this short lbry uri
|
||||
@@ -36,18 +33,17 @@ const select = (state) => ({
|
||||
modal: selectModal(state),
|
||||
enablePublishPreview: makeSelectClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW)(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
incognito: selectIncognito(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
updatePublishForm: (value) => dispatch(doUpdatePublishForm(value)),
|
||||
const perform = dispatch => ({
|
||||
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
||||
clearPublish: () => dispatch(doClearPublish()),
|
||||
resolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
publish: (filePath, preview) => dispatch(doPublishDesktop(filePath, preview)),
|
||||
prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)),
|
||||
resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()),
|
||||
checkAvailability: (name) => dispatch(doCheckPublishNameAvailability(name)),
|
||||
checkAvailability: name => dispatch(doCheckPublishNameAvailability(name)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(PublishPage);
|
||||
@@ -8,7 +8,7 @@
|
||||
File upload is carried out in the background by that function.
|
||||
*/
|
||||
|
||||
import { SITE_NAME, ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config';
|
||||
import { SITE_NAME } from 'config';
|
||||
import React, { useEffect } from 'react';
|
||||
import { buildURI, isURIValid, isNameValid, THUMBNAIL_STATUSES } from 'lbry-redux';
|
||||
import Button from 'component/button';
|
||||
@@ -25,14 +25,20 @@ import SelectThumbnail from 'component/selectThumbnail';
|
||||
import Card from 'component/common/card';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import * as PUBLISH_MODES from 'constants/publish_types';
|
||||
import { useHistory } from 'react-router';
|
||||
import Spinner from 'component/spinner';
|
||||
|
||||
// @if TARGET='app'
|
||||
import fs from 'fs';
|
||||
import tempy from 'tempy';
|
||||
// @endif
|
||||
|
||||
const MODES = Object.values(PUBLISH_MODES);
|
||||
|
||||
const MODE_TO_I18N_STR = {
|
||||
[PUBLISH_MODES.FILE]: 'File',
|
||||
[PUBLISH_MODES.POST]: 'Post --[noun, markdown post tab button]--',
|
||||
[PUBLISH_MODES.LIVESTREAM]: 'Livestream --[noun, livestream tab button]--',
|
||||
};
|
||||
|
||||
type Props = {
|
||||
disabled: boolean,
|
||||
tags: Array<Tag>,
|
||||
@@ -80,11 +86,19 @@ type Props = {
|
||||
enablePublishPreview: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
incognito: boolean,
|
||||
user: ?{ experimental_ui: boolean },
|
||||
};
|
||||
|
||||
function PublishForm(props: Props) {
|
||||
// Detect upload type from query in URL
|
||||
const [mode, setMode] = React.useState(PUBLISH_MODES.FILE);
|
||||
const [autoSwitchMode, setAutoSwitchMode] = React.useState(true);
|
||||
|
||||
// Used to checl if the url name has changed:
|
||||
// A new file needs to be provided
|
||||
const [prevName, setPrevName] = React.useState(false);
|
||||
// Used to checl if the file has been modified by user
|
||||
const [fileEdited, setFileEdited] = React.useState(false);
|
||||
const [prevFileText, setPrevFileText] = React.useState('');
|
||||
|
||||
const {
|
||||
thumbnail,
|
||||
name,
|
||||
@@ -111,36 +125,10 @@ function PublishForm(props: Props) {
|
||||
enablePublishPreview,
|
||||
activeChannelClaim,
|
||||
incognito,
|
||||
user,
|
||||
} = props;
|
||||
|
||||
const { replace, location } = useHistory();
|
||||
const urlParams = new URLSearchParams(location.search);
|
||||
const uploadType = urlParams.get('type');
|
||||
// $FlowFixMe
|
||||
const MODES =
|
||||
ENABLE_NO_SOURCE_CLAIMS && user && user.experimental_ui
|
||||
? Object.values(PUBLISH_MODES)
|
||||
: Object.values(PUBLISH_MODES).filter((mode) => mode !== PUBLISH_MODES.LIVESTREAM);
|
||||
|
||||
const MODE_TO_I18N_STR = {
|
||||
[PUBLISH_MODES.FILE]: SIMPLE_SITE ? 'Video' : 'File',
|
||||
[PUBLISH_MODES.POST]: 'Post --[noun, markdown post tab button]--',
|
||||
[PUBLISH_MODES.LIVESTREAM]: 'Livestream --[noun, livestream tab button]--',
|
||||
};
|
||||
// Component state
|
||||
const [mode, setMode] = React.useState(uploadType || PUBLISH_MODES.FILE);
|
||||
const [autoSwitchMode, setAutoSwitchMode] = React.useState(true);
|
||||
|
||||
// Used to check if the url name has changed:
|
||||
// A new file needs to be provided
|
||||
const [prevName, setPrevName] = React.useState(false);
|
||||
// Used to check if the file has been modified by user
|
||||
const [fileEdited, setFileEdited] = React.useState(false);
|
||||
const [prevFileText, setPrevFileText] = React.useState('');
|
||||
|
||||
const TAGS_LIMIT = 5;
|
||||
const fileFormDisabled = mode === PUBLISH_MODES.FILE && !filePath;
|
||||
const fileFormDisabled = (mode === PUBLISH_MODES.FILE || mode === PUBLISH_MODES.LIVESTREAM) && !filePath;
|
||||
const emptyPostError = mode === PUBLISH_MODES.POST && (!fileText || fileText.trim() === '');
|
||||
const formDisabled = (fileFormDisabled && !editingURI) || emptyPostError || publishing;
|
||||
const isInProgress = filePath || editingURI || name || title;
|
||||
@@ -180,35 +168,15 @@ function PublishForm(props: Props) {
|
||||
}
|
||||
}, [modal]);
|
||||
|
||||
const isLivestream = mode === PUBLISH_MODES.LIVESTREAM;
|
||||
let submitLabel;
|
||||
if (publishing) {
|
||||
if (isStillEditing) {
|
||||
submitLabel = __('Saving...');
|
||||
} else if (isLivestream) {
|
||||
submitLabel = __('Creating...');
|
||||
} else {
|
||||
submitLabel = __('Uploading...');
|
||||
}
|
||||
if (isStillEditing) {
|
||||
submitLabel = !publishing ? __('Save') : __('Saving...');
|
||||
} else if (previewing) {
|
||||
submitLabel = __('Preparing...');
|
||||
} else {
|
||||
if (isStillEditing) {
|
||||
submitLabel = __('Save');
|
||||
} else if (isLivestream) {
|
||||
submitLabel = __('Create');
|
||||
} else {
|
||||
submitLabel = __('Upload');
|
||||
}
|
||||
submitLabel = !publishing ? __('Upload') : __('Uploading...');
|
||||
}
|
||||
|
||||
// if you enter the page and it is stuck in publishing, "stop it."
|
||||
useEffect(() => {
|
||||
if (publishing) {
|
||||
clearPublish();
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!thumbnail) {
|
||||
resetThumbnailStatus();
|
||||
@@ -257,17 +225,10 @@ function PublishForm(props: Props) {
|
||||
}
|
||||
}, [name, activeChannelName, resolveUri, updatePublishForm, checkAvailability]);
|
||||
|
||||
useEffect(() => {
|
||||
// because editingURI is lbry://channel_short/claim_long and that particular shape won't map to the claimId yet
|
||||
if (editingURI) {
|
||||
resolveUri(editingURI);
|
||||
}
|
||||
}, [editingURI, resolveUri]);
|
||||
|
||||
useEffect(() => {
|
||||
updatePublishForm({
|
||||
isMarkdownPost: mode === PUBLISH_MODES.POST,
|
||||
isLivestreamPublish: isLivestream,
|
||||
isLivestreamPublish: mode === PUBLISH_MODES.LIVESTREAM,
|
||||
});
|
||||
}, [mode, updatePublishForm]);
|
||||
|
||||
@@ -276,7 +237,7 @@ function PublishForm(props: Props) {
|
||||
updatePublishForm({ channel: undefined });
|
||||
|
||||
// Anonymous livestreams aren't supported
|
||||
if (isLivestream) {
|
||||
if (mode === PUBLISH_MODES.LIVESTREAM) {
|
||||
setMode(PUBLISH_MODES.FILE);
|
||||
}
|
||||
} else if (activeChannelName) {
|
||||
@@ -284,42 +245,6 @@ function PublishForm(props: Props) {
|
||||
}
|
||||
}, [activeChannelName, incognito, updatePublishForm]);
|
||||
|
||||
useEffect(() => {
|
||||
const _uploadType = uploadType && uploadType.toLowerCase();
|
||||
|
||||
// Default to standard file publish if none specified
|
||||
if (!_uploadType) {
|
||||
setMode(PUBLISH_MODES.FILE);
|
||||
return;
|
||||
}
|
||||
|
||||
// File publish
|
||||
if (_uploadType === PUBLISH_MODES.FILE.toLowerCase()) {
|
||||
setMode(PUBLISH_MODES.FILE);
|
||||
return;
|
||||
}
|
||||
// Post publish
|
||||
if (_uploadType === PUBLISH_MODES.POST.toLowerCase()) {
|
||||
setMode(PUBLISH_MODES.POST);
|
||||
return;
|
||||
}
|
||||
// LiveStream publish
|
||||
if (_uploadType === PUBLISH_MODES.LIVESTREAM.toLowerCase()) {
|
||||
setMode(PUBLISH_MODES.LIVESTREAM);
|
||||
return;
|
||||
}
|
||||
|
||||
// Default to standard file publish
|
||||
setMode(PUBLISH_MODES.FILE);
|
||||
}, [uploadType]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!uploadType) return;
|
||||
const newParams = new URLSearchParams();
|
||||
newParams.set('type', mode.toLowerCase());
|
||||
replace({ search: newParams.toString() });
|
||||
}, [mode, uploadType]);
|
||||
|
||||
// @if TARGET='web'
|
||||
function createWebFile() {
|
||||
if (fileText) {
|
||||
@@ -385,10 +310,15 @@ function PublishForm(props: Props) {
|
||||
}
|
||||
}
|
||||
// Publish file
|
||||
if (mode === PUBLISH_MODES.FILE || isLivestream) {
|
||||
if (mode === PUBLISH_MODES.FILE || mode === PUBLISH_MODES.LIVESTREAM) {
|
||||
runPublish = true;
|
||||
}
|
||||
|
||||
// (Try to) Prevent an anon livestream claim
|
||||
if (mode === PUBLISH_MODES.LIVESTREAM) {
|
||||
updatePublishForm({ channel: activeChannelName });
|
||||
}
|
||||
|
||||
if (runPublish) {
|
||||
if (enablePublishPreview) {
|
||||
setPreviewing(true);
|
||||
@@ -411,19 +341,13 @@ function PublishForm(props: Props) {
|
||||
}
|
||||
}, [autoSwitchMode, editingURI, fileMimeType, myClaimForUri, mode, setMode, setAutoSwitchMode]);
|
||||
|
||||
if (publishing) {
|
||||
return (
|
||||
<div className="main--empty">
|
||||
<h1 className="section__subtitle">{__('Publishing...')}</h1>
|
||||
<Spinner delayed />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Editing claim uri
|
||||
return (
|
||||
<div className="card-stack">
|
||||
<ChannelSelect hideAnon={isLivestream} disabled={disabled} />
|
||||
<ChannelSelect
|
||||
hideAnon={mode === PUBLISH_MODES.LIVESTREAM}
|
||||
disabled={disabled}
|
||||
/>
|
||||
|
||||
<PublishFile
|
||||
uri={uri}
|
||||
@@ -435,15 +359,13 @@ function PublishForm(props: Props) {
|
||||
setPrevFileText={setPrevFileText}
|
||||
header={
|
||||
<>
|
||||
{MODES.map((modeName) => (
|
||||
{MODES.map((modeName, index) => (
|
||||
<Button
|
||||
key={String(modeName)}
|
||||
key={index}
|
||||
icon={modeName}
|
||||
iconSize={18}
|
||||
label={__(MODE_TO_I18N_STR[String(modeName)] || '---')}
|
||||
button="alt"
|
||||
onClick={() => {
|
||||
// $FlowFixMe
|
||||
setMode(modeName);
|
||||
}}
|
||||
className={classnames('button-toggle', { 'button-toggle--active': mode === modeName })}
|
||||
@@ -458,14 +380,14 @@ function PublishForm(props: Props) {
|
||||
{mode === PUBLISH_MODES.FILE && <PublishDescription disabled={formDisabled} />}
|
||||
<Card actions={<SelectThumbnail />} />
|
||||
<TagsSelect
|
||||
suggestMature={!SIMPLE_SITE}
|
||||
suggestMature
|
||||
disableAutoFocus
|
||||
hideHeader
|
||||
label={__('Selected Tags')}
|
||||
empty={__('No tags added')}
|
||||
limitSelect={TAGS_LIMIT}
|
||||
help={__(
|
||||
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'."
|
||||
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If mature content, ensure it is tagged mature. Tag abuse and missing mature tags will not be tolerated."
|
||||
)}
|
||||
placeholder={__('gaming, crypto')}
|
||||
onSelect={(newTags) => {
|
||||
@@ -485,7 +407,7 @@ function PublishForm(props: Props) {
|
||||
/>
|
||||
|
||||
<PublishBid disabled={isStillEditing || formDisabled} />
|
||||
{!isLivestream && <PublishPrice disabled={formDisabled} />}
|
||||
<PublishPrice disabled={formDisabled} />
|
||||
<PublishAdditionalOptions disabled={formDisabled} />
|
||||
</div>
|
||||
)}
|
||||
@@ -503,7 +425,7 @@ function PublishForm(props: Props) {
|
||||
previewing
|
||||
}
|
||||
/>
|
||||
<Button button="link" onClick={clearPublish} label={__('New')} />
|
||||
<Button button="link" onClick={clearPublish} label={__('Cancel')} />
|
||||
</div>
|
||||
<p className="help">
|
||||
{!formDisabled && !formValid ? (
|
||||
|
||||
@@ -13,6 +13,7 @@ type Props = {
|
||||
|
||||
function NameHelpText(props: Props) {
|
||||
const { uri, myClaimForUri, onEditMyClaim, isStillEditing } = props;
|
||||
|
||||
let nameHelpText;
|
||||
|
||||
if (isStillEditing) {
|
||||
|
||||
@@ -3,19 +3,17 @@ import { makeSelectClaimForUri, makeSelectClaimIsNsfw } from 'lbry-redux';
|
||||
import { doSearch } from 'redux/actions/search';
|
||||
import { makeSelectRecommendedContentForUri, selectIsSearching } from 'redux/selectors/search';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
|
||||
import RecommendedVideos from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
mature: makeSelectClaimIsNsfw(props.uri)(state),
|
||||
recommendedContent: makeSelectRecommendedContentForUri(props.uri)(state),
|
||||
nextRecommendedUri: makeSelectNextUnplayedRecommended(props.uri)(state),
|
||||
isSearching: selectIsSearching(state),
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
const perform = dispatch => ({
|
||||
search: (query, options) => dispatch(doSearch(query, options)),
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import { SEARCH_OPTIONS } from 'constants/search';
|
||||
import { SHOW_ADS, SIMPLE_SITE } from 'config';
|
||||
import React from 'react';
|
||||
import ClaimList from 'component/claimList';
|
||||
@@ -16,7 +15,6 @@ type Props = {
|
||||
uri: string,
|
||||
claim: ?StreamClaim,
|
||||
recommendedContent: Array<string>,
|
||||
nextRecommendedUri: string,
|
||||
isSearching: boolean,
|
||||
search: (string, Options) => void,
|
||||
mature: boolean,
|
||||
@@ -24,7 +22,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export default function RecommendedContent(props: Props) {
|
||||
const { uri, claim, search, mature, recommendedContent, nextRecommendedUri, isSearching, isAuthenticated } = props;
|
||||
const { uri, claim, search, mature, recommendedContent, isSearching, isAuthenticated } = props;
|
||||
const isMobile = useIsMobile();
|
||||
const isMedium = useIsMediumScreen();
|
||||
|
||||
@@ -33,13 +31,7 @@ export default function RecommendedContent(props: Props) {
|
||||
if (stringifiedClaim) {
|
||||
const jsonClaim = JSON.parse(stringifiedClaim);
|
||||
if (jsonClaim && jsonClaim.value && jsonClaim.claim_id) {
|
||||
const options: Options = {
|
||||
size: 20,
|
||||
related_to: jsonClaim.claim_id,
|
||||
isBackgroundSearch: true,
|
||||
[SEARCH_OPTIONS.CLAIM_TYPE]: SEARCH_OPTIONS.INCLUDE_FILES,
|
||||
[SEARCH_OPTIONS.MEDIA_VIDEO]: true,
|
||||
};
|
||||
const options: Options = { size: 20, related_to: jsonClaim.claim_id, isBackgroundSearch: true };
|
||||
if (jsonClaim && !mature) {
|
||||
options['nsfw'] = false;
|
||||
}
|
||||
@@ -49,27 +41,11 @@ export default function RecommendedContent(props: Props) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [stringifiedClaim, mature, search]);
|
||||
|
||||
function reorderList(recommendedContent) {
|
||||
let newList = recommendedContent;
|
||||
if (newList) {
|
||||
const index = newList.indexOf(nextRecommendedUri);
|
||||
if (index === -1) {
|
||||
// This would be weird. Shouldn't happen since it is derived from the same list.
|
||||
} else if (index !== 0) {
|
||||
// Swap the "next" item to the top of the list
|
||||
const a = newList[0];
|
||||
newList[0] = nextRecommendedUri;
|
||||
newList[index] = a;
|
||||
}
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
}, [stringifiedClaim, mature]);
|
||||
|
||||
React.useEffect(() => {
|
||||
getRecommendedContent();
|
||||
}, [uri, getRecommendedContent]);
|
||||
}, [uri]);
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -81,7 +57,7 @@ export default function RecommendedContent(props: Props) {
|
||||
<ClaimList
|
||||
type="small"
|
||||
loading={isSearching}
|
||||
uris={reorderList(recommendedContent)}
|
||||
uris={recommendedContent}
|
||||
hideMenu={isMobile}
|
||||
injectedItem={
|
||||
SHOW_ADS && IS_WEB ? (
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
selectFetchingMyChannels,
|
||||
} from 'lbry-redux';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import RepostCreate from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -37,7 +37,6 @@ const select = (state, props) => ({
|
||||
isResolvingEnteredRepost: props.repostUri && makeSelectIsUriResolving(`lbry://${props.repostUri}`)(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
fetchingMyChannels: selectFetchingMyChannels(state),
|
||||
incognito: selectIncognito(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
|
||||
@@ -20,20 +20,20 @@ import Spinner from 'component/spinner';
|
||||
type Props = {
|
||||
doToast: ({ message: string }) => void,
|
||||
doClearRepostError: () => void,
|
||||
doRepost: (StreamRepostOptions) => Promise<*>,
|
||||
doRepost: StreamRepostOptions => Promise<*>,
|
||||
title: string,
|
||||
claim?: StreamClaim,
|
||||
enteredContentClaim?: StreamClaim,
|
||||
balance: number,
|
||||
channels: ?Array<ChannelClaim>,
|
||||
doCheckPublishNameAvailability: (string) => Promise<*>,
|
||||
doCheckPublishNameAvailability: string => Promise<*>,
|
||||
error: ?string,
|
||||
reposting: boolean,
|
||||
uri: string,
|
||||
name: string,
|
||||
contentUri: string,
|
||||
setRepostUri: (string) => void,
|
||||
setContentUri: (string) => void,
|
||||
setRepostUri: string => void,
|
||||
setContentUri: string => void,
|
||||
doCheckPendingClaims: () => void,
|
||||
redirectUri?: string,
|
||||
passedRepostAmount: number,
|
||||
@@ -42,7 +42,6 @@ type Props = {
|
||||
isResolvingEnteredRepost: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
fetchingMyChannels: boolean,
|
||||
incognito: boolean,
|
||||
};
|
||||
|
||||
function RepostCreate(props: Props) {
|
||||
@@ -68,7 +67,6 @@ function RepostCreate(props: Props) {
|
||||
isResolvingEnteredRepost,
|
||||
activeChannelClaim,
|
||||
fetchingMyChannels,
|
||||
incognito,
|
||||
} = props;
|
||||
|
||||
const defaultName = name || (claim && claim.name) || '';
|
||||
@@ -88,7 +86,7 @@ function RepostCreate(props: Props) {
|
||||
const repostUrlName = `lbry://${!activeChannelClaim ? '' : `${activeChannelClaim.name}/`}`;
|
||||
|
||||
const contentFirstRender = React.useRef(true);
|
||||
const setAutoRepostBid = (amount) => {
|
||||
const setAutoRepostBid = amount => {
|
||||
if (balance && balance > 0.02) {
|
||||
if (uri) {
|
||||
setRepostBid(0.01);
|
||||
@@ -113,7 +111,7 @@ function RepostCreate(props: Props) {
|
||||
const isLbryUrl = value.startsWith('lbry://') && value !== 'lbry://';
|
||||
const error = '';
|
||||
|
||||
const addLbryIfNot = (term) => {
|
||||
const addLbryIfNot = term => {
|
||||
return term.startsWith('lbry://') ? term : `lbry://${term}`;
|
||||
};
|
||||
if (wasCopiedFromWeb) {
|
||||
@@ -178,7 +176,7 @@ function RepostCreate(props: Props) {
|
||||
|
||||
React.useEffect(() => {
|
||||
if (enteredRepostName && isNameValid(enteredRepostName, false)) {
|
||||
doCheckPublishNameAvailability(enteredRepostName).then((r) => setAvailable(r));
|
||||
doCheckPublishNameAvailability(enteredRepostName).then(r => setAvailable(r));
|
||||
}
|
||||
}, [enteredRepostName, doCheckPublishNameAvailability]);
|
||||
|
||||
@@ -283,7 +281,7 @@ function RepostCreate(props: Props) {
|
||||
doRepost({
|
||||
name: enteredRepostName,
|
||||
bid: creditsToString(repostBid),
|
||||
channel_id: activeChannelClaim && !incognito ? activeChannelClaim.claim_id : undefined,
|
||||
channel_id: activeChannelClaim ? activeChannelClaim.claim_id : undefined,
|
||||
claim_id: repostClaimId,
|
||||
}).then((repostClaim: StreamClaim) => {
|
||||
doCheckPendingClaims();
|
||||
@@ -316,7 +314,7 @@ function RepostCreate(props: Props) {
|
||||
<div>
|
||||
{uri && (
|
||||
<fieldset-section>
|
||||
<ClaimPreview key={uri} uri={uri} actions={''} showNullPlaceholder />
|
||||
<ClaimPreview key={uri} uri={uri} actions={''} type={'inline'} showNullPlaceholder />
|
||||
</fieldset-section>
|
||||
)}
|
||||
{!uri && name && (
|
||||
@@ -327,7 +325,7 @@ function RepostCreate(props: Props) {
|
||||
name="content_url"
|
||||
value={enteredContent}
|
||||
error={contentError}
|
||||
onChange={(event) => setEnteredContentUri(event.target.value)}
|
||||
onChange={event => setEnteredContentUri(event.target.value)}
|
||||
placeholder={__('Enter a name or %domain% URL', { domain: SITE_URL })}
|
||||
/>
|
||||
</>
|
||||
@@ -359,7 +357,7 @@ function RepostCreate(props: Props) {
|
||||
type="text"
|
||||
name="repost_name"
|
||||
value={enteredRepostName}
|
||||
onChange={(event) => setEnteredRepostName(event.target.value)}
|
||||
onChange={event => setEnteredRepostName(event.target.value)}
|
||||
placeholder={__('MyFunName')}
|
||||
/>
|
||||
</fieldset-group>
|
||||
@@ -384,8 +382,8 @@ function RepostCreate(props: Props) {
|
||||
</>
|
||||
}
|
||||
disabled={!enteredRepostName || resolvingRepost}
|
||||
onChange={(event) => setRepostBid(event.target.value)}
|
||||
onWheel={(e) => e.stopPropagation()}
|
||||
onChange={event => setRepostBid(event.target.value)}
|
||||
onWheel={e => e.stopPropagation()}
|
||||
/>
|
||||
</React.Fragment>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ const RewardTile = (props: Props) => {
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={__(reward.reward_title)}
|
||||
title={reward.reward_title}
|
||||
subtitle={<LbcMessage>{reward.reward_description}</LbcMessage>}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
@@ -53,7 +53,7 @@ const RewardTile = (props: Props) => {
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{!customActionsRewards.some((i) => i === reward.reward_type) &&
|
||||
{!customActionsRewards.some(i => i === reward.reward_type) &&
|
||||
(claimed ? (
|
||||
<span>
|
||||
<Icon icon={ICONS.COMPLETED} /> {__('Reward claimed.')}
|
||||
|
||||
@@ -1,59 +1,63 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React, { useEffect } from 'react';
|
||||
import React, { useEffect, Suspense, lazy } from 'react';
|
||||
import { Route, Redirect, Switch, withRouter } from 'react-router-dom';
|
||||
import SettingsPage from 'page/settings';
|
||||
import SettingsNotificationsPage from 'page/settingsNotifications';
|
||||
import SettingsAdvancedPage from 'page/settingsAdvanced';
|
||||
import HelpPage from 'page/help';
|
||||
|
||||
// @if TARGET='app'
|
||||
import BackupPage from 'page/backup';
|
||||
// @endif
|
||||
// @if TARGET='web'
|
||||
import Code2257Page from 'web/page/code2257';
|
||||
// @endif
|
||||
import ReportPage from 'page/report';
|
||||
import ShowPage from 'page/show';
|
||||
import PublishPage from 'page/publish';
|
||||
import DiscoverPage from 'page/discover';
|
||||
import HomePage from 'page/home';
|
||||
import InvitedPage from 'page/invited';
|
||||
import RewardsPage from 'page/rewards';
|
||||
import FileListPublished from 'page/fileListPublished';
|
||||
import InvitePage from 'page/invite';
|
||||
import SearchPage from 'page/search';
|
||||
import LibraryPage from 'page/library';
|
||||
import WalletPage from 'page/wallet';
|
||||
import TagsFollowingPage from 'page/tagsFollowing';
|
||||
import ChannelsFollowingPage from 'page/channelsFollowing';
|
||||
import ChannelsFollowingDiscoverPage from 'page/channelsFollowingDiscover';
|
||||
import TagsFollowingManagePage from 'page/tagsFollowingManage';
|
||||
import ListBlockedPage from 'page/listBlocked';
|
||||
import FourOhFourPage from 'page/fourOhFour';
|
||||
import SignInPage from 'page/signIn';
|
||||
import SignUpPage from 'page/signUp';
|
||||
import PasswordResetPage from 'page/passwordReset';
|
||||
import PasswordSetPage from 'page/passwordSet';
|
||||
import SignInVerifyPage from 'page/signInVerify';
|
||||
import ChannelsPage from 'page/channels';
|
||||
import LiveStreamSetupPage from 'page/livestreamSetup';
|
||||
import EmbedWrapperPage from 'page/embedWrapper';
|
||||
import TopPage from 'page/top';
|
||||
import Welcome from 'page/welcome';
|
||||
import CreatorDashboard from 'page/creatorDashboard';
|
||||
import RewardsVerifyPage from 'page/rewardsVerify';
|
||||
import CheckoutPage from 'page/checkoutPage';
|
||||
import ChannelNew from 'page/channelNew';
|
||||
import RepostNew from 'page/repost';
|
||||
import BuyPage from 'page/buy';
|
||||
import NotificationsPage from 'page/notifications';
|
||||
import SignInWalletPasswordPage from 'page/signInWalletPassword';
|
||||
import YoutubeSyncPage from 'page/youtubeSync';
|
||||
|
||||
// constants
|
||||
import * as PAGES from 'constants/pages';
|
||||
import { LINKED_COMMENT_QUERY_PARAM } from 'constants/comment';
|
||||
import { parseURI, isURIValid } from 'lbry-redux';
|
||||
import { SITE_TITLE, WELCOME_VERSION } from 'config';
|
||||
|
||||
// Code Splitting
|
||||
const BuyPage = lazy(() => import('page/buy'));
|
||||
const ChannelsPage = lazy(() => import('page/channels'));
|
||||
const ChannelsFollowingPage = lazy(() => import('page/channelsFollowing'));
|
||||
const ChannelsFollowingDiscoverPage = lazy(() => import('page/channelsFollowingDiscover'));
|
||||
const CreatorDashboard = lazy(() => import('page/creatorDashboard'));
|
||||
const CheckoutPage = lazy(() => import('page/checkoutPage'));
|
||||
const ChannelNew = lazy(() => import('page/channelNew'));
|
||||
const DiscoverPage = lazy(() => import('page/discover'));
|
||||
const EmbedWrapperPage = lazy(() => import('page/embedWrapper'));
|
||||
const FileListPublished = lazy(() => import('page/fileListPublished'));
|
||||
const FourOhFourPage = lazy(() => import('page/fourOhFour'));
|
||||
const HelpPage = lazy(() => import('page/help'));
|
||||
const HomePage = lazy(() => import('page/home'));
|
||||
const InvitedPage = lazy(() => import('page/invited'));
|
||||
const InvitePage = lazy(() => import('page/invite'));
|
||||
const LiveStreamPage = lazy(() => import('page/livestream'));
|
||||
const LibraryPage = lazy(() => import('page/library'));
|
||||
const ListBlockedPage = lazy(() => import('page/listBlocked'));
|
||||
const NotificationsPage = lazy(() => import('page/notifications'));
|
||||
const PasswordResetPage = lazy(() => import('page/passwordReset'));
|
||||
const PasswordSetPage = lazy(() => import('page/passwordSet'));
|
||||
const PublishPage = lazy(() => import('page/publish'));
|
||||
const RewardsPage = lazy(() => import('page/rewards'));
|
||||
const RewardsVerifyPage = lazy(() => import('page/rewardsVerify'));
|
||||
const ReportPage = lazy(() => import('page/report'));
|
||||
const RepostNew = lazy(() => import('page/repost'));
|
||||
const SignInPage = lazy(() => import('page/signIn'));
|
||||
const SignUpPage = lazy(() => import('page/signUp'));
|
||||
const SignInVerifyPage = lazy(() => import('page/signInVerify'));
|
||||
const SearchPage = lazy(() => import('page/search'));
|
||||
const SettingsPage = lazy(() => import('page/settings'));
|
||||
const SettingsNotificationsPage = lazy(() => import('page/settingsNotifications'));
|
||||
const SettingsAdvancedPage = lazy(() => import('page/settingsAdvanced'));
|
||||
const SignInWalletPasswordPage = lazy(() => import('page/signInWalletPassword'));
|
||||
const ShowPage = lazy(() => import('page/show'));
|
||||
const TagsFollowingPage = lazy(() => import('page/tagsFollowing'));
|
||||
const TagsFollowingManagePage = lazy(() => import('page/tagsFollowingManage'));
|
||||
const TopPage = lazy(() => import('page/top'));
|
||||
const WalletPage = lazy(() => import('page/wallet'));
|
||||
const Welcome = lazy(() => import('page/welcome'));
|
||||
const YoutubeSyncPage = lazy(() => import('page/youtubeSync'));
|
||||
|
||||
// Tell the browser we are handling scroll restoration
|
||||
if ('scrollRestoration' in history) {
|
||||
history.scrollRestoration = 'manual';
|
||||
@@ -92,7 +96,12 @@ type PrivateRouteProps = Props & {
|
||||
};
|
||||
|
||||
function PrivateRoute(props: PrivateRouteProps) {
|
||||
const { component: Component, isAuthenticated, ...rest } = props;
|
||||
const {
|
||||
component: Component,
|
||||
isAuthenticated,
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<Route
|
||||
{...rest}
|
||||
@@ -122,6 +131,7 @@ function AppRouter(props: Props) {
|
||||
setReferrer,
|
||||
homepageData,
|
||||
} = props;
|
||||
|
||||
const { entries } = history;
|
||||
const entryIndex = history.index;
|
||||
const urlParams = new URLSearchParams(search);
|
||||
@@ -200,96 +210,96 @@ function AppRouter(props: Props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<Switch>
|
||||
{/* @if TARGET='app' */}
|
||||
{welcomeVersion < WELCOME_VERSION && <Route path="/*" component={Welcome} />}
|
||||
{/* @endif */}
|
||||
<Redirect
|
||||
from={`/$/${PAGES.DEPRECATED__CHANNELS_FOLLOWING_MANAGE}`}
|
||||
to={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
|
||||
/>
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__CHANNELS_FOLLOWING}`} to={`/$/${PAGES.CHANNELS_FOLLOWING}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__TAGS_FOLLOWING}`} to={`/$/${PAGES.TAGS_FOLLOWING}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__TAGS_FOLLOWING_MANAGE}`} to={`/$/${PAGES.TAGS_FOLLOWING_MANAGE}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__PUBLISH}`} to={`/$/${PAGES.UPLOAD}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__PUBLISHED}`} to={`/$/${PAGES.UPLOADS}`} />
|
||||
|
||||
<Route path={`/`} exact component={HomePage} />
|
||||
<Route path={`/$/${PAGES.DISCOVER}`} exact component={DiscoverPage} />
|
||||
<Route path={`/$/${PAGES.WILD_WEST}`} exact component={DiscoverPage} />
|
||||
{/* $FlowFixMe */}
|
||||
{dynamicRoutes.map((dynamicRouteProps: RowDataItem) => (
|
||||
<Route
|
||||
key={dynamicRouteProps.route}
|
||||
path={dynamicRouteProps.route}
|
||||
component={(routerProps) => <DiscoverPage {...routerProps} dynamicRouteProps={dynamicRouteProps} />}
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Switch>
|
||||
{/* @if TARGET='app' */}
|
||||
{welcomeVersion < WELCOME_VERSION && <Route path="/*" component={Welcome} />}
|
||||
{/* @endif */}
|
||||
<Redirect
|
||||
from={`/$/${PAGES.DEPRECATED__CHANNELS_FOLLOWING_MANAGE}`}
|
||||
to={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
|
||||
/>
|
||||
))}
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__CHANNELS_FOLLOWING}`} to={`/$/${PAGES.CHANNELS_FOLLOWING}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__TAGS_FOLLOWING}`} to={`/$/${PAGES.TAGS_FOLLOWING}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__TAGS_FOLLOWING_MANAGE}`} to={`/$/${PAGES.TAGS_FOLLOWING_MANAGE}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__PUBLISH}`} to={`/$/${PAGES.UPLOAD}`} />
|
||||
<Redirect from={`/$/${PAGES.DEPRECATED__PUBLISHED}`} to={`/$/${PAGES.UPLOADS}`} />
|
||||
|
||||
<Route path={`/$/${PAGES.AUTH_SIGNIN}`} exact component={SignInPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_PASSWORD_RESET}`} exact component={PasswordResetPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_PASSWORD_SET}`} exact component={PasswordSetPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}`} exact component={SignUpPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}/*`} exact component={SignUpPage} />
|
||||
<Route path={`/$/${PAGES.WELCOME}`} exact component={Welcome} />
|
||||
<Route path={`/`} exact component={HomePage} />
|
||||
<Route path={`/$/${PAGES.DISCOVER}`} exact component={DiscoverPage} />
|
||||
{/* $FlowFixMe */}
|
||||
{dynamicRoutes.map((dynamicRouteProps: RowDataItem) => (
|
||||
<Route
|
||||
key={dynamicRouteProps.route}
|
||||
path={dynamicRouteProps.route}
|
||||
component={(routerProps) => <DiscoverPage {...routerProps} dynamicRouteProps={dynamicRouteProps} />}
|
||||
/>
|
||||
))}
|
||||
|
||||
<Route path={`/$/${PAGES.HELP}`} exact component={HelpPage} />
|
||||
{/* @if TARGET='app' */}
|
||||
<Route path={`/$/${PAGES.BACKUP}`} exact component={BackupPage} />
|
||||
{/* @endif */}
|
||||
{/* @if TARGET='web' */}
|
||||
<Route path={`/$/${PAGES.CODE_2257}`} exact component={Code2257Page} />
|
||||
{/* @endif */}
|
||||
<Route path={`/$/${PAGES.AUTH_VERIFY}`} exact component={SignInVerifyPage} />
|
||||
<Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} />
|
||||
<Route path={`/$/${PAGES.TOP}`} exact component={TopPage} />
|
||||
<Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} />
|
||||
<Route path={`/$/${PAGES.SETTINGS_ADVANCED}`} exact component={SettingsAdvancedPage} />
|
||||
<Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} />
|
||||
<Route path={`/$/${PAGES.CHECKOUT}`} exact component={CheckoutPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_SIGNIN}`} exact component={SignInPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_PASSWORD_RESET}`} exact component={PasswordResetPage} />
|
||||
<Route path={`/$/${PAGES.AUTH_PASSWORD_SET}`} exact component={PasswordSetPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}`} exact component={SignUpPage} />
|
||||
<Route path={`/$/${PAGES.AUTH}/*`} exact component={SignUpPage} />
|
||||
<Route path={`/$/${PAGES.WELCOME}`} exact component={Welcome} />
|
||||
|
||||
<PrivateRoute {...props} exact path={`/$/${PAGES.YOUTUBE_SYNC}`} component={YoutubeSyncPage} />
|
||||
<PrivateRoute {...props} exact path={`/$/${PAGES.TAGS_FOLLOWING}`} component={TagsFollowingPage} />
|
||||
<PrivateRoute
|
||||
{...props}
|
||||
exact
|
||||
path={`/$/${PAGES.CHANNELS_FOLLOWING}`}
|
||||
component={isAuthenticated || !IS_WEB ? ChannelsFollowingPage : DiscoverPage}
|
||||
/>
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_NOTIFICATIONS}`} component={SettingsNotificationsPage} />
|
||||
<PrivateRoute
|
||||
{...props}
|
||||
exact
|
||||
path={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
|
||||
component={ChannelsFollowingDiscoverPage}
|
||||
/>
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.INVITE}`} component={InvitePage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CHANNEL_NEW}`} component={ChannelNew} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REPOST_NEW}`} component={RepostNew} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOADS}`} component={FileListPublished} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOAD}`} component={PublishPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REPORT}`} component={ReportPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS}`} exact component={RewardsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS_VERIFY}`} component={RewardsVerifyPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.TAGS_FOLLOWING_MANAGE}`} component={TagsFollowingManagePage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_BLOCKED_MUTED}`} component={ListBlockedPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.WALLET}`} exact component={WalletPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CHANNELS}`} component={ChannelsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.LIVESTREAM}`} component={LiveStreamSetupPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.BUY}`} component={BuyPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.NOTIFICATIONS}`} component={NotificationsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.AUTH_WALLET_PASSWORD}`} component={SignInWalletPasswordPage} />
|
||||
<Route path={`/$/${PAGES.HELP}`} exact component={HelpPage} />
|
||||
{/* @if TARGET='app' */}
|
||||
<Route path={`/$/${PAGES.BACKUP}`} exact component={BackupPage} />
|
||||
{/* @endif */}
|
||||
{/* @if TARGET='web' */}
|
||||
<Route path={`/$/${PAGES.CODE_2257}`} exact component={Code2257Page} />
|
||||
{/* @endif */}
|
||||
<Route path={`/$/${PAGES.AUTH_VERIFY}`} exact component={SignInVerifyPage} />
|
||||
<Route path={`/$/${PAGES.SEARCH}`} exact component={SearchPage} />
|
||||
<Route path={`/$/${PAGES.TOP}`} exact component={TopPage} />
|
||||
<Route path={`/$/${PAGES.SETTINGS}`} exact component={SettingsPage} />
|
||||
<Route path={`/$/${PAGES.SETTINGS_ADVANCED}`} exact component={SettingsAdvancedPage} />
|
||||
<Route path={`/$/${PAGES.INVITE}/:referrer`} exact component={InvitedPage} />
|
||||
<Route path={`/$/${PAGES.CHECKOUT}`} exact component={CheckoutPage} />
|
||||
|
||||
<Route path={`/$/${PAGES.EMBED}/:claimName`} exact component={EmbedWrapperPage} />
|
||||
<Route path={`/$/${PAGES.EMBED}/:claimName/:claimId`} exact component={EmbedWrapperPage} />
|
||||
<PrivateRoute {...props} exact path={`/$/${PAGES.YOUTUBE_SYNC}`} component={YoutubeSyncPage} />
|
||||
<PrivateRoute {...props} exact path={`/$/${PAGES.TAGS_FOLLOWING}`} component={TagsFollowingPage} />
|
||||
<PrivateRoute
|
||||
{...props}
|
||||
exact
|
||||
path={`/$/${PAGES.CHANNELS_FOLLOWING}`}
|
||||
component={isAuthenticated || !IS_WEB ? ChannelsFollowingPage : DiscoverPage}
|
||||
/>
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_NOTIFICATIONS}`} component={SettingsNotificationsPage} />
|
||||
<PrivateRoute
|
||||
{...props}
|
||||
exact
|
||||
path={`/$/${PAGES.CHANNELS_FOLLOWING_DISCOVER}`}
|
||||
component={ChannelsFollowingDiscoverPage}
|
||||
/>
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.INVITE}`} component={InvitePage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CHANNEL_NEW}`} component={ChannelNew} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REPOST_NEW}`} component={RepostNew} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOADS}`} component={FileListPublished} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.UPLOAD}`} component={PublishPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REPORT}`} component={ReportPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS}`} exact component={RewardsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS_VERIFY}`} component={RewardsVerifyPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.TAGS_FOLLOWING_MANAGE}`} component={TagsFollowingManagePage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.SETTINGS_BLOCKED_MUTED}`} component={ListBlockedPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.WALLET}`} exact component={WalletPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.CHANNELS}`} component={ChannelsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.LIVESTREAM}`} component={LiveStreamPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.BUY}`} component={BuyPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.NOTIFICATIONS}`} component={NotificationsPage} />
|
||||
<PrivateRoute {...props} path={`/$/${PAGES.AUTH_WALLET_PASSWORD}`} component={SignInWalletPasswordPage} />
|
||||
|
||||
{/* Below need to go at the end to make sure we don't match any of our pages first */}
|
||||
<Route path="/:claimName" exact component={ShowPage} />
|
||||
<Route path="/:claimName/:streamName" exact component={ShowPage} />
|
||||
<Route path="/*" component={FourOhFourPage} />
|
||||
</Switch>
|
||||
<Route path={`/$/${PAGES.EMBED}/:claimName`} exact component={EmbedWrapperPage} />
|
||||
<Route path={`/$/${PAGES.EMBED}/:claimName/:claimId`} exact component={EmbedWrapperPage} />
|
||||
{/* Below need to go at the end to make sure we don't match any of our pages first */}
|
||||
<Route path="/:claimName" exact component={ShowPage} />
|
||||
<Route path="/:claimName/:streamName" exact component={ShowPage} />
|
||||
<Route path="/*" component={FourOhFourPage} />
|
||||
</Switch>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,34 +33,33 @@ const SearchOptions = (props: Props) => {
|
||||
/>
|
||||
{expanded && (
|
||||
<Form className="search__options">
|
||||
{false && (
|
||||
<fieldset>
|
||||
{[
|
||||
{
|
||||
option: SEARCH_OPTIONS.INCLUDE_FILES,
|
||||
label: __('Files'),
|
||||
},
|
||||
{
|
||||
option: SEARCH_OPTIONS.INCLUDE_CHANNELS,
|
||||
label: __('Channels'),
|
||||
},
|
||||
{
|
||||
option: SEARCH_OPTIONS.INCLUDE_FILES_AND_CHANNELS,
|
||||
label: __('Everything'),
|
||||
},
|
||||
].map(({ option, label }) => (
|
||||
<FormField
|
||||
key={option}
|
||||
name={option}
|
||||
type="radio"
|
||||
blockWrap={false}
|
||||
label={label}
|
||||
checked={options[SEARCH_OPTIONS.CLAIM_TYPE] === option}
|
||||
onChange={() => setSearchOption(SEARCH_OPTIONS.CLAIM_TYPE, option)}
|
||||
/>
|
||||
))}
|
||||
</fieldset>
|
||||
)}
|
||||
<fieldset>
|
||||
<legend className="search__legend">{__('Search For')}</legend>
|
||||
{[
|
||||
{
|
||||
option: SEARCH_OPTIONS.INCLUDE_FILES,
|
||||
label: __('Files'),
|
||||
},
|
||||
{
|
||||
option: SEARCH_OPTIONS.INCLUDE_CHANNELS,
|
||||
label: __('Channels'),
|
||||
},
|
||||
{
|
||||
option: SEARCH_OPTIONS.INCLUDE_FILES_AND_CHANNELS,
|
||||
label: __('Everything'),
|
||||
},
|
||||
].map(({ option, label }) => (
|
||||
<FormField
|
||||
key={option}
|
||||
name={option}
|
||||
type="radio"
|
||||
blockWrap={false}
|
||||
label={label}
|
||||
checked={options[SEARCH_OPTIONS.CLAIM_TYPE] === option}
|
||||
onChange={() => setSearchOption(SEARCH_OPTIONS.CLAIM_TYPE, option)}
|
||||
/>
|
||||
))}
|
||||
</fieldset>
|
||||
|
||||
<fieldset disabled={isFilteringByChannel}>
|
||||
<legend className="search__legend">{__('Type')}</legend>
|
||||
@@ -71,7 +70,7 @@ const SearchOptions = (props: Props) => {
|
||||
},
|
||||
{
|
||||
option: SEARCH_OPTIONS.MEDIA_AUDIO,
|
||||
label: __('Music'),
|
||||
label: __('Audio'),
|
||||
},
|
||||
{
|
||||
option: SEARCH_OPTIONS.MEDIA_IMAGE,
|
||||
@@ -99,24 +98,22 @@ const SearchOptions = (props: Props) => {
|
||||
))}
|
||||
</fieldset>
|
||||
|
||||
{false && (
|
||||
<fieldset>
|
||||
<legend className="search__legend">{__('Other Options')}</legend>
|
||||
<FormField
|
||||
type="select"
|
||||
name="result-count"
|
||||
value={resultCount}
|
||||
onChange={(e) => setSearchOption(SEARCH_OPTIONS.RESULT_COUNT, e.target.value)}
|
||||
blockWrap={false}
|
||||
label={__('Returned Results')}
|
||||
>
|
||||
<option value={10}>10</option>
|
||||
<option value={30}>30</option>
|
||||
<option value={50}>50</option>
|
||||
<option value={100}>100</option>
|
||||
</FormField>
|
||||
</fieldset>
|
||||
)}
|
||||
<fieldset>
|
||||
<legend className="search__legend">{__('Other Options')}</legend>
|
||||
<FormField
|
||||
type="select"
|
||||
name="result-count"
|
||||
value={resultCount}
|
||||
onChange={(e) => setSearchOption(SEARCH_OPTIONS.RESULT_COUNT, e.target.value)}
|
||||
blockWrap={false}
|
||||
label={__('Returned Results')}
|
||||
>
|
||||
<option value={10}>10</option>
|
||||
<option value={30}>30</option>
|
||||
<option value={50}>50</option>
|
||||
<option value={100}>100</option>
|
||||
</FormField>
|
||||
</fieldset>
|
||||
</Form>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -99,7 +99,7 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
||||
style={{ display: 'none' }}
|
||||
src={thumbnailSrc}
|
||||
alt={__('Thumbnail Preview')}
|
||||
onError={(e) => {
|
||||
onError={e => {
|
||||
this.setState({
|
||||
thumbnailError: true,
|
||||
});
|
||||
@@ -131,9 +131,9 @@ class SelectThumbnail extends React.PureComponent<Props, State> {
|
||||
<FileSelector
|
||||
currentPath={thumbnailPath}
|
||||
label={__('Thumbnail')}
|
||||
placeholder={__('Thumbnails that entice a viewer to watch a video work best')}
|
||||
placeholder={__('Choose a thumbnail')}
|
||||
accept={accept}
|
||||
onFileChosen={(file) => openModal(MODALS.CONFIRM_THUMBNAIL_UPLOAD, { file })}
|
||||
onFileChosen={file => openModal(MODALS.CONFIRM_THUMBNAIL_UPLOAD, { file })}
|
||||
/>
|
||||
)}
|
||||
{status === THUMBNAIL_STATUSES.COMPLETE && thumbnail && (
|
||||
|
||||
@@ -5,17 +5,17 @@ import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user';
|
||||
import { selectHomepageData, selectLanguage } from 'redux/selectors/settings';
|
||||
import { doSignOut } from 'redux/actions/app';
|
||||
import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
|
||||
import { selectUnreadNotificationCount } from 'redux/selectors/notifications';
|
||||
|
||||
import SideNavigation from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
const select = state => ({
|
||||
subscriptions: selectSubscriptions(state),
|
||||
followedTags: selectFollowedTags(state),
|
||||
language: selectLanguage(state), // trigger redraw on language change
|
||||
email: selectUserVerifiedEmail(state),
|
||||
purchaseSuccess: selectPurchaseUriSuccess(state),
|
||||
unseenCount: selectUnseenNotificationCount(state),
|
||||
unreadCount: selectUnreadNotificationCount(state),
|
||||
user: selectUser(state),
|
||||
homepageData: selectHomepageData(state),
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ import classnames from 'classnames';
|
||||
import Icon from 'component/common/icon';
|
||||
import NotificationBubble from 'component/notificationBubble';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import { PINNED_LABEL_1, PINNED_URI_1, PINNED_URI_2, PINNED_LABEL_2, SIMPLE_SITE, DOMAIN } from 'config';
|
||||
import { PINNED_LABEL_1, PINNED_URI_1, PINNED_URI_2, PINNED_LABEL_2, SIMPLE_SITE } from 'config';
|
||||
// @if TARGET='app'
|
||||
import { IS_MAC } from 'component/app/view';
|
||||
// @endif
|
||||
@@ -38,10 +38,10 @@ type Props = {
|
||||
uploadCount: number,
|
||||
doSignOut: () => void,
|
||||
sidebarOpen: boolean,
|
||||
setSidebarOpen: (boolean) => void,
|
||||
setSidebarOpen: boolean => void,
|
||||
isMediumScreen: boolean,
|
||||
isOnFilePage: boolean,
|
||||
unseenCount: number,
|
||||
unreadCount: number,
|
||||
purchaseSuccess: boolean,
|
||||
doClearPurchasedUriSuccess: () => void,
|
||||
user: ?User,
|
||||
@@ -51,7 +51,6 @@ type Props = {
|
||||
type SideNavLink = {
|
||||
title: string,
|
||||
link?: string,
|
||||
route?: string,
|
||||
onClick?: () => any,
|
||||
icon: string,
|
||||
extra?: Node,
|
||||
@@ -61,6 +60,7 @@ type SideNavLink = {
|
||||
function SideNavigation(props: Props) {
|
||||
const {
|
||||
subscriptions,
|
||||
followedTags,
|
||||
doSignOut,
|
||||
email,
|
||||
purchaseSuccess,
|
||||
@@ -69,10 +69,9 @@ function SideNavigation(props: Props) {
|
||||
setSidebarOpen,
|
||||
isMediumScreen,
|
||||
isOnFilePage,
|
||||
unseenCount,
|
||||
unreadCount,
|
||||
homepageData,
|
||||
user,
|
||||
followedTags,
|
||||
} = props;
|
||||
|
||||
const { EXTRA_SIDEBAR_LINKS } = homepageData;
|
||||
@@ -212,7 +211,7 @@ function SideNavigation(props: Props) {
|
||||
});
|
||||
}
|
||||
|
||||
const notificationsEnabled = SIMPLE_SITE || (user && user.experimental_ui);
|
||||
const notificationsEnabled = user && user.experimental_ui;
|
||||
const isAuthenticated = Boolean(email);
|
||||
// SIDE LINKS: FOLLOWING, HOME, [FULL,] [EXTRA]
|
||||
let SIDE_LINKS: Array<SideNavLink> = [];
|
||||
@@ -233,7 +232,7 @@ function SideNavigation(props: Props) {
|
||||
const isAbsolute = isOnFilePage || isMediumScreen;
|
||||
const microNavigation = !sidebarOpen || isMediumScreen;
|
||||
const subLinks = email
|
||||
? MOBILE_LINKS.filter((link) => {
|
||||
? MOBILE_LINKS.filter(link => {
|
||||
if (!notificationsEnabled && link.icon === ICONS.NOTIFICATION) {
|
||||
return false;
|
||||
}
|
||||
@@ -272,17 +271,16 @@ function SideNavigation(props: Props) {
|
||||
return () => window.removeEventListener('keydown', handleKeydown);
|
||||
}, [sidebarOpen, setSidebarOpen, isAbsolute]);
|
||||
|
||||
const unAuthNudge =
|
||||
DOMAIN === 'lbry.tv' ? null : (
|
||||
<div className="navigation__auth-nudge">
|
||||
<span>
|
||||
<I18nMessage tokens={{ lbc: <Icon icon={ICONS.LBC} /> }}>
|
||||
Sign up to earn %lbc% for you and your favorite creators.
|
||||
</I18nMessage>
|
||||
</span>
|
||||
<Button button="secondary" label={__('Sign Up')} navigate={`/$/${PAGES.AUTH}?src=sidenav_nudge`} />
|
||||
</div>
|
||||
);
|
||||
const unAuthNudge = (
|
||||
<div className="navigation__auth-nudge">
|
||||
<span>
|
||||
<I18nMessage tokens={{ lbc: <Icon icon={ICONS.LBC} /> }}>
|
||||
Sign up to earn %lbc% for you and your favorite creators.
|
||||
</I18nMessage>
|
||||
</span>
|
||||
<Button button="secondary" label={__('Sign Up')} navigate={`/$/${PAGES.AUTH}?src=sidenav_nudge`} />
|
||||
</div>
|
||||
);
|
||||
|
||||
const helpLinks = (
|
||||
<ul className="navigation__tertiary navigation-links--small">
|
||||
@@ -292,13 +290,8 @@ function SideNavigation(props: Props) {
|
||||
<li className="navigation-link">
|
||||
<Button label={__('FAQ')} href="https://odysee.com/@OdyseeHelp:b" />
|
||||
</li>
|
||||
|
||||
<li className="navigation-link">
|
||||
<Button label={__('Community Guidelines')} href="https://odysee.com/@OdyseeHelp:b/Community-Guidelines:c" />
|
||||
</li>
|
||||
|
||||
<li className="navigation-link">
|
||||
<Button label={__('Support --[used in footer; general help/support]--')} href="https://lbry.com/support" />
|
||||
<Button label={__('Support')} href="https://lbry.com/support" />
|
||||
</li>
|
||||
<li className="navigation-link">
|
||||
<Button label={__('Terms')} href="https://lbry.com/termsofservice" />
|
||||
@@ -327,11 +320,11 @@ function SideNavigation(props: Props) {
|
||||
>
|
||||
<div>
|
||||
<ul className={classnames('navigation-links', { 'navigation-links--micro': !sidebarOpen })}>
|
||||
{SIDE_LINKS.map((linkProps) => {
|
||||
{SIDE_LINKS.map(linkProps => {
|
||||
// $FlowFixMe
|
||||
const { hideForUnauth, ...passedProps } = linkProps;
|
||||
return !email && linkProps.hideForUnauth && IS_WEB ? null : (
|
||||
<li key={linkProps.route || linkProps.link}>
|
||||
<li key={linkProps.link}>
|
||||
<Button
|
||||
{...passedProps}
|
||||
label={__(linkProps.title)}
|
||||
@@ -341,7 +334,7 @@ function SideNavigation(props: Props) {
|
||||
icon={pulseLibrary && linkProps.icon === ICONS.LIBRARY ? ICONS.PURCHASED : linkProps.icon}
|
||||
className={classnames('navigation-link', {
|
||||
'navigation-link--pulse': linkProps.icon === ICONS.LIBRARY && pulseLibrary,
|
||||
'navigation-link--highlighted': linkProps.icon === ICONS.NOTIFICATION && unseenCount > 0,
|
||||
'navigation-link--highlighted': linkProps.icon === ICONS.NOTIFICATION && unreadCount > 0,
|
||||
})}
|
||||
activeClass="navigation-link--active"
|
||||
/>
|
||||
@@ -393,7 +386,7 @@ function SideNavigation(props: Props) {
|
||||
>
|
||||
<div>
|
||||
<ul className="navigation-links--absolute">
|
||||
{SIDE_LINKS.map((linkProps) => {
|
||||
{SIDE_LINKS.map(linkProps => {
|
||||
// $FlowFixMe
|
||||
const { hideForUnauth, link, route, ...passedProps } = linkProps;
|
||||
return !email && linkProps.hideForUnauth && IS_WEB ? null : (
|
||||
@@ -406,7 +399,7 @@ function SideNavigation(props: Props) {
|
||||
icon={pulseLibrary && linkProps.icon === ICONS.LIBRARY ? ICONS.PURCHASED : linkProps.icon}
|
||||
className={classnames('navigation-link', {
|
||||
'navigation-link--pulse': linkProps.icon === ICONS.LIBRARY && pulseLibrary,
|
||||
'navigation-link--highlighted': linkProps.icon === ICONS.NOTIFICATION && unseenCount > 0,
|
||||
'navigation-link--highlighted': linkProps.icon === ICONS.NOTIFICATION && unreadCount > 0,
|
||||
})}
|
||||
activeClass="navigation-link--active"
|
||||
/>
|
||||
@@ -416,7 +409,7 @@ function SideNavigation(props: Props) {
|
||||
})}
|
||||
</ul>
|
||||
<ul className="navigation-links--absolute mobile-only">
|
||||
{subLinks.map((linkProps) => {
|
||||
{subLinks.map(linkProps => {
|
||||
const { hideForUnauth, ...passedProps } = linkProps;
|
||||
|
||||
return !email && hideForUnauth && IS_WEB ? null : (
|
||||
|
||||
@@ -30,7 +30,7 @@ type Props = {
|
||||
animationHidden: boolean,
|
||||
toggleSplashAnimation: () => void,
|
||||
clearWalletServers: () => void,
|
||||
doShowSnackBar: (string) => void,
|
||||
doShowSnackBar: string => void,
|
||||
};
|
||||
|
||||
type State = {
|
||||
@@ -109,30 +109,30 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
|
||||
const { modal, notifyUnlockWallet, clearWalletServers, doShowSnackBar } = this.props;
|
||||
const { launchedModal } = this.state;
|
||||
|
||||
Lbry.status().then((status) => {
|
||||
Lbry.status().then(status => {
|
||||
const sdkStatus = status;
|
||||
const { wallet } = status;
|
||||
Lbry.wallet_status().then((walletStatus) => {
|
||||
Lbry.wallet_status().then(status => {
|
||||
if (sdkStatus.is_running && wallet && wallet.available_servers) {
|
||||
if (walletStatus.is_locked) {
|
||||
if (status.is_locked) {
|
||||
// Clear the error timeout, it might sit on this step for a while until someone enters their password
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout);
|
||||
}
|
||||
// Make sure there isn't another active modal (like INCOMPATIBLE_DAEMON)
|
||||
this.updateStatusCallback(sdkStatus, walletStatus, true);
|
||||
this.updateStatusCallback(sdkStatus, status, true);
|
||||
if (launchedModal === false && !modal) {
|
||||
this.setState({ launchedModal: true }, () => notifyUnlockWallet());
|
||||
}
|
||||
} else {
|
||||
this.updateStatusCallback(sdkStatus, walletStatus);
|
||||
this.updateStatusCallback(sdkStatus, status);
|
||||
}
|
||||
} else if (!sdkStatus.is_running && walletStatus.is_syncing) {
|
||||
} else if (!sdkStatus.is_running && status.is_syncing) {
|
||||
// Clear the timeout if wallet is still syncing
|
||||
if (this.timeout) {
|
||||
clearTimeout(this.timeout);
|
||||
}
|
||||
this.updateStatusCallback(sdkStatus, walletStatus);
|
||||
this.updateStatusCallback(sdkStatus, status);
|
||||
} else if (this.state.waitingForWallet > MAX_WALLET_WAIT && launchedModal === false && !modal) {
|
||||
clearWalletServers();
|
||||
doShowSnackBar(
|
||||
@@ -141,15 +141,20 @@ export default class SplashScreen extends React.PureComponent<Props, State> {
|
||||
)
|
||||
);
|
||||
this.setState({ waitingForWallet: 0 });
|
||||
this.updateStatusCallback(sdkStatus, walletStatus);
|
||||
this.updateStatusCallback(sdkStatus, status);
|
||||
} else {
|
||||
this.updateStatusCallback(sdkStatus, walletStatus);
|
||||
this.updateStatusCallback(sdkStatus, status);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
updateStatusCallback(status: StatusResponse, walletStatus: WalletStatusResponse, waitingForUnlock: boolean = false) {
|
||||
if (status.connection_status.code !== 'connected') {
|
||||
this.setState({ error: true });
|
||||
return;
|
||||
}
|
||||
|
||||
const { wallet, startup_status: startupStatus } = status;
|
||||
|
||||
// If the wallet is locked, stop doing anything and make the user input their password
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
} from 'redux/selectors/subscriptions';
|
||||
import { makeSelectPermanentUrlForUri } from 'lbry-redux';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import SubscribeButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -14,6 +15,7 @@ const select = (state, props) => ({
|
||||
firstRunCompleted: selectFirstRunCompleted(state),
|
||||
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
||||
notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
|
||||
@@ -15,12 +15,13 @@ type SubscriptionArgs = {
|
||||
type Props = {
|
||||
permanentUrl: ?string,
|
||||
isSubscribed: boolean,
|
||||
doChannelSubscribe: (SubscriptionArgs) => void,
|
||||
doChannelUnsubscribe: (SubscriptionArgs) => void,
|
||||
doChannelSubscribe: SubscriptionArgs => void,
|
||||
doChannelUnsubscribe: SubscriptionArgs => void,
|
||||
showSnackBarOnSubscribe: boolean,
|
||||
doToast: ({ message: string }) => void,
|
||||
shrinkOnMobile: boolean,
|
||||
notificationsDisabled: boolean,
|
||||
user: ?User,
|
||||
};
|
||||
|
||||
export default function SubscribeButton(props: Props) {
|
||||
@@ -33,12 +34,14 @@ export default function SubscribeButton(props: Props) {
|
||||
doToast,
|
||||
shrinkOnMobile = false,
|
||||
notificationsDisabled,
|
||||
user,
|
||||
} = props;
|
||||
|
||||
const buttonRef = useRef();
|
||||
const isMobile = useIsMobile();
|
||||
let isHovering = useHover(buttonRef);
|
||||
isHovering = isMobile ? true : isHovering;
|
||||
const uiNotificationsEnabled = user && user.experimental_ui;
|
||||
|
||||
const { channelName } = parseURI(permanentUrl);
|
||||
const claimName = '@' + channelName;
|
||||
@@ -63,7 +66,7 @@ export default function SubscribeButton(props: Props) {
|
||||
requiresAuth={IS_WEB}
|
||||
label={label}
|
||||
title={titlePrefix}
|
||||
onClick={(e) => {
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
|
||||
subscriptionHandler({
|
||||
@@ -77,7 +80,7 @@ export default function SubscribeButton(props: Props) {
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{isSubscribed && (
|
||||
{isSubscribed && uiNotificationsEnabled && (
|
||||
<Button
|
||||
button="alt"
|
||||
icon={notificationsDisabled ? ICONS.BELL : ICONS.BELL_ON}
|
||||
|
||||
@@ -3,10 +3,8 @@ import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import Yrbl from 'component/yrbl';
|
||||
import { SITE_HELP_EMAIL } from 'config';
|
||||
// @if TARGET='web'
|
||||
import { STATUS_DEGRADED, STATUS_FAILING, STATUS_DOWN } from 'web/effects/use-degraded-performance';
|
||||
// @endif
|
||||
import { SITE_HELP_EMAIL } from 'config';
|
||||
|
||||
type Props = {
|
||||
lbryTvApiStatus: string,
|
||||
@@ -15,13 +13,9 @@ type Props = {
|
||||
export default function SyncFatalError(props: Props) {
|
||||
const { lbryTvApiStatus } = props;
|
||||
|
||||
let downTime = false;
|
||||
|
||||
// @if TARGET='web'
|
||||
downTime =
|
||||
const downTime =
|
||||
IS_WEB &&
|
||||
(lbryTvApiStatus === STATUS_DEGRADED || lbryTvApiStatus === STATUS_FAILING || lbryTvApiStatus === STATUS_DOWN);
|
||||
// @endif
|
||||
|
||||
return (
|
||||
<div className="main--empty">
|
||||
|
||||
@@ -53,7 +53,7 @@ function SyncPassword(props: Props) {
|
||||
error={passwordError && __('Wrong password for %email%', { email })}
|
||||
label={__('Password for %email%', { email })}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
onChange={e => setPassword(e.target.value)}
|
||||
/>
|
||||
<FormField
|
||||
name="remember-password"
|
||||
@@ -75,7 +75,7 @@ function SyncPassword(props: Props) {
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
help: <Button button="link" label={__('help guide')} href="https://lbry.com/faq/account-sync" />,
|
||||
email: <Button button="link" label={'help@odysee.com'} href="mailto:help@odysee.com" />,
|
||||
email: <Button button="link" label={'help@lbry.com'} href="mailto:help@lbry.com" />,
|
||||
}}
|
||||
>
|
||||
If you are having issues, checkout our %help% or email us at %email%.
|
||||
|
||||
@@ -17,7 +17,6 @@ type Props = {
|
||||
// to allow for other elements to be nested within the UriIndicator
|
||||
children: ?Node,
|
||||
inline: boolean,
|
||||
external?: boolean,
|
||||
};
|
||||
|
||||
class UriIndicator extends React.PureComponent<Props> {
|
||||
@@ -38,7 +37,7 @@ class UriIndicator extends React.PureComponent<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { link, isResolvingUri, claim, children, inline, hideAnonymous = false, external = false } = this.props;
|
||||
const { link, isResolvingUri, claim, children, inline, hideAnonymous = false } = this.props;
|
||||
|
||||
if (!claim) {
|
||||
return <span className="empty">{isResolvingUri ? 'Validating...' : 'Unused'}</span>;
|
||||
@@ -75,14 +74,10 @@ class UriIndicator extends React.PureComponent<Props> {
|
||||
}
|
||||
|
||||
if (children) {
|
||||
return (
|
||||
<Button target={external ? '_blank' : undefined} navigate={channelLink}>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
return <Button navigate={channelLink}>{children}</Button>;
|
||||
} else {
|
||||
return (
|
||||
<Button className="button--uri-indicator" navigate={channelLink} target={external ? '_blank' : undefined}>
|
||||
<Button className="button--uri-indicator" navigate={channelLink}>
|
||||
{inner}
|
||||
</Button>
|
||||
);
|
||||
|
||||
@@ -11,23 +11,24 @@ import { AUTO_FOLLOW_CHANNELS, SIMPLE_SITE } from 'config';
|
||||
type Props = {
|
||||
subscribedChannels: Array<Subscription>,
|
||||
onContinue: () => void,
|
||||
onBack: () => void,
|
||||
channelSubscribe: (sub: Subscription) => void,
|
||||
homepageData: any,
|
||||
};
|
||||
|
||||
const channelsToSubscribe = AUTO_FOLLOW_CHANNELS.trim()
|
||||
.split(' ')
|
||||
.filter((x) => x !== '');
|
||||
.filter(x => x !== '');
|
||||
|
||||
function UserChannelFollowIntro(props: Props) {
|
||||
const { subscribedChannels, channelSubscribe, onContinue, homepageData } = props;
|
||||
const { subscribedChannels, channelSubscribe, onContinue, onBack, homepageData } = props;
|
||||
const { PRIMARY_CONTENT_CHANNEL_IDS } = homepageData;
|
||||
const followingCount = (subscribedChannels && subscribedChannels.length) || 0;
|
||||
|
||||
// subscribe to lbry
|
||||
useEffect(() => {
|
||||
if (channelsToSubscribe && channelsToSubscribe.length) {
|
||||
channelsToSubscribe.forEach((c) =>
|
||||
channelsToSubscribe.forEach(c =>
|
||||
channelSubscribe({
|
||||
channelName: parseURI(c).claimName,
|
||||
uri: c,
|
||||
@@ -40,25 +41,25 @@ function UserChannelFollowIntro(props: Props) {
|
||||
<Card
|
||||
title={__('Find channels to follow')}
|
||||
subtitle={__(
|
||||
'Odysee 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.'
|
||||
)}
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<div className="section__actions--between">
|
||||
<Button button="secondary" onClick={onBack} label={__('Back')} />
|
||||
<Button
|
||||
button={subscribedChannels.length < 1 ? 'alt' : 'primary'}
|
||||
onClick={onContinue}
|
||||
label={subscribedChannels.length < 1 ? __('Skip') : __('Continue')}
|
||||
/>
|
||||
</div>
|
||||
<div className="section__body">
|
||||
<ClaimListDiscover
|
||||
hideFilters
|
||||
meta={
|
||||
<Button
|
||||
button={subscribedChannels.length < 1 ? 'alt' : 'primary'}
|
||||
onClick={onContinue}
|
||||
label={subscribedChannels.length < 1 ? __('Skip') : __('Continue')}
|
||||
/>
|
||||
}
|
||||
defaultOrderBy={CS.ORDER_BY_TRENDING}
|
||||
defaultOrderBy={CS.ORDER_BY_TOP}
|
||||
defaultFreshness={CS.FRESH_ALL}
|
||||
claimIds={SIMPLE_SITE ? PRIMARY_CONTENT_CHANNEL_IDS : undefined}
|
||||
claimType={CS.CLAIM_CHANNEL}
|
||||
maxPages={3}
|
||||
claimType="channel"
|
||||
claimIds={SIMPLE_SITE ? undefined : PRIMARY_CONTENT_CHANNEL_IDS}
|
||||
defaultTags={followingCount > 3 ? CS.TAGS_FOLLOWED : undefined}
|
||||
/>
|
||||
{followingCount > 0 && (
|
||||
<Nag
|
||||
|
||||
@@ -11,19 +11,18 @@ import { doSetWalletSyncPreference, doSetDaemonSetting } from 'redux/actions/set
|
||||
import { selectDaemonSettings, makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import UserEmailNew from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
const select = state => ({
|
||||
isPending: selectEmailNewIsPending(state),
|
||||
errorMessage: selectEmailNewErrorMessage(state),
|
||||
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
|
||||
daemonSettings: selectDaemonSettings(state),
|
||||
emailExists: selectEmailAlreadyExists(state),
|
||||
user: selectUser(state),
|
||||
currentTheme: makeSelectClientSetting(SETTINGS.THEME)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
setSync: (value) => dispatch(doSetWalletSyncPreference(value)),
|
||||
setShareDiagnosticData: (shouldShareData) =>
|
||||
const perform = dispatch => ({
|
||||
setSync: value => dispatch(doSetWalletSyncPreference(value)),
|
||||
setShareDiagnosticData: shouldShareData =>
|
||||
dispatch(doSetDaemonSetting(DAEMON_SETTINGS.SHARE_USAGE_DATA, shouldShareData)),
|
||||
doSignUp: (email, password) => dispatch(doUserSignUp(email, password)),
|
||||
clearEmailEntry: () => dispatch(doClearEmailEntry()),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import { SITE_NAME, DOMAIN } from 'config';
|
||||
import { SITE_NAME } from 'config';
|
||||
import React, { useState } from 'react';
|
||||
import { FormField, Form } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
@@ -11,24 +11,20 @@ import { useHistory } from 'react-router-dom';
|
||||
import Card from 'component/common/card';
|
||||
import ErrorText from 'component/common/error-text';
|
||||
import Nag from 'component/common/nag';
|
||||
import classnames from 'classnames';
|
||||
import OdyseeLogoWithWhiteText from 'component/header/odysee_white.png';
|
||||
import OdyseeLogoWithText from 'component/header/odysee.png';
|
||||
|
||||
type Props = {
|
||||
errorMessage: ?string,
|
||||
emailExists: boolean,
|
||||
isPending: boolean,
|
||||
syncEnabled: boolean,
|
||||
setSync: (boolean) => void,
|
||||
setSync: boolean => void,
|
||||
balance: number,
|
||||
daemonSettings: { share_usage_data: boolean },
|
||||
setShareDiagnosticData: (boolean) => void,
|
||||
setShareDiagnosticData: boolean => void,
|
||||
doSignUp: (string, ?string) => Promise<any>,
|
||||
clearEmailEntry: () => void,
|
||||
interestedInYoutubSync: boolean,
|
||||
doToggleInterestedInYoutubeSync: () => void,
|
||||
currentTheme: string,
|
||||
};
|
||||
|
||||
function UserEmailNew(props: Props) {
|
||||
@@ -43,7 +39,6 @@ function UserEmailNew(props: Props) {
|
||||
emailExists,
|
||||
interestedInYoutubSync,
|
||||
doToggleInterestedInYoutubeSync,
|
||||
currentTheme,
|
||||
} = props;
|
||||
const { share_usage_data: shareUsageData } = daemonSettings;
|
||||
const { push, location } = useHistory();
|
||||
@@ -100,10 +95,10 @@ function UserEmailNew(props: Props) {
|
||||
<Card
|
||||
title={__('Join %SITE_NAME%', { SITE_NAME })}
|
||||
// @if TARGET='app'
|
||||
subtitle={__('An account with %domain% allows you to earn rewards and backup your data.', { domain: DOMAIN })}
|
||||
subtitle={__('An account with lbry.tv allows you to earn rewards and backup your data.')}
|
||||
// @endif
|
||||
actions={
|
||||
<div className={classnames({ 'card--disabled': DOMAIN === 'lbry.tv' })}>
|
||||
<div>
|
||||
<Form onSubmit={handleSubmit} className="section">
|
||||
<FormField
|
||||
autoFocus
|
||||
@@ -112,14 +107,14 @@ function UserEmailNew(props: Props) {
|
||||
name="sign_up_email"
|
||||
label={__('Email')}
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
onChange={e => setEmail(e.target.value)}
|
||||
/>
|
||||
<FormField
|
||||
type="password"
|
||||
name="sign_in_password"
|
||||
label={__('Password')}
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
onChange={e => setPassword(e.target.value)}
|
||||
/>
|
||||
|
||||
{/* @if TARGET='web' */}
|
||||
@@ -185,38 +180,8 @@ function UserEmailNew(props: Props) {
|
||||
</Form>
|
||||
</div>
|
||||
}
|
||||
nag={
|
||||
<>
|
||||
{IS_WEB && DOMAIN === 'lbry.tv' && (
|
||||
<Nag
|
||||
relative
|
||||
message={
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
odysee: (
|
||||
<Button button="link" label={__('odysee.com')} href="https://odysee.com?src=lbrytv-retired" />
|
||||
),
|
||||
}}
|
||||
>
|
||||
{__(
|
||||
'lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead'
|
||||
)}
|
||||
</I18nMessage>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{errorMessage && <Nag type="error" relative message={<ErrorText>{errorMessage}</ErrorText>} />}
|
||||
</>
|
||||
}
|
||||
nag={errorMessage && <Nag type="error" relative message={<ErrorText>{errorMessage}</ErrorText>} />}
|
||||
/>
|
||||
|
||||
{IS_WEB && DOMAIN === 'lbry.tv' && (
|
||||
<div className="signup__odysee-logo">
|
||||
<Button href="https://odysee.com?src=lbrytv-retired">
|
||||
<img src={currentTheme === 'light' ? OdyseeLogoWithText : OdyseeLogoWithWhiteText} />
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ type Props = {
|
||||
emailDoesNotExist: boolean,
|
||||
doClearEmailEntry: () => void,
|
||||
doUserSignIn: (string, ?string) => void,
|
||||
doUserCheckIfEmailExists: (string) => void,
|
||||
doSetWalletSyncPreference: (boolean) => void,
|
||||
doUserCheckIfEmailExists: string => void,
|
||||
doSetWalletSyncPreference: boolean => void,
|
||||
doSetClientSetting: (string, boolean, ?boolean) => void,
|
||||
isPending: boolean,
|
||||
};
|
||||
@@ -87,7 +87,7 @@ function UserEmailReturning(props: Props) {
|
||||
name="sign_in_email"
|
||||
label={__('Email')}
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
onChange={e => setEmail(e.target.value)}
|
||||
/>
|
||||
|
||||
{/* @if TARGET='app' */}
|
||||
@@ -119,7 +119,7 @@ function UserEmailReturning(props: Props) {
|
||||
</div>
|
||||
}
|
||||
nag={
|
||||
<>
|
||||
<React.Fragment>
|
||||
{!emailDoesNotExist && emailExistsFromUrl && (
|
||||
<Nag type="helpful" relative message={__('That email is already in use. Did you mean to log in?')} />
|
||||
)}
|
||||
@@ -134,7 +134,7 @@ function UserEmailReturning(props: Props) {
|
||||
{!emailExistsFromUrl && !emailDoesNotExist && errorMessage && (
|
||||
<Nag type="error" relative message={errorMessage} />
|
||||
)}
|
||||
</>
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -8,10 +8,10 @@ const THIRTY_SECONDS_IN_MS = 30000;
|
||||
type Props = {
|
||||
email: string,
|
||||
isReturningUser: boolean,
|
||||
resendVerificationEmail: (string) => void,
|
||||
resendVerificationEmail: string => void,
|
||||
resendingEmail: boolean,
|
||||
checkEmailVerified: () => void,
|
||||
toast: (string) => void,
|
||||
toast: string => void,
|
||||
user: {
|
||||
has_verified_email: boolean,
|
||||
},
|
||||
@@ -102,7 +102,7 @@ class UserEmailVerify extends React.PureComponent<Props, State> {
|
||||
<p className="help--card-actions">
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
help_link: <Button button="link" href="mailto:help@odysee.com" label="help@odysee.com" />,
|
||||
help_link: <Button button="link" href="mailto:help@lbry.com" label="help@lbry.com" />,
|
||||
chat_link: <Button button="link" href="https://chat.lbry.com" label={__('chat')} />,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -6,7 +6,7 @@ import I18nMessage from 'component/i18nMessage';
|
||||
import Card from 'component/common/card';
|
||||
|
||||
type Props = {
|
||||
verifyUserPhone: (string) => void,
|
||||
verifyUserPhone: string => void,
|
||||
resetPhone: () => void,
|
||||
phoneErrorMessage: string,
|
||||
phone: string,
|
||||
@@ -61,7 +61,7 @@ class UserPhoneVerify extends React.PureComponent<Props, State> {
|
||||
name="code"
|
||||
placeholder="1234"
|
||||
value={this.state.code}
|
||||
onChange={(event) => {
|
||||
onChange={event => {
|
||||
this.handleCodeChanged(event);
|
||||
}}
|
||||
label={__('Verification Code')}
|
||||
@@ -72,7 +72,7 @@ class UserPhoneVerify extends React.PureComponent<Props, State> {
|
||||
<p className="help">
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
help_link: <Button button="link" href="mailto:help@odysee.com" label="help@odysee.com" />,
|
||||
help_link: <Button button="link" href="mailto:help@lbry.com" label="help@lbry.com" />,
|
||||
chat_link: <Button button="link" href="https://chat.lbry.com" label={__('chat')} />,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { useHistory } from 'react-router';
|
||||
@@ -6,6 +7,7 @@ import UserEmailNew from 'component/userEmailNew';
|
||||
import UserEmailVerify from 'component/userEmailVerify';
|
||||
import UserFirstChannel from 'component/userFirstChannel';
|
||||
import UserChannelFollowIntro from 'component/userChannelFollowIntro';
|
||||
import UserTagFollowIntro from 'component/userTagFollowIntro';
|
||||
import YoutubeSync from 'page/youtubeSync';
|
||||
import { DEFAULT_BID_FOR_FIRST_CHANNEL } from 'component/userFirstChannel/view';
|
||||
import { YOUTUBE_STATUSES } from 'lbryinc';
|
||||
@@ -40,6 +42,7 @@ type Props = {
|
||||
creatingChannel: boolean,
|
||||
setClientSetting: (string, boolean, ?boolean) => void,
|
||||
followingAcknowledged: boolean,
|
||||
tagsAcknowledged: boolean,
|
||||
rewardsAcknowledged: boolean,
|
||||
interestedInYoutubeSync: boolean,
|
||||
doToggleInterestedInYoutubeSync: () => void,
|
||||
@@ -64,6 +67,7 @@ function UserSignUp(props: Props) {
|
||||
fetchingChannels,
|
||||
creatingChannel,
|
||||
followingAcknowledged,
|
||||
tagsAcknowledged,
|
||||
rewardsAcknowledged,
|
||||
setClientSetting,
|
||||
interestedInYoutubeSync,
|
||||
@@ -114,7 +118,8 @@ function UserSignUp(props: Props) {
|
||||
interestedInYoutubeSync);
|
||||
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
||||
const showFollowIntro = step === 'channels' || (hasVerifiedEmail && !followingAcknowledged);
|
||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !rewardsAcknowledged;
|
||||
const showTagsIntro = step === 'tags' || (hasVerifiedEmail && !tagsAcknowledged);
|
||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !showTagsIntro && !rewardsAcknowledged;
|
||||
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet || creatingChannel;
|
||||
const isWaitingForSomethingToFinish =
|
||||
// If the user has claimed the email award, we need to wait until the balance updates sometime in the future
|
||||
@@ -201,6 +206,22 @@ function UserSignUp(props: Props) {
|
||||
}}
|
||||
/>
|
||||
),
|
||||
showTagsIntro && (
|
||||
<UserTagFollowIntro
|
||||
onContinue={() => {
|
||||
let url = `/$/${PAGES.AUTH}?reset_scroll=1&${STEP_PARAM}=channels`;
|
||||
if (redirect) {
|
||||
url += `&${REDIRECT_PARAM}=${redirect}`;
|
||||
}
|
||||
if (shouldRedirectImmediately) {
|
||||
url += `&${REDIRECT_IMMEDIATELY_PARAM}=true`;
|
||||
}
|
||||
|
||||
replace(url);
|
||||
setSettingAndSync(SETTINGS.TAGS_ACKNOWLEDGED, true);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
showYoutubeTransfer && (
|
||||
<div>
|
||||
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
||||
|
||||
@@ -12,7 +12,7 @@ import LbcSymbol from 'component/common/lbc-symbol';
|
||||
type Props = {
|
||||
errorMessage: ?string,
|
||||
isPending: boolean,
|
||||
verifyUserIdentity: (string) => void,
|
||||
verifyUserIdentity: string => void,
|
||||
verifyPhone: () => void,
|
||||
fetchUser: () => void,
|
||||
skipLink?: string,
|
||||
@@ -60,7 +60,7 @@ class UserVerify extends React.PureComponent<Props> {
|
||||
SITE_NAME,
|
||||
}}
|
||||
>
|
||||
Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing
|
||||
Verified accounts are eligible to earn LBRY Credits for views, watching and reposting content, sharing
|
||||
invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.
|
||||
</I18nMessage>
|
||||
</p>
|
||||
@@ -73,7 +73,9 @@ class UserVerify extends React.PureComponent<Props> {
|
||||
<Card
|
||||
icon={ICONS.PHONE}
|
||||
title={__('Verify phone number')}
|
||||
subtitle={__('You will receive an SMS text message confirming your phone number is valid.')}
|
||||
subtitle={__(
|
||||
'You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.'
|
||||
)}
|
||||
actions={
|
||||
<Fragment>
|
||||
<Button
|
||||
|
||||
@@ -97,22 +97,3 @@ export function showSeekedOverlay(player, duration, isForward) {
|
||||
|
||||
showOneOffOverlay(player, OVERLAY_CLASS_SEEKED, overlayJsx, 'center');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a transient "Volume Percentage" overlay.
|
||||
*
|
||||
* @param player The videojs instance.
|
||||
* @param percentage how much % of volume active.
|
||||
*/
|
||||
export function showVolumeverlay(player, percentage) {
|
||||
const overlayJsx = (
|
||||
<div>
|
||||
<p>
|
||||
{percentage}
|
||||
{'%'}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
showOneOffOverlay(player, OVERLAY_CLASS_SEEKED, overlayJsx, 'center');
|
||||
}
|
||||
@@ -31,7 +31,6 @@ export type Player = {
|
||||
loadingSpinner: any,
|
||||
getChild: (string) => any,
|
||||
playbackRate: (?number) => number,
|
||||
readyState: () => number,
|
||||
userActive: (?boolean) => boolean,
|
||||
overlay: (any) => void,
|
||||
mobileUi: (any) => void,
|
||||
@@ -51,14 +50,14 @@ type Props = {
|
||||
toggleVideoTheaterMode: () => void,
|
||||
};
|
||||
|
||||
// type VideoJSOptions = {
|
||||
// controls: boolean,
|
||||
// preload: string,
|
||||
// playbackRates: Array<number>,
|
||||
// responsive: boolean,
|
||||
// poster: ?string,
|
||||
// muted: ?boolean,
|
||||
// };
|
||||
type VideoJSOptions = {
|
||||
controls: boolean,
|
||||
preload: string,
|
||||
playbackRates: Array<number>,
|
||||
responsive: boolean,
|
||||
poster?: string,
|
||||
muted?: boolean,
|
||||
};
|
||||
|
||||
const videoPlaybackRates = [0.25, 0.5, 0.75, 1, 1.1, 1.25, 1.5, 1.75, 2];
|
||||
|
||||
@@ -67,7 +66,7 @@ const IS_IOS =
|
||||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
|
||||
!window.MSStream;
|
||||
|
||||
const VIDEO_JS_OPTIONS = {
|
||||
const VIDEO_JS_OPTIONS: VideoJSOptions = {
|
||||
preload: 'auto',
|
||||
playbackRates: videoPlaybackRates,
|
||||
responsive: true,
|
||||
@@ -86,28 +85,17 @@ const SMALL_F_KEYCODE = 70;
|
||||
const SMALL_M_KEYCODE = 77;
|
||||
const SMALL_T_KEYCODE = 84;
|
||||
const ARROW_LEFT_KEYCODE = 37;
|
||||
const ARROW_UP_KEYCODE = 38;
|
||||
const ARROW_RIGHT_KEYCODE = 39;
|
||||
const ARROW_DOWN_KEYCODE = 40;
|
||||
const COMMA_KEYCODE = 188;
|
||||
const PERIOD_KEYCODE = 190;
|
||||
const SMALL_J_KEYCODE = 74;
|
||||
const SMALL_K_KEYCODE = 75;
|
||||
const SMALL_L_KEYCODE = 76;
|
||||
|
||||
const FULLSCREEN_KEYCODE = SMALL_F_KEYCODE;
|
||||
const MUTE_KEYCODE = SMALL_M_KEYCODE;
|
||||
const THEATER_MODE_KEYCODE = SMALL_T_KEYCODE;
|
||||
|
||||
const VOLUME_UP_KEYCODE = ARROW_UP_KEYCODE;
|
||||
const VOLUME_DOWN_KEYCODE = ARROW_DOWN_KEYCODE;
|
||||
const SEEK_FORWARD_KEYCODE = ARROW_RIGHT_KEYCODE;
|
||||
const SEEK_BACKWARD_KEYCODE = ARROW_LEFT_KEYCODE;
|
||||
|
||||
const SEEK_FORWARD_KEYCODE = SMALL_L_KEYCODE;
|
||||
const SEEK_BACKWARD_KEYCODE = SMALL_J_KEYCODE;
|
||||
const SEEK_FORWARD_KEYCODE_5 = ARROW_RIGHT_KEYCODE;
|
||||
const SEEK_BACKWARD_KEYCODE_5 = ARROW_LEFT_KEYCODE;
|
||||
|
||||
const SEEK_STEP_5 = 5;
|
||||
const SEEK_STEP = 10; // time to seek in seconds
|
||||
|
||||
if (!Object.keys(videojs.getPlugins()).includes('eventTracking')) {
|
||||
@@ -172,7 +160,9 @@ properties for this component should be kept to ONLY those that if changed shoul
|
||||
*/
|
||||
export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
const { autoplay, startMuted, source, sourceType, poster, isAudio, onPlayerReady, toggleVideoTheaterMode } = props;
|
||||
|
||||
const [reload, setReload] = useState('initial');
|
||||
|
||||
const playerRef = useRef();
|
||||
const containerRef = useRef();
|
||||
const videoJsOptions = {
|
||||
@@ -343,7 +333,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.keyCode === SPACE_BAR_KEYCODE || e.keyCode === SMALL_K_KEYCODE) {
|
||||
if (e.keyCode === SPACE_BAR_KEYCODE) {
|
||||
videoNode.paused ? videoNode.play() : videoNode.pause();
|
||||
}
|
||||
|
||||
@@ -360,16 +350,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
if (e.keyCode === MUTE_KEYCODE) {
|
||||
videoNode.muted = !videoNode.muted;
|
||||
}
|
||||
if (e.keyCode === VOLUME_DOWN_KEYCODE) {
|
||||
player.volume(player.volume() - 0.05);
|
||||
OVERLAY.showVolumeverlay(player, Math.round(player.volume() * 100));
|
||||
player.userActive(true);
|
||||
}
|
||||
if (e.keyCode === VOLUME_UP_KEYCODE) {
|
||||
player.volume(player.volume() + 0.05);
|
||||
OVERLAY.showVolumeverlay(player, Math.round(player.volume() * 100));
|
||||
player.userActive(true);
|
||||
}
|
||||
|
||||
// Seeking Shortcuts
|
||||
if (!e.altKey) {
|
||||
@@ -386,17 +366,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
OVERLAY.showSeekedOverlay(player, SEEK_STEP, false);
|
||||
player.userActive(true);
|
||||
}
|
||||
if (e.keyCode === SEEK_FORWARD_KEYCODE_5) {
|
||||
const newDuration = currentTime + SEEK_STEP_5;
|
||||
videoNode.currentTime = newDuration < 0 ? 0 : newDuration;
|
||||
OVERLAY.showSeekedOverlay(player, SEEK_STEP_5, true);
|
||||
player.userActive(true);
|
||||
} else if (e.keyCode === SEEK_BACKWARD_KEYCODE_5) {
|
||||
const newDuration = currentTime - SEEK_STEP_5;
|
||||
videoNode.currentTime = newDuration < 0 ? 0 : newDuration;
|
||||
OVERLAY.showSeekedOverlay(player, SEEK_STEP_5, false);
|
||||
player.userActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Playback-Rate Shortcuts ('>' = speed up, '<' = speed down)
|
||||
@@ -483,7 +452,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
return vjs;
|
||||
}
|
||||
|
||||
// This lifecycle hook is only called once (on mount), or when `isAudio` changes.
|
||||
// This lifecycle hook is only called once (on mount)
|
||||
useEffect(() => {
|
||||
const vjsElement = createVideoPlayerDOM(containerRef.current);
|
||||
const vjsPlayer = initializeVideoPlayer(vjsElement);
|
||||
@@ -507,7 +476,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
player.dispose();
|
||||
}
|
||||
};
|
||||
}, [isAudio]);
|
||||
}, []);
|
||||
|
||||
// Update video player and reload when source URL changes
|
||||
useEffect(() => {
|
||||
|
||||
@@ -19,8 +19,8 @@ const PLAY_TIMEOUT_LIMIT = 2000;
|
||||
|
||||
type Props = {
|
||||
position: number,
|
||||
changeVolume: (number) => void,
|
||||
changeMute: (boolean) => void,
|
||||
changeVolume: number => void,
|
||||
changeMute: boolean => void,
|
||||
source: string,
|
||||
contentType: string,
|
||||
thumbnail: string,
|
||||
@@ -36,9 +36,9 @@ type Props = {
|
||||
doAnalyticsBuffer: (string, any) => void,
|
||||
claimRewards: () => void,
|
||||
savePosition: (string, number) => void,
|
||||
clearPosition: (string) => void,
|
||||
clearPosition: string => void,
|
||||
toggleVideoTheaterMode: () => void,
|
||||
setVideoPlaybackRate: (number) => void,
|
||||
setVideoPlaybackRate: number => void,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -73,17 +73,17 @@ function VideoViewer(props: Props) {
|
||||
const claimId = claim && claim.claim_id;
|
||||
const isAudio = contentType.includes('audio');
|
||||
const forcePlayer = FORCE_CONTENT_TYPE_PLAYER.includes(contentType);
|
||||
const previousUri = usePrevious(uri);
|
||||
const embedded = useContext(EmbedContext);
|
||||
const [isPlaying, setIsPlaying] = useState(false);
|
||||
const [showAutoplayCountdown, setShowAutoplayCountdown] = useState(false);
|
||||
const [isEndededEmbed, setIsEndededEmbed] = useState(false);
|
||||
const vjsCallbackDataRef: any = React.useRef();
|
||||
|
||||
/* isLoading was designed to show loading screen on first play press, rather than completely black screen, but
|
||||
breaks because some browsers (e.g. Firefox) block autoplay but leave the player.play Promise pending */
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const previousUri = usePrevious(uri);
|
||||
const embedded = useContext(EmbedContext);
|
||||
|
||||
// force everything to recent when URI changes, can cause weird corner cases otherwise (e.g. navigate while autoplay is true)
|
||||
useEffect(() => {
|
||||
if (uri && previousUri && uri !== previousUri) {
|
||||
@@ -93,16 +93,8 @@ function VideoViewer(props: Props) {
|
||||
}
|
||||
}, [uri, previousUri]);
|
||||
|
||||
// Update vjsCallbackDataRef (ensures videojs callbacks are not using stale values):
|
||||
useEffect(() => {
|
||||
vjsCallbackDataRef.current = {
|
||||
embedded: embedded,
|
||||
videoPlaybackRate: videoPlaybackRate,
|
||||
};
|
||||
}, [embedded, videoPlaybackRate]);
|
||||
|
||||
function doTrackingBuffered(e: Event, data: any) {
|
||||
fetch(source, { method: 'HEAD' }).then((response) => {
|
||||
fetch(source, { method: 'HEAD' }).then(response => {
|
||||
data.playerPoweredBy = response.headers.get('x-powered-by');
|
||||
doAnalyticsBuffer(uri, data);
|
||||
});
|
||||
@@ -145,12 +137,6 @@ function VideoViewer(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
function restorePlaybackRate(player) {
|
||||
if (!vjsCallbackDataRef.current.embedded) {
|
||||
player.playbackRate(vjsCallbackDataRef.current.videoPlaybackRate);
|
||||
}
|
||||
}
|
||||
|
||||
const onPlayerReady = useCallback(
|
||||
(player: Player) => {
|
||||
if (!embedded) {
|
||||
@@ -164,14 +150,12 @@ function VideoViewer(props: Props) {
|
||||
// https://blog.videojs.com/autoplay-best-practices-with-video-js/#Programmatic-Autoplay-and-Success-Failure-Detection
|
||||
if (shouldPlay) {
|
||||
const playPromise = player.play();
|
||||
const timeoutPromise = new Promise((resolve, reject) =>
|
||||
setTimeout(() => reject(PLAY_TIMEOUT_ERROR), PLAY_TIMEOUT_LIMIT)
|
||||
);
|
||||
const timeoutPromise = new Promise((resolve, reject) => setTimeout(() => reject(PLAY_TIMEOUT_ERROR), PLAY_TIMEOUT_LIMIT));
|
||||
|
||||
Promise.race([playPromise, timeoutPromise]).catch((error) => {
|
||||
Promise.race([playPromise, timeoutPromise]).catch(error => {
|
||||
if (PLAY_TIMEOUT_ERROR) {
|
||||
const retryPlayPromise = player.play();
|
||||
Promise.race([retryPlayPromise, timeoutPromise]).catch((error) => {
|
||||
Promise.race([retryPlayPromise, timeoutPromise]).catch(error => {
|
||||
setIsLoading(false);
|
||||
setIsPlaying(false);
|
||||
});
|
||||
@@ -183,13 +167,6 @@ function VideoViewer(props: Props) {
|
||||
}
|
||||
|
||||
setIsLoading(shouldPlay); // if we are here outside of an embed, we're playing
|
||||
|
||||
// PR: #5535
|
||||
// Move the restoration to a later `loadedmetadata` phase to counter the
|
||||
// delay from the header-fetch. This is a temp change until the next
|
||||
// re-factoring.
|
||||
player.on('loadedmetadata', () => restorePlaybackRate(player));
|
||||
|
||||
player.on('tracking:buffered', doTrackingBuffered);
|
||||
player.on('tracking:firstplay', doTrackingFirstPlay);
|
||||
player.on('ended', onEnded);
|
||||
@@ -198,8 +175,9 @@ function VideoViewer(props: Props) {
|
||||
setIsPlaying(false);
|
||||
handlePosition(player);
|
||||
});
|
||||
player.on('error', () => {
|
||||
player.on('error', function() {
|
||||
const error = player.error();
|
||||
|
||||
if (error) {
|
||||
analytics.sentryError('Video.js error', error);
|
||||
}
|
||||
@@ -211,12 +189,7 @@ function VideoViewer(props: Props) {
|
||||
}
|
||||
});
|
||||
player.on('ratechange', () => {
|
||||
const HAVE_NOTHING = 0; // https://docs.videojs.com/player#readyState
|
||||
if (player && player.readyState() !== HAVE_NOTHING) {
|
||||
// The playbackRate occasionally resets to 1, typically when loading a fresh video or when 'src' changes.
|
||||
// Videojs says it's a browser quirk (https://github.com/videojs/video.js/issues/2516).
|
||||
// [x] Don't update 'videoPlaybackRate' in this scenario.
|
||||
// [ ] Ideally, the controlBar should be hidden to prevent users from changing the rate while loading.
|
||||
if (player) {
|
||||
setVideoPlaybackRate(player.playbackRate());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
@@ -63,7 +64,7 @@ function WalletSendTip(props: Props) {
|
||||
const { channelName } = parseURI(uri);
|
||||
const noBalance = balance === 0;
|
||||
const tipAmount = useCustomTip ? customTipAmount : presetTipAmount;
|
||||
const isSupport = claimIsMine || !sendAsTip;
|
||||
const isSupport = claimIsMine ? true : SIMPLE_SITE ? false : !sendAsTip;
|
||||
|
||||
React.useEffect(() => {
|
||||
const regexp = RegExp(/^(\d*([.]\d{0,8})?)$/);
|
||||
@@ -156,37 +157,15 @@ function WalletSendTip(props: Props) {
|
||||
/>
|
||||
) : (
|
||||
<Card
|
||||
title={<LbcSymbol postfix={claimIsMine ? __('Boost your content') : __('Support this content')} size={22} />}
|
||||
title={claimIsMine ? __('Boost your content') : isSupport ? __('Support this content') : __('Support')}
|
||||
subtitle={
|
||||
<React.Fragment>
|
||||
{!claimIsMine && (
|
||||
<div className="section">
|
||||
<Button
|
||||
key="tip"
|
||||
icon={ICONS.SUPPORT}
|
||||
label={__('Tip')}
|
||||
button="alt"
|
||||
onClick={() => setSendAsTip(true)}
|
||||
className={classnames('button-toggle', { 'button-toggle--active': sendAsTip })}
|
||||
/>
|
||||
<Button
|
||||
key="boost"
|
||||
icon={ICONS.TRENDING}
|
||||
label={__('Boost')}
|
||||
button="alt"
|
||||
onClick={() => setSendAsTip(false)}
|
||||
className={classnames('button-toggle', { 'button-toggle--active': !sendAsTip })}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="section__subtitle">
|
||||
{isSupport
|
||||
? __(
|
||||
'This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.'
|
||||
)
|
||||
: __('Show this channel your appreciation by sending a donation.')}{' '}
|
||||
<Button label={__('Learn more')} button="link" href="https://lbry.com/faq/tipping" />
|
||||
</div>
|
||||
{isSupport
|
||||
? __(
|
||||
'This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.'
|
||||
)
|
||||
: __('Show this channel your appreciation by sending a donation.')}{' '}
|
||||
<Button label={__('Learn more')} button="link" href="https://lbry.com/faq/tipping" />.
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
@@ -200,7 +179,7 @@ function WalletSendTip(props: Props) {
|
||||
<div className="confirm__value">
|
||||
{activeChannelClaim && !incognito ? activeChannelClaim.name : __('Anonymous')}
|
||||
</div>
|
||||
<div className="confirm__label">{__(isSupport ? 'Boosting' : 'Tipping')}</div>
|
||||
<div className="confirm__label">{__(isSupport ? 'Supporting' : 'Tipping')}</div>
|
||||
<div className="confirm__value">
|
||||
<LbcSymbol postfix={tipAmount} size={22} />
|
||||
</div>
|
||||
@@ -224,7 +203,7 @@ function WalletSendTip(props: Props) {
|
||||
</div>
|
||||
|
||||
<div className="section">
|
||||
{DEFAULT_TIP_AMOUNTS.map((amount) => (
|
||||
{DEFAULT_TIP_AMOUNTS.map(amount => (
|
||||
<Button
|
||||
key={amount}
|
||||
disabled={amount > balance}
|
||||
@@ -250,7 +229,7 @@ function WalletSendTip(props: Props) {
|
||||
label={__('Custom')}
|
||||
onClick={() => setUseCustomTip(true)}
|
||||
/>
|
||||
{DEFAULT_TIP_AMOUNTS.some((val) => val > balance) && (
|
||||
{DEFAULT_TIP_AMOUNTS.some(val => val > balance) && (
|
||||
<Button
|
||||
button="secondary"
|
||||
className="button-toggle-group-action"
|
||||
@@ -283,7 +262,7 @@ function WalletSendTip(props: Props) {
|
||||
type="number"
|
||||
placeholder="1.23"
|
||||
value={customTipAmount}
|
||||
onChange={(event) => handleCustomPriceChange(event)}
|
||||
onChange={event => handleCustomPriceChange(event)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -291,17 +270,26 @@ function WalletSendTip(props: Props) {
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
autoFocus
|
||||
icon={isSupport ? ICONS.TRENDING : ICONS.SUPPORT}
|
||||
icon={isSupport ? undefined : ICONS.SUPPORT}
|
||||
button="primary"
|
||||
type="submit"
|
||||
disabled={fetchingChannels || isPending || tipError || !tipAmount}
|
||||
label={
|
||||
isSupport
|
||||
? __('Boost This Content')
|
||||
? __('Send Revocable Support')
|
||||
: __('Send a %amount% Tip', { amount: tipAmount ? `${tipAmount} Credit` : '' })
|
||||
}
|
||||
/>
|
||||
{fetchingChannels && <span className="help">{__('Loading your channels...')}</span>}
|
||||
{!claimIsMine && !fetchingChannels && !SIMPLE_SITE && (
|
||||
<FormField
|
||||
name="toggle-is-support"
|
||||
type="checkbox"
|
||||
label={__('Make this a tip')}
|
||||
checked={sendAsTip}
|
||||
onChange={() => setSendAsTip(!sendAsTip)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<WalletSpendableBalanceHelp />
|
||||
</>
|
||||
|
||||