Compare commits
1
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
|
||||
|
||||
+2
-35
@@ -4,43 +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
|
||||
|
||||
- Japanese, Afrikaans, Filipino, Thai and Vietnamese language support ([#5684](https://github.com/lbryio/lbry-desktop/issues/5684))
|
||||
- Highlight comments made by content owner _community pr!_ ([#5744](https://github.com/lbryio/lbry-desktop/pull/5744))
|
||||
|
||||
### 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
|
||||
|
||||
- Fix display of upload date and view count on smaller screens ([#5822](https://github.com/lbryio/lbry-desktop/issues/5822))
|
||||
- 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))
|
||||
- Edited claim accidentally moved to 'Anonymous' ([#5767](https://github.com/lbryio/lbry-desktop/pull/5767))
|
||||
|
||||
## [0.50.2] - [2021-04-2]
|
||||
|
||||
### Changed
|
||||
|
||||
- Disable PDFs until security issue is fixed
|
||||
|
||||
## [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))
|
||||
@@ -50,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',
|
||||
|
||||
@@ -3,11 +3,26 @@ import { app, BrowserWindow, dialog, shell, screen, nativeImage } from 'electron
|
||||
import isDev from 'electron-is-dev';
|
||||
import windowStateKeeper from 'electron-window-state';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import { SUPPORTED_SUB_LANGUAGE_CODES, SUB_LANG_CODE_LEN } from 'constants/supported_sub_languages';
|
||||
import SUPPORTED_BROWSER_LANGUAGES from 'constants/supported_browser_languages';
|
||||
import { TO_TRAY_WHEN_CLOSED } from 'constants/settings';
|
||||
|
||||
import setupBarMenu from './menu/setupBarMenu';
|
||||
import * as PAGES from 'constants/pages';
|
||||
|
||||
function GetAppLangCode() {
|
||||
// https://www.electronjs.org/docs/api/locales
|
||||
// 1. Gets the user locale.
|
||||
// 2. Converts unsupported sub-languages to its primary (e.g. "en-GB" -> "en").
|
||||
// Note that the primary itself may or may not be a supported language
|
||||
// (up to clients to verify against SUPPORTED_LANGUAGES).
|
||||
const langCode = app.getLocale();
|
||||
if (langCode.length === SUB_LANG_CODE_LEN && !SUPPORTED_SUB_LANGUAGE_CODES.includes(langCode)) {
|
||||
return SUPPORTED_BROWSER_LANGUAGES[langCode.slice(0, 2)];
|
||||
}
|
||||
return SUPPORTED_BROWSER_LANGUAGES[langCode];
|
||||
}
|
||||
|
||||
export default appState => {
|
||||
// Get primary display dimensions from Electron.
|
||||
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
|
||||
@@ -156,9 +171,11 @@ export default appState => {
|
||||
window.webContents.session.setUserAgent(`LBRY/${app.getVersion()}`);
|
||||
|
||||
// restore the user's previous language - we have to do this from here because only electron process can access app.getLocale()
|
||||
// Update: we don't really need to call app.getLocale (didn't work anyway), so we could move this if we want.
|
||||
window.webContents.executeJavaScript("localStorage.getItem('language')").then(storedLanguage => {
|
||||
const language = storedLanguage;
|
||||
const language =
|
||||
storedLanguage && storedLanguage !== 'undefined' && storedLanguage !== 'null'
|
||||
? storedLanguage
|
||||
: GetAppLangCode();
|
||||
if (language !== 'en' && SUPPORTED_LANGUAGES[language]) {
|
||||
window.webContents.send('language-set', language);
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.50.2",
|
||||
"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#35088a6d1007f877a33baf62d67b37669edea043",
|
||||
"lbry-redux": "lbryio/lbry-redux#bf728f8716385749370de9a1edee50b267d61fa4",
|
||||
"lbryinc": "lbryio/lbryinc#7faea40d87b78ec91b901c62f501499dc4737025",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
@@ -217,7 +217,7 @@
|
||||
"webpack-hot-middleware": "^2.24.3",
|
||||
"webpack-merge": "^4.2.1",
|
||||
"webpack-node-externals": "^1.7.2",
|
||||
"y18n": "^4.0.1",
|
||||
"y18n": "^4.0.0",
|
||||
"yarnhook": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -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",
|
||||
|
||||
+7
-119
@@ -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",
|
||||
@@ -605,9 +601,7 @@
|
||||
"Looks like you don't have any transactions.": "Looks like you don't have any transactions.",
|
||||
"If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.": "If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.",
|
||||
"Your update is now pending on LBRY. It will take a few minutes to appear for other users.": "Your update is now pending on LBRY. It will take a few minutes to appear for other users.",
|
||||
"Your livestream is now pending. You will be able to start shortly at the streaming dashboard.": "Your livestream is now pending. You will be able to start shortly at the streaming dashboard.",
|
||||
"Your file is now pending on LBRY. It will take a few minutes to appear for other users.": "Your file is now pending on LBRY. It will take a few minutes to appear for other users.",
|
||||
"Your 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",
|
||||
@@ -715,12 +709,10 @@
|
||||
"This is an experiment, and may be removed in the future. Upload something with the #homepagecagematch tag to battle for the top spot on the home page!": "This is an experiment, and may be removed in the future. Upload something with the #homepagecagematch tag to battle for the top spot on the home page!",
|
||||
"Publishing": "Publishing",
|
||||
"Update published": "Update published",
|
||||
"Livestream Created": "Livestream Created",
|
||||
"Delete this file from my computer": "Delete this file from my computer",
|
||||
"Are you sure you'd like to remove %title% 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",
|
||||
@@ -763,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",
|
||||
@@ -889,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",
|
||||
@@ -922,7 +912,6 @@
|
||||
"Embed this content": "Embed this content",
|
||||
"More actions": "More actions",
|
||||
"music": "music",
|
||||
"Music": "Music",
|
||||
"Transactions": "Transactions",
|
||||
"Payment": "Payment",
|
||||
"Stream": "Stream",
|
||||
@@ -966,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",
|
||||
@@ -1174,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...",
|
||||
@@ -1213,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",
|
||||
@@ -1236,7 +1216,6 @@
|
||||
"Video file": "Video file",
|
||||
"Select video file to upload": "Select video file to upload",
|
||||
"Uploading...": "Uploading...",
|
||||
"Creating...": "Creating...",
|
||||
"Use a URL": "Use a URL",
|
||||
"Edit Cover Image": "Edit Cover Image",
|
||||
"Cover Image": "Cover Image",
|
||||
@@ -1283,21 +1262,18 @@
|
||||
"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",
|
||||
"View My Dashboard": "View My Dashboard",
|
||||
"No recent uploads": "No recent uploads",
|
||||
"Removing...": "Removing...",
|
||||
"License description": "License description",
|
||||
@@ -1339,7 +1315,6 @@
|
||||
"Tech": "Tech",
|
||||
"Lab": "Lab",
|
||||
"Technology": "Technology",
|
||||
"Movies": "Movies",
|
||||
"News": "News",
|
||||
"News & Politics": "News & Politics",
|
||||
"Finance 2.0": "Finance 2.0",
|
||||
@@ -1354,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",
|
||||
@@ -1366,7 +1340,6 @@
|
||||
"Preparing...": "Preparing...",
|
||||
"Confirm Upload": "Confirm Upload",
|
||||
"Confirm Edit": "Confirm Edit",
|
||||
"Create Livestream": "Create Livestream",
|
||||
"File": "File",
|
||||
"Transcode": "Transcode",
|
||||
"Estimated transaction fee:": "Estimated transaction fee:",
|
||||
@@ -1380,6 +1353,7 @@
|
||||
"Disabling sync will switch to your local profile.": "Disabling sync will switch to your local profile.",
|
||||
"To enable Sync, close LBRY completely and check 'Remember Password' during wallet unlock.": "To enable Sync, close LBRY completely and check 'Remember Password' during wallet unlock.",
|
||||
"Something went wrong. Please %click_here% to learn about sync limitations.": "Something went wrong. Please %click_here% to learn about sync limitations.",
|
||||
"Buy LBC": "Buy LBC",
|
||||
"Continue...": "Continue...",
|
||||
"Leave a comment": "Leave a comment",
|
||||
"Be the first to comment!": "Be the first to comment!",
|
||||
@@ -1422,23 +1396,17 @@
|
||||
"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 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% 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",
|
||||
@@ -1447,16 +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",
|
||||
"You earned %lbc% for adding your email.": "You earned %lbc% for adding your email.",
|
||||
"Inviter Bonus": "Inviter Bonus",
|
||||
"You earned %lbc% reward for you and your friend.": "You earned %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% 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",
|
||||
@@ -1481,30 +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.",
|
||||
"🎁 Treats are available": "🎁 Treats are available",
|
||||
"Claiming your daily reward is as easy as pressing this bell 🔔": "Claiming your daily reward is as easy as pressing this bell 🔔",
|
||||
"Press ▶️ for 🎁": "Press ▶️ for 🎁",
|
||||
"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 🎁": "Follow your first channel for a reward 🎁",
|
||||
"Free LBC?": "Free LBC?",
|
||||
"Free Credits?": "Free Credits?",
|
||||
"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 🎁": "A Welcome 🎁",
|
||||
"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",
|
||||
@@ -1547,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",
|
||||
@@ -1560,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",
|
||||
@@ -1600,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.",
|
||||
@@ -1641,8 +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.",
|
||||
"Video stonks.": "Video stonks.",
|
||||
"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",
|
||||
@@ -1669,60 +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",
|
||||
"Create a Livestream by first submitting your Livestream details and waiting for approval confirmation.": "Create a Livestream by first submitting your Livestream details and waiting for approval confirmation.",
|
||||
"The livestream will not be visible on your channel until you are live, but you can share the URL in advance.": "The livestream will not be visible on your channel until you are live, but you can share the URL in advance.",
|
||||
"Once the your livestream is confirmed, configure your streaming software (OBS, Restream, etc) and input the server URL along with the stream key in it.": "Once the your livestream is confirmed, configure your streaming software (OBS, Restream, etc) and input the server URL along with the stream key in it.",
|
||||
"To ensure the best streaming experience with OBS, open settings -> output": "To ensure the best streaming experience with OBS, open settings -> output",
|
||||
"Select advanced mode from the dropdown at the top.": "Select advanced mode from the dropdown at the top.",
|
||||
"Ensure the following settings are selected under the streaming tab:": "Ensure the following settings are selected under the streaming tab:",
|
||||
"Bitrate: 1000 to 2500 kbps": "Bitrate: 1000 to 2500 kbps",
|
||||
"Keyframes: 1": "Keyframes: 1",
|
||||
"Profile: High": "Profile: High",
|
||||
"Tune: Zerolatency": "Tune: Zerolatency",
|
||||
"If using other livestreaming software, make sure the bitrate is below 5000 kbps or the stream will not work.": "If using other livestreaming software, make sure the bitrate is below 5000 kbps or the stream will not work.",
|
||||
"Please note: You'll need to record your own stream through your software if you plan to share it afterward. You can also delete it if you prefer not to upload the copy.": "Please note: You'll need to record your own stream through your software if you plan to share it afterward. You can also delete it if you prefer not to upload the copy.",
|
||||
"In the near future, this manual step will be removed and you will be able to share the stream right after its finished without needing to record it yourself.": "In the near future, this manual step will be removed and you will be able to share the stream right after its finished without needing to record it yourself.",
|
||||
"After your livestream:\nClick the Publish Replay button. This will allow you to edit details before sharing on Odysee. Be sure to select the saved mp4 file you recorded.": "After your livestream:\nClick the Publish Replay button. This will allow you to edit details before sharing on Odysee. Be sure to select the saved mp4 file you recorded.",
|
||||
"Click Save and you are done!": "Click Save and you are done!",
|
||||
"How does this work?": "How does this work?",
|
||||
"Go Live on Odysee": "Go Live on Odysee",
|
||||
"You're invited to try out our new livestreaming service while in beta!": "You're invited to try out our new livestreaming service while in beta!",
|
||||
"lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead": "lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead",
|
||||
"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.",
|
||||
"We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.": "We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.",
|
||||
"Help LBRY Save Crypto": "Help LBRY Save Crypto",
|
||||
"The US government is attempting to destroy the cryptocurrency industry. Can you help?": "The US government is attempting to destroy the cryptocurrency industry. Can you help?",
|
||||
"Learn more and sign petition": "Learn more and sign petition",
|
||||
"Publishing...": "Publishing...",
|
||||
"Collection": "Collection",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
@@ -30,6 +30,6 @@ export default function I18nMessage(props: Props) {
|
||||
return (
|
||||
// style={{height: iframeHeight}}
|
||||
// ref={iframeRef}
|
||||
<iframe src={src} title={title} onLoad={onLoad} sandbox={!IS_WEB} />
|
||||
<iframe src={src} title={title} onLoad={onLoad} />
|
||||
);
|
||||
}
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
STATUS_DOWN,
|
||||
} from 'web/effects/use-degraded-performance';
|
||||
// @endif
|
||||
import LANGUAGE_MIGRATIONS from 'constants/language-migrations';
|
||||
export const MAIN_WRAPPER_CLASS = 'main-wrapper';
|
||||
export const IS_MAC = navigator.userAgent.indexOf('Mac OS X') !== -1;
|
||||
|
||||
@@ -144,6 +145,7 @@ function App(props: Props) {
|
||||
const useCustomScrollbar = !IS_MAC;
|
||||
const hasMyChannels = myChannelUrls && myChannelUrls.length > 0;
|
||||
const hasNoChannels = myChannelUrls && myChannelUrls.length === 0;
|
||||
const shouldMigrateLanguage = LANGUAGE_MIGRATIONS[language];
|
||||
const hasActiveChannelClaim = activeChannelClaim !== undefined;
|
||||
|
||||
let uri;
|
||||
@@ -257,6 +259,12 @@ function App(props: Props) {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [language, languages]);
|
||||
|
||||
useEffect(() => {
|
||||
if (shouldMigrateLanguage) {
|
||||
setLanguage(shouldMigrateLanguage);
|
||||
}
|
||||
}, [shouldMigrateLanguage, setLanguage]);
|
||||
|
||||
useEffect(() => {
|
||||
// Check that previousHasVerifiedEmail was not undefined instead of just not truthy
|
||||
// This ensures we don't fire the emailVerified event on the initial user fetch
|
||||
@@ -344,13 +352,7 @@ function App(props: Props) {
|
||||
// @endif
|
||||
|
||||
if (syncFatalError) {
|
||||
return (
|
||||
<SyncFatalError
|
||||
// @if TARGET='web'
|
||||
lbryTvApiStatus={lbryTvApiStatus}
|
||||
// @endif
|
||||
/>
|
||||
);
|
||||
return <SyncFatalError lbryTvApiStatus={lbryTvApiStatus} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 || []}
|
||||
|
||||
@@ -5,7 +5,6 @@ import EmbedPlayButton from 'component/embedPlayButton';
|
||||
import Button from 'component/button';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import { INLINE_PLAYER_WRAPPER_CLASS } from 'component/fileRenderFloating/view';
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -13,7 +12,7 @@ type Props = {
|
||||
children: React.Node,
|
||||
description: ?string,
|
||||
isResolvingUri: boolean,
|
||||
doResolveUri: (string) => void,
|
||||
doResolveUri: string => void,
|
||||
blackListedOutpoints: Array<{
|
||||
txid: string,
|
||||
nout: number,
|
||||
@@ -21,7 +20,6 @@ type Props = {
|
||||
playingUri: ?PlayingUri,
|
||||
parentCommentId?: string,
|
||||
isMarkdownPost?: boolean,
|
||||
allowPreview?: boolean,
|
||||
};
|
||||
|
||||
class ClaimLink extends React.Component<Props> {
|
||||
@@ -48,7 +46,7 @@ class ClaimLink extends React.Component<Props> {
|
||||
let blackListed = false;
|
||||
|
||||
blackListed = blackListedOutpoints.some(
|
||||
(outpoint) =>
|
||||
outpoint =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
@@ -65,16 +63,7 @@ class ClaimLink extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
uri,
|
||||
claim,
|
||||
children,
|
||||
isResolvingUri,
|
||||
playingUri,
|
||||
parentCommentId,
|
||||
isMarkdownPost,
|
||||
allowPreview,
|
||||
} = this.props;
|
||||
const { uri, claim, children, isResolvingUri, playingUri, parentCommentId, isMarkdownPost } = this.props;
|
||||
const isUnresolved = (!isResolvingUri && !claim) || !claim;
|
||||
const isBlacklisted = this.isClaimBlackListed();
|
||||
const isPlayingInline =
|
||||
@@ -99,24 +88,9 @@ class ClaimLink extends React.Component<Props> {
|
||||
[INLINE_PLAYER_WRAPPER_CLASS]: isPlayingInline,
|
||||
})}
|
||||
>
|
||||
<EmbedPlayButton
|
||||
uri={uri}
|
||||
parentCommentId={parentCommentId}
|
||||
isMarkdownPost={isMarkdownPost}
|
||||
allowPreview={allowPreview}
|
||||
/>
|
||||
<EmbedPlayButton uri={uri} parentCommentId={parentCommentId} isMarkdownPost={isMarkdownPost} />
|
||||
</div>
|
||||
{(allowPreview || !SIMPLE_SITE) && (
|
||||
<Button button="link" className="preview-link__url" label={uri} navigate={uri} />
|
||||
)}
|
||||
{!allowPreview && SIMPLE_SITE && (
|
||||
<div className="preview-link__unavailable">
|
||||
<p>
|
||||
{__("This channel isn't staking enough LBRY Credits for link previews.")}{' '}
|
||||
<Button button="link" label={__('Learn more')} href="https://odysee.com/@lbry:3f/levelsonodysee:c" />.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<Button button="link" className="preview-link__url" label={uri} navigate={uri} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
@@ -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>,
|
||||
@@ -194,14 +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,
|
||||
} = {
|
||||
page_size: dynamicPageSize,
|
||||
page,
|
||||
@@ -222,10 +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 (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
||||
options.fee_amount = feeAmountParam;
|
||||
}
|
||||
|
||||
@@ -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 =
|
||||
@@ -204,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;
|
||||
}
|
||||
|
||||
@@ -248,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) => ({
|
||||
|
||||
@@ -141,7 +141,7 @@ function ClaimPreviewTile(props: Props) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (placeholder || (!claim && isResolvingUri)) {
|
||||
if (placeholder || isResolvingUri) {
|
||||
return (
|
||||
<li className={classnames('claim-preview--tile', {})}>
|
||||
<div className="placeholder media__thumb" />
|
||||
@@ -182,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,5 +1,4 @@
|
||||
// @flow
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import React from 'react';
|
||||
import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
@@ -28,7 +27,7 @@ type Props = {
|
||||
orderBy?: Array<string>,
|
||||
releaseTime?: string,
|
||||
languages?: Array<string>,
|
||||
claimType?: string | Array<string>,
|
||||
claimType?: Array<string>,
|
||||
timestamp?: string,
|
||||
feeAmount?: string,
|
||||
limitClaimsPerChannel?: number,
|
||||
@@ -70,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,
|
||||
@@ -91,10 +88,6 @@ function ClaimTilesDiscover(props: Props) {
|
||||
order_by: orderBy || ['trending_group', 'trending_mixed'],
|
||||
};
|
||||
|
||||
if (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream')) {
|
||||
options.has_source = true;
|
||||
}
|
||||
|
||||
if (releaseTime) {
|
||||
options.release_time = releaseTime;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectStakedLevelForChannelUri, makeSelectClaimForUri, makeSelectThumbnailForUri, selectMyChannelClaims } from 'lbry-redux';
|
||||
import { makeSelectStakedLevelForChannelUri, makeSelectThumbnailForUri, selectMyChannelClaims } from 'lbry-redux';
|
||||
import { doCommentUpdate } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
@@ -11,7 +11,6 @@ import { selectPlayingUri } from 'redux/selectors/content';
|
||||
import Comment from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state),
|
||||
channelIsBlocked: props.authorUri && makeSelectChannelIsMuted(props.authorUri)(state),
|
||||
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
||||
|
||||
@@ -25,7 +25,6 @@ import UriIndicator from 'component/uriIndicator';
|
||||
type Props = {
|
||||
clearPlayingUri: () => void,
|
||||
uri: string,
|
||||
claim: StreamClaim,
|
||||
author: ?string, // LBRY Channel Name, e.g. @channel
|
||||
authorUri: string, // full LBRY Channel URI: lbry://@channel#123...
|
||||
commentId: string, // sha256 digest identifying the comment
|
||||
@@ -51,7 +50,6 @@ type Props = {
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
playingUri: ?PlayingUri,
|
||||
stakedLevel: number,
|
||||
livestream?: boolean,
|
||||
};
|
||||
|
||||
const LENGTH_TO_COLLAPSE = 300;
|
||||
@@ -60,7 +58,6 @@ const ESCAPE_KEY = 27;
|
||||
function Comment(props: Props) {
|
||||
const {
|
||||
clearPlayingUri,
|
||||
claim,
|
||||
uri,
|
||||
author,
|
||||
authorUri,
|
||||
@@ -80,7 +77,6 @@ function Comment(props: Props) {
|
||||
othersReacts,
|
||||
playingUri,
|
||||
stakedLevel,
|
||||
livestream,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -100,7 +96,6 @@ function Comment(props: Props) {
|
||||
const dislikesCount = (othersReacts && othersReacts.dislike) || 0;
|
||||
const totalLikesAndDislikes = likesCount + dislikesCount;
|
||||
const slimedToDeath = totalLikesAndDislikes >= 5 && dislikesCount / totalLikesAndDislikes > 0.8;
|
||||
const commentByOwnerOfContent = claim && claim.signing_channel && claim.signing_channel.permanent_url === authorUri;
|
||||
|
||||
let channelOwnerOfContent;
|
||||
try {
|
||||
@@ -167,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)}
|
||||
@@ -179,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">
|
||||
@@ -200,22 +187,13 @@ function Comment(props: Props) {
|
||||
{!author ? (
|
||||
<span className="comment__author">{__('Anonymous')}</span>
|
||||
) : (
|
||||
<UriIndicator
|
||||
className={classnames('comment__author', {
|
||||
'comment__author--creator': commentByOwnerOfContent,
|
||||
})}
|
||||
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">
|
||||
@@ -295,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 })),
|
||||
|
||||
@@ -58,10 +58,7 @@ export function CommentCreate(props: Props) {
|
||||
claimIsMine,
|
||||
} = 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();
|
||||
@@ -101,17 +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 (onDoneReplying) {
|
||||
onDoneReplying();
|
||||
@@ -129,17 +127,7 @@ export function CommentCreate(props: Props) {
|
||||
|
||||
if (!hasChannels) {
|
||||
return (
|
||||
<div
|
||||
role="button"
|
||||
onClick={() => {
|
||||
const pathPlusRedirect = `/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`;
|
||||
if (livestream) {
|
||||
window.open(pathPlusRedirect);
|
||||
} else {
|
||||
push(pathPlusRedirect);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div role="button" onClick={() => push(`/$/${PAGES.CHANNEL_NEW}`)}>
|
||||
<FormField
|
||||
type="textarea"
|
||||
name={'comment_signup_prompt'}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -7,7 +7,6 @@ import { v4 as uuid } from 'uuid';
|
||||
type IconProps = {
|
||||
size: number,
|
||||
color: string,
|
||||
title?: string,
|
||||
};
|
||||
|
||||
type CustomProps = {
|
||||
@@ -19,7 +18,7 @@ type CustomProps = {
|
||||
// Icons with tooltips need to use this function so the ref can be properly forwarded
|
||||
const buildIcon = (iconStrokes: React$Node, customSvgValues = {}) =>
|
||||
forwardRef((props: IconProps, ref) => {
|
||||
const { size = 24, color = 'currentColor', title, ...otherProps } = props;
|
||||
const { size = 24, color = 'currentColor', ...otherProps } = props;
|
||||
return (
|
||||
<svg
|
||||
ref={ref}
|
||||
@@ -36,7 +35,6 @@ const buildIcon = (iconStrokes: React$Node, customSvgValues = {}) =>
|
||||
{...customSvgValues}
|
||||
>
|
||||
{iconStrokes}
|
||||
{title && <title>{title}</title>}
|
||||
</svg>
|
||||
);
|
||||
});
|
||||
@@ -1242,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}
|
||||
@@ -1672,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>
|
||||
),
|
||||
};
|
||||
@@ -13,10 +13,7 @@ import defaultSchema from 'hast-util-sanitize/lib/github.json';
|
||||
import { formatedLinks, inlineLinks } from 'util/remark-lbry';
|
||||
import { formattedTimestamp, inlineTimestamp } from 'util/remark-timestamp';
|
||||
import ZoomableImage from 'component/zoomableImage';
|
||||
import { CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS, SIMPLE_SITE } from 'config';
|
||||
import Button from 'component/button';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import { CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS } from 'config';
|
||||
|
||||
type SimpleTextProps = {
|
||||
children?: React.Node,
|
||||
@@ -28,13 +25,6 @@ type SimpleLinkProps = {
|
||||
children?: React.Node,
|
||||
};
|
||||
|
||||
type ImageLinkProps = {
|
||||
src: string,
|
||||
title?: string,
|
||||
alt?: string,
|
||||
helpText?: string,
|
||||
};
|
||||
|
||||
type MarkdownProps = {
|
||||
strip?: boolean,
|
||||
content: ?string,
|
||||
@@ -92,32 +82,6 @@ const SimpleLink = (props: SimpleLinkProps) => {
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
const SimpleImageLink = (props: ImageLinkProps) => {
|
||||
const { src, title, alt, helpText } = props;
|
||||
if (!src) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="preview-link__img--no-preview">
|
||||
<Button
|
||||
button="link"
|
||||
icon={ICONS.IMAGE}
|
||||
iconSize={28}
|
||||
iconRight={ICONS.EXTERNAL}
|
||||
label={title || alt}
|
||||
title={title || alt}
|
||||
className="button--external-link"
|
||||
href={src}
|
||||
/>
|
||||
{helpText && <Icon className="icon--help" icon={ICONS.HELP} tooltip size={24} customTooltipText={helpText} />}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
// Use github sanitation schema
|
||||
const schema = { ...defaultSchema };
|
||||
|
||||
@@ -130,13 +94,6 @@ const REPLACE_REGEX = /(<iframe\s+src=["'])(.*?(?=))(["']\s*><\/iframe>)/g;
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
function isStakeEnoughForPreview(stakedLevel) {
|
||||
return stakedLevel && stakedLevel >= CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS;
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
const MarkdownPreview = (props: MarkdownProps) => {
|
||||
const { content, strip, simpleLinks, noDataStore, className, parentCommentId, isMarkdownPost, stakedLevel } = props;
|
||||
const strippedContent = content
|
||||
@@ -170,23 +127,12 @@ const MarkdownPreview = (props: MarkdownProps) => {
|
||||
parentCommentId={parentCommentId}
|
||||
isMarkdownPost={isMarkdownPost}
|
||||
simpleLinks={simpleLinks}
|
||||
allowPreview={isStakeEnoughForPreview(stakedLevel)}
|
||||
allowPreview={stakedLevel && stakedLevel >= CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS}
|
||||
/>
|
||||
),
|
||||
// Workaraund of remarkOptions.Fragment
|
||||
div: React.Fragment,
|
||||
img: isStakeEnoughForPreview(stakedLevel)
|
||||
? ZoomableImage
|
||||
: (imgProps) => (
|
||||
<SimpleImageLink
|
||||
src={imgProps.src}
|
||||
alt={imgProps.alt}
|
||||
title={imgProps.title}
|
||||
helpText={
|
||||
SIMPLE_SITE ? __("This channel isn't staking enough LBRY Credits for inline image previews.") : ''
|
||||
}
|
||||
/>
|
||||
),
|
||||
img: ZoomableImage,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectDateForUri, SETTINGS } from 'lbry-redux';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { makeSelectDateForUri } from 'lbry-redux';
|
||||
import DateTime from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
date: props.date || makeSelectDateForUri(props.uri)(state),
|
||||
clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state),
|
||||
});
|
||||
export default connect(select)(DateTime);
|
||||
@@ -7,7 +7,6 @@ type Props = {
|
||||
timeAgo?: boolean,
|
||||
formatOptions: {},
|
||||
show?: string,
|
||||
clock24h: boolean,
|
||||
};
|
||||
|
||||
class DateTime extends React.PureComponent<Props> {
|
||||
@@ -46,25 +45,20 @@ class DateTime extends React.PureComponent<Props> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { date, timeAgo, show, clock24h } = this.props;
|
||||
|
||||
let clockFormat = 'hh:mm A';
|
||||
if (clock24h) {
|
||||
clockFormat = 'HH:mm';
|
||||
}
|
||||
const { date, timeAgo, show } = this.props;
|
||||
|
||||
if (timeAgo) {
|
||||
if (!date) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <span title={moment(date).format(`MMMM Do, YYYY ${clockFormat}`)}>{DateTime.getTimeAgoStr(date)}</span>;
|
||||
return <span>{DateTime.getTimeAgoStr(date)}</span>;
|
||||
}
|
||||
|
||||
return (
|
||||
<span>
|
||||
{date && show === DateTime.SHOW_DATE && moment(date).format('MMMM Do, YYYY')}
|
||||
{date && show === DateTime.SHOW_TIME && moment(date).format(clockFormat)}
|
||||
{date && show === DateTime.SHOW_TIME && moment(date).format('hh:mm A')}
|
||||
{!date && '...'}
|
||||
</span>
|
||||
);
|
||||
|
||||
@@ -12,17 +12,16 @@ type Props = {
|
||||
uri: string,
|
||||
thumbnail: string,
|
||||
claim: ?Claim,
|
||||
doResolveUri: (string) => void,
|
||||
doFetchCostInfoForUri: (string) => void,
|
||||
doResolveUri: string => void,
|
||||
doFetchCostInfoForUri: string => void,
|
||||
costInfo: ?{ cost: number },
|
||||
floatingPlayerEnabled: boolean,
|
||||
doPlayUri: (string, ?boolean, ?boolean, (GetResponse) => void) => void,
|
||||
doAnaltyicsPurchaseEvent: (GetResponse) => void,
|
||||
doAnaltyicsPurchaseEvent: GetResponse => void,
|
||||
parentCommentId?: string,
|
||||
isMarkdownPost: boolean,
|
||||
doSetPlayingUri: ({}) => void,
|
||||
renderMode: string,
|
||||
allowPreview?: boolean,
|
||||
};
|
||||
|
||||
export default function EmbedPlayButton(props: Props) {
|
||||
@@ -40,7 +39,6 @@ export default function EmbedPlayButton(props: Props) {
|
||||
parentCommentId,
|
||||
isMarkdownPost,
|
||||
renderMode,
|
||||
allowPreview,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -50,7 +48,7 @@ export default function EmbedPlayButton(props: Props) {
|
||||
const hasResolvedUri = claim !== undefined;
|
||||
const hasCostInfo = costInfo !== undefined;
|
||||
const disabled = !hasResolvedUri || !costInfo;
|
||||
const canPlayInline = [RENDER_MODES.AUDIO, RENDER_MODES.VIDEO].includes(renderMode) && allowPreview;
|
||||
const canPlayInline = [RENDER_MODES.AUDIO, RENDER_MODES.VIDEO].includes(renderMode);
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasResolvedUri) {
|
||||
@@ -71,7 +69,7 @@ export default function EmbedPlayButton(props: Props) {
|
||||
const formattedUrl = formatLbryUrlForWeb(uri);
|
||||
push(formattedUrl);
|
||||
} else {
|
||||
doPlayUri(uri, undefined, undefined, (fileInfo) => {
|
||||
doPlayUri(uri, undefined, undefined, fileInfo => {
|
||||
let playingOptions: PlayingUri = { uri, pathname };
|
||||
if (parentCommentId) {
|
||||
playingOptions.source = 'comment';
|
||||
@@ -86,15 +84,13 @@ export default function EmbedPlayButton(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
const backgroundImage = allowPreview ? `url('${thumbnail.replace(/'/g, "\\'")}')` : '';
|
||||
|
||||
return (
|
||||
<div
|
||||
disabled={disabled}
|
||||
role="button"
|
||||
className="embed__inline-button"
|
||||
onClick={handleClick}
|
||||
style={{ backgroundImage: backgroundImage }}
|
||||
style={{ backgroundImage: `url('${thumbnail.replace(/'/g, "\\'")}')` }}
|
||||
>
|
||||
<FileViewerEmbeddedTitle uri={uri} isInApp />
|
||||
<Button
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
makeSelectClaimForUri,
|
||||
doPrepareEdit,
|
||||
selectMyChannelClaims,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
@@ -22,14 +21,12 @@ 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) => ({
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
prepareEdit: (publishData, uri, fileInfo) => {
|
||||
if (publishData.signing_channel) {
|
||||
dispatch(doSetIncognito(false));
|
||||
dispatch(doSetActiveChannel(publishData.signing_channel.claim_id));
|
||||
} else {
|
||||
dispatch(doSetIncognito(true));
|
||||
|
||||
@@ -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,7 +25,6 @@ type Props = {
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
doToast: ({ message: string }) => void,
|
||||
clearPlayingUri: () => void,
|
||||
isLivestreamClaim: boolean,
|
||||
};
|
||||
|
||||
function FileActions(props: Props) {
|
||||
@@ -42,7 +40,6 @@ function FileActions(props: Props) {
|
||||
myChannels,
|
||||
clearPlayingUri,
|
||||
doToast,
|
||||
isLivestreamClaim,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -115,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);
|
||||
}}
|
||||
|
||||
@@ -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,11 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectFileInfoForUri,
|
||||
makeSelectTitleForUri,
|
||||
makeSelectStreamingUrlForUri,
|
||||
makeSelectClaimIsNsfw,
|
||||
SETTINGS,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectFileInfoForUri, makeSelectTitleForUri, makeSelectStreamingUrlForUri, SETTINGS } from 'lbry-redux';
|
||||
import {
|
||||
makeSelectIsPlayerFloating,
|
||||
selectPrimaryUri,
|
||||
@@ -14,7 +8,6 @@ import {
|
||||
} from 'redux/selectors/content';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import { doFetchRecommendedContent } from 'redux/actions/search';
|
||||
import { withRouter } from 'react-router';
|
||||
import FileRenderFloating from './view';
|
||||
|
||||
@@ -29,7 +22,6 @@ const select = (state, props) => {
|
||||
playingUri,
|
||||
title: makeSelectTitleForUri(uri)(state),
|
||||
fileInfo: makeSelectFileInfoForUri(uri)(state),
|
||||
mature: makeSelectClaimIsNsfw(props.uri)(state),
|
||||
isFloating: makeSelectIsPlayerFloating(props.location)(state),
|
||||
streamingUrl: makeSelectStreamingUrlForUri(uri)(state),
|
||||
floatingPlayerEnabled: makeSelectClientSetting(SETTINGS.FLOATING_PLAYER)(state),
|
||||
@@ -38,9 +30,8 @@ const select = (state, props) => {
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
const perform = dispatch => ({
|
||||
closeFloatingPlayer: () => dispatch(doSetPlayingUri({ uri: null })),
|
||||
doFetchRecommendedContent: (uri, mature) => dispatch(doFetchRecommendedContent(uri, mature)),
|
||||
});
|
||||
|
||||
export default withRouter(connect(select, perform)(FileRenderFloating));
|
||||
@@ -22,7 +22,6 @@ export const INLINE_PLAYER_WRAPPER_CLASS = 'inline-player__wrapper';
|
||||
type Props = {
|
||||
isFloating: boolean,
|
||||
fileInfo: FileListItem,
|
||||
mature: boolean,
|
||||
uri: string,
|
||||
streamingUrl?: string,
|
||||
title: ?string,
|
||||
@@ -32,13 +31,11 @@ type Props = {
|
||||
playingUri: ?PlayingUri,
|
||||
primaryUri: ?string,
|
||||
videoTheaterMode: boolean,
|
||||
doFetchRecommendedContent: (string, boolean) => void,
|
||||
};
|
||||
|
||||
export default function FileRenderFloating(props: Props) {
|
||||
const {
|
||||
fileInfo,
|
||||
mature,
|
||||
uri,
|
||||
streamingUrl,
|
||||
title,
|
||||
@@ -49,7 +46,6 @@ export default function FileRenderFloating(props: Props) {
|
||||
playingUri,
|
||||
primaryUri,
|
||||
videoTheaterMode,
|
||||
doFetchRecommendedContent,
|
||||
} = props;
|
||||
const {
|
||||
location: { pathname },
|
||||
@@ -205,12 +201,6 @@ export default function FileRenderFloating(props: Props) {
|
||||
};
|
||||
}, [uri]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isFloating) {
|
||||
doFetchRecommendedContent(uri, mature);
|
||||
}
|
||||
}, [uri, mature, isFloating]);
|
||||
|
||||
if (!isPlayable || !uri || (isFloating && (isMobile || !floatingPlayerEnabled))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectFileInfoForUri, makeSelectStreamingUrlForUri } from 'lbry-redux';
|
||||
import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards';
|
||||
import { makeSelectFileRenderModeForUri, selectPrimaryUri } from 'redux/selectors/content';
|
||||
import { makeSelectFileRenderModeForUri, makeSelectIsPlaying } from 'redux/selectors/content';
|
||||
import { withRouter } from 'react-router';
|
||||
import { doAnalyticsView } from 'redux/actions/app';
|
||||
import FileRenderInline from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||
isPlaying: selectPrimaryUri(state) === props.uri,
|
||||
isPlaying: makeSelectIsPlaying(props.uri)(state),
|
||||
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
|
||||
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
@@ -6,23 +6,16 @@ import FileActions from 'component/fileActions';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
livestream?: boolean,
|
||||
activeViewers?: number,
|
||||
stateOfViewers: string,
|
||||
};
|
||||
|
||||
function FileSubtitle(props: Props) {
|
||||
const { uri, livestream = false, activeViewers = 0, stateOfViewers } = 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 %viewer_state%', { viewer_count: activeViewers, viewer_state: stateOfViewers })}</span>
|
||||
) : (
|
||||
<FileViewCount uri={uri} />
|
||||
)}
|
||||
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
|
||||
<FileViewCount uri={uri} />
|
||||
</div>
|
||||
|
||||
<FileActions uri={uri} />
|
||||
|
||||
@@ -12,89 +12,65 @@ import I18nMessage from 'component/i18nMessage';
|
||||
import Button from 'component/button';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import FileDescription from 'component/fileDescription';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
title: string,
|
||||
nsfw: boolean,
|
||||
isNsfwBlocked: boolean,
|
||||
livestream?: boolean,
|
||||
activeViewers?: number,
|
||||
stateOfViewers: string,
|
||||
};
|
||||
|
||||
function FileTitleSection(props: Props) {
|
||||
const { title, uri, nsfw, isNsfwBlocked, livestream = false, activeViewers, stateOfViewers } = props;
|
||||
const [hasAcknowledgedSec, setHasAcknowledgedSec] = usePersistedState('sec-nag', false);
|
||||
const { title, uri, nsfw, isNsfwBlocked } = props;
|
||||
|
||||
return (
|
||||
<>
|
||||
{!hasAcknowledgedSec && (
|
||||
<div className="notice-message">
|
||||
<Button button="close" icon={ICONS.REMOVE} onClick={() => setHasAcknowledgedSec(true)} />
|
||||
<h1 className="section__title">{__('Help LBRY Save Crypto')}</h1>
|
||||
<p className="section__subtitle">
|
||||
{__(
|
||||
'The US government is attempting to destroy the cryptocurrency industry. Can you help?'
|
||||
)}{' '}
|
||||
<Button label={__('Learn more and sign petition')} button="link" href="https://helplbrysavecrypto.com" />
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<Card
|
||||
isPageTitle
|
||||
noTitleWrap
|
||||
title={
|
||||
<React.Fragment>
|
||||
{title}
|
||||
{nsfw && (
|
||||
<span className="media__title-badge">
|
||||
<span className="badge badge--tag-mature">{__('Mature')}</span>
|
||||
</span>
|
||||
)}
|
||||
</React.Fragment>
|
||||
}
|
||||
titleActions={<FilePrice uri={normalizeURI(uri)} type="filepage" />}
|
||||
body={
|
||||
<React.Fragment>
|
||||
<ClaimInsufficientCredits uri={uri} />
|
||||
<FileSubtitle
|
||||
uri={uri}
|
||||
livestream={livestream}
|
||||
activeViewers={activeViewers}
|
||||
stateOfViewers={stateOfViewers}
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
isNsfwBlocked ? (
|
||||
<div className="main--empty">
|
||||
<h2>
|
||||
<Icon className="icon--hidden" icon={ICONS.EYE_OFF} />
|
||||
{__('Mature content blocked.')}
|
||||
</h2>
|
||||
<div>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
content_settings: (
|
||||
<Button button="link" label={__('content settings')} navigate={`/$/${PAGES.SETTINGS}`} />
|
||||
),
|
||||
}}
|
||||
>
|
||||
Change this in your %content_settings%.
|
||||
</I18nMessage>
|
||||
</div>
|
||||
<Card
|
||||
isPageTitle
|
||||
noTitleWrap
|
||||
title={
|
||||
<React.Fragment>
|
||||
{title}
|
||||
{nsfw && (
|
||||
<span className="media__title-badge">
|
||||
<span className="badge badge--tag-mature">{__('Mature')}</span>
|
||||
</span>
|
||||
)}
|
||||
</React.Fragment>
|
||||
}
|
||||
titleActions={<FilePrice uri={normalizeURI(uri)} type="filepage" />}
|
||||
body={
|
||||
<React.Fragment>
|
||||
<ClaimInsufficientCredits uri={uri} />
|
||||
<FileSubtitle uri={uri} />
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
isNsfwBlocked ? (
|
||||
<div className="main--empty">
|
||||
<h2>
|
||||
<Icon className="icon--hidden" icon={ICONS.EYE_OFF} />
|
||||
{__('Mature content blocked.')}
|
||||
</h2>
|
||||
<div>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
content_settings: (
|
||||
<Button button="link" label={__('content settings')} navigate={`/$/${PAGES.SETTINGS}`} />
|
||||
),
|
||||
}}
|
||||
>
|
||||
Change this in your %content_settings%.
|
||||
</I18nMessage>
|
||||
</div>
|
||||
) : (
|
||||
<div className="section">
|
||||
<FileAuthor uri={uri} />
|
||||
<FileDescription uri={uri} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
</div>
|
||||
) : (
|
||||
<div className="section">
|
||||
<FileAuthor uri={uri} />
|
||||
<FileDescription uri={uri} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 });
|
||||
}}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
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';
|
||||
@@ -99,7 +99,7 @@ const Header = (props: Props) => {
|
||||
const hasBackout = Boolean(backout);
|
||||
const { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
|
||||
const notificationsEnabled = (user && user.experimental_ui) || false;
|
||||
const livestreamEnabled = (ENABLE_NO_SOURCE_CLAIMS && 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
|
||||
@@ -276,6 +276,10 @@ const Header = (props: Props) => {
|
||||
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">
|
||||
@@ -426,12 +445,14 @@ function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
||||
{__('New 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>
|
||||
)}
|
||||
@@ -453,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, 75),
|
||||
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,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,47 +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}
|
||||
stateOfViewers={isLive ? __('watching') : __('waiting')}
|
||||
/>
|
||||
<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.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" />;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
import { KNOWN_APP_DOMAINS } from 'config';
|
||||
import { KNOWN_APP_DOMAINS, SIMPLE_SITE } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as React from 'react';
|
||||
import { isURIValid } from 'lbry-redux';
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -98,16 +95,25 @@ function MarkdownLink(props: Props) {
|
||||
/>
|
||||
);
|
||||
} else if (!simpleLinks && ((protocol && protocol[0] === 'lbry:' && isURIValid(decodedUri)) || lbryUrlFromLink)) {
|
||||
element = (
|
||||
element = allowPreview ? (
|
||||
<ClaimLink
|
||||
uri={lbryUrlFromLink || decodedUri}
|
||||
autoEmbed={embed}
|
||||
parentCommentId={parentCommentId}
|
||||
isMarkdownPost={isMarkdownPost}
|
||||
allowPreview={allowPreview}
|
||||
>
|
||||
{children}
|
||||
</ClaimLink>
|
||||
) : (
|
||||
<Button
|
||||
button="link"
|
||||
iconRight={isLbryLink ? undefined : ICONS.EXTERNAL}
|
||||
title={SIMPLE_SITE ? __("This channel isn't staking enough LBRY Credits for link previews.") : children}
|
||||
label={children}
|
||||
className="button--external-link"
|
||||
navigate={isLbryLink ? href : undefined}
|
||||
href={isLbryLink ? undefined : href}
|
||||
/>
|
||||
);
|
||||
} else if (
|
||||
simpleLinks ||
|
||||
|
||||
@@ -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,16 +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, user } = props;
|
||||
const { unreadCount, inline = false, user } = props;
|
||||
const notificationsEnabled = user && user.experimental_ui;
|
||||
|
||||
if (unseenCount === 0 || !notificationsEnabled) {
|
||||
if (unreadCount === 0 || !notificationsEnabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -24,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>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -356,7 +357,7 @@ function PublishFile(props: Props) {
|
||||
value={title}
|
||||
onChange={handleTitleChange}
|
||||
/>
|
||||
{isPublishFile && (
|
||||
{(isPublishFile || isPublishLivestream) && (
|
||||
<FileSelector
|
||||
label={__('File')}
|
||||
disabled={disabled}
|
||||
@@ -365,6 +366,13 @@ function PublishFile(props: Props) {
|
||||
/>
|
||||
)}
|
||||
|
||||
{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
|
||||
label={__('Post --[noun, markdown post tab button]--')}
|
||||
|
||||
@@ -18,11 +18,9 @@ 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
|
||||
@@ -38,14 +36,14 @@ const select = (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,18 +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}
|
||||
@@ -434,14 +359,13 @@ function PublishForm(props: Props) {
|
||||
setPrevFileText={setPrevFileText}
|
||||
header={
|
||||
<>
|
||||
{MODES.map((modeName) => (
|
||||
{MODES.map((modeName, index) => (
|
||||
<Button
|
||||
key={String(modeName)}
|
||||
key={index}
|
||||
icon={modeName}
|
||||
label={__(MODE_TO_I18N_STR[String(modeName)] || '---')}
|
||||
button="alt"
|
||||
onClick={() => {
|
||||
// $FlowFixMe
|
||||
setMode(modeName);
|
||||
}}
|
||||
className={classnames('button-toggle', { 'button-toggle--active': mode === modeName })}
|
||||
@@ -456,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) => {
|
||||
@@ -483,7 +407,7 @@ function PublishForm(props: Props) {
|
||||
/>
|
||||
|
||||
<PublishBid disabled={isStillEditing || formDisabled} />
|
||||
{!isLivestream && <PublishPrice disabled={formDisabled} />}
|
||||
<PublishPrice disabled={formDisabled} />
|
||||
<PublishAdditionalOptions disabled={formDisabled} />
|
||||
</div>
|
||||
)}
|
||||
@@ -501,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 ? (
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimIsNsfw } from 'lbry-redux';
|
||||
import { doFetchRecommendedContent } from 'redux/actions/search';
|
||||
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) => ({
|
||||
doFetchRecommendedContent: (uri, mature) => dispatch(doFetchRecommendedContent(uri, mature)),
|
||||
const perform = dispatch => ({
|
||||
search: (query, options) => dispatch(doSearch(query, options)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RecommendedVideos);
|
||||
@@ -6,48 +6,46 @@ import Ads from 'web/component/ads';
|
||||
import Card from 'component/common/card';
|
||||
import { useIsMobile, useIsMediumScreen } from 'effects/use-screensize';
|
||||
|
||||
type Options = {
|
||||
related_to: string,
|
||||
nsfw?: boolean,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?StreamClaim,
|
||||
recommendedContent: Array<string>,
|
||||
nextRecommendedUri: string,
|
||||
isSearching: boolean,
|
||||
doFetchRecommendedContent: (string, boolean) => void,
|
||||
search: (string, Options) => void,
|
||||
mature: boolean,
|
||||
isAuthenticated: boolean,
|
||||
};
|
||||
|
||||
export default function RecommendedContent(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
doFetchRecommendedContent,
|
||||
mature,
|
||||
recommendedContent,
|
||||
nextRecommendedUri,
|
||||
isSearching,
|
||||
isAuthenticated,
|
||||
} = props;
|
||||
const { uri, claim, search, mature, recommendedContent, isSearching, isAuthenticated } = props;
|
||||
const isMobile = useIsMobile();
|
||||
const isMedium = useIsMediumScreen();
|
||||
|
||||
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;
|
||||
const stringifiedClaim = JSON.stringify(claim);
|
||||
const getRecommendedContent = React.useCallback(() => {
|
||||
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 };
|
||||
if (jsonClaim && !mature) {
|
||||
options['nsfw'] = false;
|
||||
}
|
||||
const { title } = jsonClaim.value;
|
||||
if (title && options) {
|
||||
search(title, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
}, [stringifiedClaim, mature]);
|
||||
|
||||
React.useEffect(() => {
|
||||
doFetchRecommendedContent(uri, mature);
|
||||
}, [uri, mature, doFetchRecommendedContent]);
|
||||
getRecommendedContent();
|
||||
}, [uri]);
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -59,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, {
|
||||
|
||||
@@ -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) || '';
|
||||
@@ -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();
|
||||
|
||||
@@ -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.')}
|
||||
|
||||
+147
-138
@@ -1,58 +1,62 @@
|
||||
// @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, SIMPLE_SITE } from 'config';
|
||||
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) {
|
||||
@@ -92,9 +96,12 @@ type PrivateRouteProps = Props & {
|
||||
};
|
||||
|
||||
function PrivateRoute(props: PrivateRouteProps) {
|
||||
const { component: Component, isAuthenticated, ...rest } = props;
|
||||
const urlSearchParams = new URLSearchParams(props.location.search);
|
||||
const redirectUrl = urlSearchParams.get('redirect');
|
||||
const {
|
||||
component: Component,
|
||||
isAuthenticated,
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<Route
|
||||
{...rest}
|
||||
@@ -102,7 +109,7 @@ function PrivateRoute(props: PrivateRouteProps) {
|
||||
isAuthenticated || !IS_WEB ? (
|
||||
<Component {...props} />
|
||||
) : (
|
||||
<Redirect to={`/$/${PAGES.AUTH}?redirect=${redirectUrl || props.location.pathname}`} />
|
||||
<Redirect to={`/$/${PAGES.AUTH}?redirect=${props.location.pathname}`} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
@@ -124,7 +131,8 @@ function AppRouter(props: Props) {
|
||||
setReferrer,
|
||||
homepageData,
|
||||
} = props;
|
||||
const { entries, listen, action: historyAction } = history;
|
||||
|
||||
const { entries } = history;
|
||||
const entryIndex = history.index;
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const resetScroll = urlParams.get('reset_scroll');
|
||||
@@ -136,13 +144,13 @@ function AppRouter(props: Props) {
|
||||
|
||||
// For people arriving at settings page from deeplinks, know whether they can "go back"
|
||||
useEffect(() => {
|
||||
const unlisten = listen((location, action) => {
|
||||
const unlisten = history.listen((location, action) => {
|
||||
if (action === 'PUSH') {
|
||||
if (!hasNavigated && setHasNavigated) setHasNavigated();
|
||||
}
|
||||
});
|
||||
return unlisten;
|
||||
}, [listen, hasNavigated, setHasNavigated]);
|
||||
}, [hasNavigated, setHasNavigated]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasNavigated && hasUnclaimedRefereeReward && !isAuthenticated) {
|
||||
@@ -158,7 +166,7 @@ function AppRouter(props: Props) {
|
||||
if (uri) {
|
||||
const { channelName, streamName } = parseURI(uri);
|
||||
|
||||
if (title) {
|
||||
if (typeof title !== 'undefined' && title !== '') {
|
||||
document.title = title;
|
||||
} else if (streamName) {
|
||||
document.title = streamName;
|
||||
@@ -181,7 +189,7 @@ function AppRouter(props: Props) {
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasLinkedCommentInUrl) {
|
||||
if (hash && historyAction === 'PUSH') {
|
||||
if (hash && history.action === 'PUSH') {
|
||||
const id = hash.replace('#', '');
|
||||
const element = document.getElementById(id);
|
||||
if (element) {
|
||||
@@ -191,7 +199,7 @@ function AppRouter(props: Props) {
|
||||
window.scrollTo(0, currentScroll);
|
||||
}
|
||||
}
|
||||
}, [currentScroll, pathname, search, hash, resetScroll, hasLinkedCommentInUrl, historyAction]);
|
||||
}, [currentScroll, pathname, search, hash, resetScroll, hasLinkedCommentInUrl]);
|
||||
|
||||
// react-router doesn't decode pathanmes before doing the route matching check
|
||||
// We have to redirect here because if we redirect on the server, it might get encoded again
|
||||
@@ -202,95 +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} />
|
||||
{SIMPLE_SITE && <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} />
|
||||
{/* 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>
|
||||
<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} />
|
||||
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ export default function SearchTopClaim(props: Props) {
|
||||
),
|
||||
publish: (
|
||||
<span>
|
||||
<Button button="link" onClick={() => beginPublish(name)} label={__('publish')} />
|
||||
<Button button="link" onClick={() => beginPublish(name)} label={'publish'} />
|
||||
</span>
|
||||
),
|
||||
}}
|
||||
|
||||
@@ -8,9 +8,9 @@ import { getDefaultLanguage } from 'util/default-languages';
|
||||
|
||||
type Props = {
|
||||
language: string,
|
||||
setLanguage: (string) => void,
|
||||
setLanguage: string => void,
|
||||
searchInLanguage: boolean,
|
||||
setSearchInLanguage: (boolean) => void,
|
||||
setSearchInLanguage: boolean => void,
|
||||
};
|
||||
|
||||
function SettingLanguage(props: Props) {
|
||||
@@ -41,23 +41,11 @@ function SettingLanguage(props: Props) {
|
||||
'Multi-language support is brand new and incomplete. Switching your language may have unintended consequences, like glossolalia.'
|
||||
)}
|
||||
>
|
||||
{Object.entries(languages)
|
||||
.sort((a, b) => {
|
||||
const lhs = String(a[1]);
|
||||
const rhs = String(b[1]);
|
||||
if (lhs < rhs) return -1;
|
||||
if (lhs > rhs) return 1;
|
||||
return 0;
|
||||
})
|
||||
.map((language) => {
|
||||
const langKey = language[0];
|
||||
const langName = String(language[1]);
|
||||
return (
|
||||
<option key={langKey} value={langKey}>
|
||||
{langName}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
{Object.keys(languages).map(language => (
|
||||
<option key={language} value={language}>
|
||||
{languages[language]}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
{previousLanguage && <Spinner type="small" />}
|
||||
<FormField
|
||||
|
||||
@@ -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,
|
||||
@@ -69,7 +69,7 @@ function SideNavigation(props: Props) {
|
||||
setSidebarOpen,
|
||||
isMediumScreen,
|
||||
isOnFilePage,
|
||||
unseenCount,
|
||||
unreadCount,
|
||||
homepageData,
|
||||
user,
|
||||
} = props;
|
||||
@@ -232,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;
|
||||
}
|
||||
@@ -271,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">
|
||||
@@ -321,7 +320,7 @@ 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 : (
|
||||
@@ -335,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"
|
||||
/>
|
||||
@@ -387,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 : (
|
||||
@@ -400,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"
|
||||
/>
|
||||
@@ -410,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
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -17,8 +17,6 @@ type Props = {
|
||||
// to allow for other elements to be nested within the UriIndicator
|
||||
children: ?Node,
|
||||
inline: boolean,
|
||||
external?: boolean,
|
||||
className?: string,
|
||||
};
|
||||
|
||||
class UriIndicator extends React.PureComponent<Props> {
|
||||
@@ -39,16 +37,7 @@ class UriIndicator extends React.PureComponent<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
link,
|
||||
isResolvingUri,
|
||||
claim,
|
||||
children,
|
||||
inline,
|
||||
hideAnonymous = false,
|
||||
external = false,
|
||||
className,
|
||||
} = this.props;
|
||||
const { link, isResolvingUri, claim, children, inline, hideAnonymous = false } = this.props;
|
||||
|
||||
if (!claim) {
|
||||
return <span className="empty">{isResolvingUri ? 'Validating...' : 'Unused'}</span>;
|
||||
@@ -62,7 +51,7 @@ class UriIndicator extends React.PureComponent<Props> {
|
||||
}
|
||||
|
||||
return (
|
||||
<span dir="auto" className={classnames('channel-name', className, { 'channel-name--inline': inline })}>
|
||||
<span dir="auto" className={classnames('channel-name', { 'channel-name--inline': inline })}>
|
||||
Anonymous
|
||||
</span>
|
||||
);
|
||||
@@ -85,18 +74,10 @@ class UriIndicator extends React.PureComponent<Props> {
|
||||
}
|
||||
|
||||
if (children) {
|
||||
return (
|
||||
<Button className={className} target={external ? '_blank' : undefined} navigate={channelLink}>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
return <Button navigate={channelLink}>{children}</Button>;
|
||||
} else {
|
||||
return (
|
||||
<Button
|
||||
className={classnames(className, 'button--uri-indicator')}
|
||||
navigate={channelLink}
|
||||
target={external ? '_blank' : undefined}
|
||||
>
|
||||
<Button className="button--uri-indicator" navigate={channelLink}>
|
||||
{inner}
|
||||
</Button>
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
@@ -103,7 +98,7 @@ function UserEmailNew(props: Props) {
|
||||
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>
|
||||
}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -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,
|
||||
@@ -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')) {
|
||||
@@ -345,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();
|
||||
}
|
||||
|
||||
@@ -362,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) {
|
||||
@@ -388,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)
|
||||
@@ -485,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);
|
||||
@@ -509,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,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -76,7 +76,6 @@ function VideoViewer(props: Props) {
|
||||
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 */
|
||||
@@ -94,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);
|
||||
});
|
||||
@@ -146,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) {
|
||||
@@ -165,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);
|
||||
});
|
||||
@@ -184,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);
|
||||
@@ -199,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);
|
||||
}
|
||||
@@ -212,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 />
|
||||
</>
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import { connect } from 'react-redux';
|
||||
import { selectLanguage, selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { selectLanguage, makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { doSearch } from 'redux/actions/search';
|
||||
import { doOpenModal, doHideModal } from 'redux/actions/app';
|
||||
import { withRouter } from 'react-router';
|
||||
import { doResolveUris } from 'lbry-redux';
|
||||
import { doResolveUris, SETTINGS } from 'lbry-redux';
|
||||
import analytics from 'analytics';
|
||||
import Wunderbar from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
language: selectLanguage(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
showMature: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch, ownProps) => ({
|
||||
doResolveUris: (uris) => dispatch(doResolveUris(uris)),
|
||||
doResolveUris: uris => dispatch(doResolveUris(uris)),
|
||||
doSearch: (query, options) => dispatch(doSearch(query, options)),
|
||||
navigateToSearchPage: (query) => {
|
||||
navigateToSearchPage: query => {
|
||||
let encodedQuery = encodeURIComponent(query);
|
||||
ownProps.history.push({ pathname: `/$/search`, search: `?q=${encodedQuery}` });
|
||||
analytics.apiLogSearch();
|
||||
},
|
||||
doShowSnackBar: (message) => dispatch(doToast({ isError: true, message })),
|
||||
doShowSnackBar: message => dispatch(doToast({ isError: true, message })),
|
||||
doOpenMobileSearch: () => dispatch(doOpenModal(MODALS.MOBILE_SEARCH)),
|
||||
doCloseMobileSearch: () => dispatch(doHideModal()),
|
||||
});
|
||||
|
||||
@@ -219,8 +219,6 @@ export default function YoutubeTransferStatus(props: Props) {
|
||||
{youtubeChannels.length > 1
|
||||
? __('You will be able to claim your channels once they finish syncing.')
|
||||
: __('You will be able to claim your channel once it has finished syncing.')}{' '}
|
||||
{youtubeImportPending &&
|
||||
__('You will not be able to edit the channel or content until the transfer process completes.')}{' '}
|
||||
<Button button="link" label={__('Learn More')} href="https://lbry.com/faq/youtube#transfer" />{' '}
|
||||
{addNewChannel && <Button button="link" label={__('Add Another Channel')} onClick={addNewChannel} />}
|
||||
</p>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export const FF_MAX_CHARS_DEFAULT = 2000;
|
||||
export const FF_MAX_CHARS_IN_COMMENT = 2000;
|
||||
export const FF_MAX_CHARS_IN_DESCRIPTION = 5000;
|
||||
export const FF_MAX_CHARS_IN_POST = 10000;
|
||||
@@ -97,6 +97,7 @@ export const MORE_VERTICAL = 'MoreVertical';
|
||||
export const IMAGE = 'Image';
|
||||
export const AUDIO = 'HeadPhones';
|
||||
export const VIDEO = 'Video';
|
||||
export const LIVESTREAM = 'Livestream';
|
||||
export const VOLUME_MUTED = 'VolumeX';
|
||||
export const TEXT = 'FileText';
|
||||
export const DOWNLOADABLE = 'Downloadable';
|
||||
@@ -150,6 +151,3 @@ export const UNIVERSE = 'Universe';
|
||||
export const CHEESE = 'Cheese';
|
||||
export const PEACE = 'Peace';
|
||||
export const PORK_BUN = 'PorkBun';
|
||||
export const LIVESTREAM = 'Livestream';
|
||||
export const LIVESTREAM_SOLID = 'LivestreamSolid';
|
||||
export const LIVESTREAM_MONOCHROME = 'LivestreamMono';
|
||||
@@ -0,0 +1,6 @@
|
||||
const LANGUAGE_MIGRATIONS = {
|
||||
'zh-CN': 'zh-Hans',
|
||||
'zh-TW': 'zh-Hant',
|
||||
};
|
||||
|
||||
export default LANGUAGE_MIGRATIONS;
|
||||
@@ -43,7 +43,6 @@ const LANGUAGES = {
|
||||
fa: ['Persian', 'فارسی'],
|
||||
ff: ['Peul', 'Fulfulde'],
|
||||
fi: ['Finnish', 'Suomi'],
|
||||
fil: ['Filipino', 'Filipino'],
|
||||
fj: ['Fijian', 'Na Vosa Vakaviti'],
|
||||
fo: ['Faroese', 'Føroyskt'],
|
||||
fr: ['French', 'Français'],
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
export const BITWAVE_EMBED_URL = 'https://bitwave.tv/odysee';
|
||||
export const BITWAVE_API = 'https://api.bitwave.tv/v1/odysee/live';
|
||||
export const LIVE_STREAM_TAG = 'odysee-livestream';
|
||||
|
||||
export const BITWAVE_EMBED_URL = 'https://bitwave.tv/embed';
|
||||
export const BITWAVE_API = 'https://api.bitwave.tv/v1/channels';
|
||||
@@ -7,18 +7,6 @@ exports.AUTH_WALLET_PASSWORD = 'walletpassword';
|
||||
exports.BACKUP = 'backup';
|
||||
exports.CHANNEL = 'channel';
|
||||
exports.DISCOVER = 'discover';
|
||||
exports.BIG_HITS = 'big_hits';
|
||||
exports.COMMUNITY = 'community';
|
||||
exports.ENLIGHTENMENT = 'enlightenment';
|
||||
exports.FINANCE = 'finance';
|
||||
exports.GAMING = 'gaming';
|
||||
exports.GENERAL = 'general';
|
||||
exports.LAB = 'lab';
|
||||
exports.NEWS = 'news';
|
||||
exports.RABBIT_HOLE = 'rabbithole';
|
||||
exports.SCIENCE = 'science';
|
||||
exports.TECHNOLOGY = 'technology';
|
||||
exports.WILD_WEST = 'wildwest';
|
||||
exports.HOME = 'home';
|
||||
exports.HELP = 'help';
|
||||
exports.LIBRARY = 'library';
|
||||
|
||||
@@ -13,7 +13,6 @@ export const INSTANT_PURCHASE_MAX = 'instant_purchase_max';
|
||||
export const THEME = 'theme';
|
||||
export const THEMES = 'themes';
|
||||
export const AUTOMATIC_DARK_MODE_ENABLED = 'automatic_dark_mode_enabled';
|
||||
export const CLOCK_24H = 'clock_24h';
|
||||
export const AUTOPLAY = 'autoplay';
|
||||
export const OS_NOTIFICATIONS_ENABLED = 'os_notifications_enabled';
|
||||
export const AUTO_DOWNLOAD = 'auto_download';
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
const SUPPORTED_BROWSER_LANGUAGES = {
|
||||
en: 'en',
|
||||
da: 'da',
|
||||
'zh-CN': 'zh-Hans',
|
||||
'zh-TW': 'zh-Hant',
|
||||
'zh-Hans': 'zh-Hans',
|
||||
'zh-Hant': 'zh-Hant',
|
||||
hr: 'hr',
|
||||
nl: 'nl',
|
||||
no: 'no',
|
||||
fi: 'fi',
|
||||
fr: 'fr',
|
||||
de: 'de',
|
||||
gu: 'gu',
|
||||
hi: 'hi',
|
||||
id: 'id',
|
||||
jv: 'jv',
|
||||
it: 'it',
|
||||
ms: 'ms',
|
||||
ml: 'ml',
|
||||
mr: 'mr',
|
||||
pa: 'pa',
|
||||
pl: 'pl',
|
||||
pt: 'pt',
|
||||
ro: 'ro',
|
||||
ru: 'ru',
|
||||
sr: 'sr',
|
||||
sk: 'sk',
|
||||
ur: 'ur',
|
||||
ca: 'ca',
|
||||
es: 'es',
|
||||
sv: 'sv',
|
||||
tr: 'tr',
|
||||
cs: 'cs',
|
||||
kn: 'kn',
|
||||
uk: 'uk',
|
||||
};
|
||||
|
||||
export default SUPPORTED_BROWSER_LANGUAGES;
|
||||
@@ -1,7 +1,6 @@
|
||||
import LANGUAGES from './languages';
|
||||
|
||||
// supported_browser_languages
|
||||
const SUPPORTED_LANGUAGES = {
|
||||
af: LANGUAGES.af[1],
|
||||
en: LANGUAGES.en[1],
|
||||
da: LANGUAGES.da[1],
|
||||
'zh-Hans': LANGUAGES['zh-Hans'][1],
|
||||
@@ -10,13 +9,11 @@ const SUPPORTED_LANGUAGES = {
|
||||
nl: LANGUAGES.nl[1],
|
||||
no: LANGUAGES.no[1],
|
||||
fi: LANGUAGES.fi[1],
|
||||
fil: LANGUAGES.fil[1],
|
||||
fr: LANGUAGES.fr[1],
|
||||
de: LANGUAGES.de[1],
|
||||
gu: LANGUAGES.gu[1],
|
||||
hi: LANGUAGES.hi[1],
|
||||
id: LANGUAGES.id[1],
|
||||
ja: LANGUAGES.ja[1],
|
||||
jv: LANGUAGES.jv[1],
|
||||
it: LANGUAGES.it[1],
|
||||
ms: LANGUAGES.ms[1],
|
||||
@@ -29,7 +26,6 @@ const SUPPORTED_LANGUAGES = {
|
||||
ru: LANGUAGES.ru[1],
|
||||
sr: LANGUAGES.sr[1],
|
||||
sk: LANGUAGES.sk[1],
|
||||
th: LANGUAGES.th[1],
|
||||
ur: LANGUAGES.ur[1],
|
||||
ca: LANGUAGES.ca[1],
|
||||
es: LANGUAGES.es[1],
|
||||
@@ -38,7 +34,6 @@ const SUPPORTED_LANGUAGES = {
|
||||
cs: LANGUAGES.cs[1],
|
||||
kn: LANGUAGES.kn[1],
|
||||
uk: LANGUAGES.uk[1],
|
||||
vi: LANGUAGES.vi[1],
|
||||
};
|
||||
|
||||
// Properties: language code (e.g. 'ja')
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// https://www.electronjs.org/docs/api/locales
|
||||
|
||||
export const SUB_LANG_CODE_LEN = 5;
|
||||
|
||||
export const SUPPORTED_SUB_LANGUAGE_CODES = [
|
||||
'zh-CN',
|
||||
'zh-TW',
|
||||
];
|
||||
+5
-8
@@ -1,5 +1,3 @@
|
||||
import { getDefaultLanguage, resolveLanguageAlias } from './util/default-languages';
|
||||
|
||||
// @if TARGET='app'
|
||||
let fs = require('fs');
|
||||
// @endif
|
||||
@@ -33,7 +31,7 @@ function saveMessageDesktop(message) {
|
||||
knownMessages[message] = removeContextMetadata(message);
|
||||
knownMessages[END] = END;
|
||||
|
||||
fs.writeFile(messagesFilePath, JSON.stringify(knownMessages, null, 2) + '\n', 'utf-8', (err) => {
|
||||
fs.writeFile(messagesFilePath, JSON.stringify(knownMessages, null, 2) + '\n', 'utf-8', err => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
@@ -85,10 +83,9 @@ export function __(message, tokens) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const language = resolveLanguageAlias(
|
||||
localStorageAvailable ? window.localStorage.getItem('language') || 'en' : getDefaultLanguage() || 'en'
|
||||
);
|
||||
|
||||
const language = localStorageAvailable
|
||||
? window.localStorage.getItem('language') || 'en'
|
||||
: window.navigator.language.slice(0, 2) || 'en';
|
||||
if (!isProduction) {
|
||||
IS_WEB ? saveMessageWeb(message) : saveMessageDesktop(message);
|
||||
}
|
||||
@@ -100,7 +97,7 @@ export function __(message, tokens) {
|
||||
return translatedMessage;
|
||||
}
|
||||
|
||||
return translatedMessage.replace(/%([^%]+)%/g, ($1, $2) => {
|
||||
return translatedMessage.replace(/%([^%]+)%/g, function($1, $2) {
|
||||
return tokens.hasOwnProperty($2) ? tokens[$2] : $2;
|
||||
});
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import ModalPublishSuccess from './view';
|
||||
import { doClearPublish, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import { doClearPublish } from 'lbry-redux';
|
||||
import { push } from 'connected-react-router';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
const perform = dispatch => ({
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
clearPublish: () => dispatch(doClearPublish()),
|
||||
navigate: (path) => dispatch(push(path)),
|
||||
navigate: path => dispatch(push(path)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ModalPublishSuccess);
|
||||
export default connect(
|
||||
null,
|
||||
perform
|
||||
)(ModalPublishSuccess);
|
||||
@@ -10,44 +10,23 @@ import Nag from 'component/common/nag';
|
||||
type Props = {
|
||||
closeModal: () => void,
|
||||
clearPublish: () => void,
|
||||
navigate: (string) => void,
|
||||
navigate: string => void,
|
||||
uri: string,
|
||||
isEdit: boolean,
|
||||
filePath: ?string,
|
||||
lbryFirstError: ?string,
|
||||
claim: Claim,
|
||||
};
|
||||
|
||||
class ModalPublishSuccess extends React.PureComponent<Props> {
|
||||
componentDidMount() {
|
||||
const { clearPublish } = this.props;
|
||||
clearPublish();
|
||||
}
|
||||
render() {
|
||||
const { closeModal, clearPublish, navigate, uri, isEdit, filePath, lbryFirstError, claim } = this.props;
|
||||
// $FlowFixMe
|
||||
const livestream = claim && claim.value && claim.value_type === 'stream' && !claim.value.source;
|
||||
let contentLabel;
|
||||
if (livestream) {
|
||||
contentLabel = __('Livestream Created');
|
||||
} else if (isEdit) {
|
||||
contentLabel = __('Update published');
|
||||
} else {
|
||||
contentLabel = __('File published');
|
||||
}
|
||||
|
||||
let publishMessage;
|
||||
if (isEdit) {
|
||||
publishMessage = __('Your update is now pending. It will take a few minutes to appear for other users.');
|
||||
} else if (livestream) {
|
||||
publishMessage = __(
|
||||
'Your livestream is now pending. You will be able to start shortly at the streaming dashboard.'
|
||||
);
|
||||
} else {
|
||||
publishMessage = __('Your file is now pending on LBRY. It will take a few minutes to appear for other users.');
|
||||
}
|
||||
const { closeModal, clearPublish, navigate, uri, isEdit, filePath, lbryFirstError } = this.props;
|
||||
const contentLabel = isEdit ? __('Update published') : __('File published');
|
||||
const publishMessage = isEdit
|
||||
? __('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.');
|
||||
|
||||
function handleClose() {
|
||||
clearPublish();
|
||||
closeModal();
|
||||
}
|
||||
|
||||
@@ -75,28 +54,15 @@ class ModalPublishSuccess extends React.PureComponent<Props> {
|
||||
}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
{!livestream && (
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('View My Uploads')}
|
||||
onClick={() => {
|
||||
clearPublish();
|
||||
navigate(`/$/${PAGES.UPLOADS}`);
|
||||
closeModal();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{livestream && (
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('View My Dashboard')}
|
||||
onClick={() => {
|
||||
clearPublish();
|
||||
navigate(`/$/${PAGES.LIVESTREAM}`);
|
||||
closeModal();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('View My Uploads')}
|
||||
onClick={() => {
|
||||
clearPublish();
|
||||
navigate(`/$/${PAGES.UPLOADS}`);
|
||||
closeModal();
|
||||
}}
|
||||
/>
|
||||
<Button button="link" label={__('Close')} onClick={handleClose} />
|
||||
</div>
|
||||
}
|
||||
|
||||
Loaded 100 of 155 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user