Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c938b6522 |
No files matched your search
@@ -21,7 +21,6 @@ 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
|
||||
@@ -30,11 +29,6 @@ YRBL_SAD_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649
|
||||
ENABLE_COMMENT_REACTIONS=true
|
||||
ENABLE_FILE_REACTIONS=false
|
||||
ENABLE_CREATOR_REACTIONS=false
|
||||
ENABLE_NO_SOURCE_CLAIMS=false
|
||||
ENABLE_PREROLL_ADS=false
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4
|
||||
CHANNEL_STAKED_LEVEL_LIVESTREAM=5
|
||||
WEB_PUBLISH_SIZE_LIMIT_GB=4
|
||||
|
||||
# OG
|
||||
OG_TITLE_SUFFIX=| lbry.tv
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
name: 'build'
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
node-version: [12.x]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||
WIN_CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/win-csc-2020-2021-08.p12
|
||||
CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-csc-2021-2022.p12
|
||||
CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-cert.p12
|
||||
|
||||
# UI
|
||||
MATOMO_URL: https://analytics.lbry.com/
|
||||
@@ -72,11 +72,8 @@ jobs:
|
||||
YRBL_HAPPY_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a
|
||||
YRBL_SAD_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
|
||||
ENABLE_COMMENT_REACTIONS: true
|
||||
ENABLE_NO_SOURCE_CLAIMS: false
|
||||
|
||||
DEFAULT_LANGUAGE: en
|
||||
KNOWN_APP_DOMAINS: lbry.tv,lbry.lat,odysee.com
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: 0
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: |
|
||||
|
||||
@@ -23,12 +23,8 @@ package-lock.json
|
||||
/web/.env.defaults
|
||||
/custom/*
|
||||
/custom/homepages/*
|
||||
/custom/content/*
|
||||
!/custom/content/default.json
|
||||
!/custom/content/test.json
|
||||
!/custom/homepages/.gitkeep
|
||||
!/custom/homepages
|
||||
!/custom/content
|
||||
!/custom/homepage.example.js
|
||||
!/custom/robots.disallowall
|
||||
!/custom/robots.allowall
|
||||
|
||||
+2
-48
@@ -4,73 +4,27 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [Unreleased for Desktop]
|
||||
## [Unreleased on desktop]
|
||||
|
||||
### Added
|
||||
|
||||
- Send a tip with your comment ([#5920](https://github.com/lbryio/lbry-desktop/issues/5920))
|
||||
- Search for tags in search dropdown ([#5876](https://github.com/lbryio/lbry-desktop/issues/5876))
|
||||
- Japanese, Afrikaans, Filipino, Thai and Vietnamese language support ([#5684](https://github.com/lbryio/lbry-desktop/issues/5684))
|
||||
- Highlight comments made by content owner _community pr!_ ([#5744](https://github.com/lbryio/lbry-desktop/pull/5744))
|
||||
- Ability to report infringing content directly from the application ([#5808](https://github.com/lbryio/lbry-desktop/pull/5808))
|
||||
- Re-added ability to export wallet transactions ([#5899](https://github.com/lbryio/lbry-desktop/pull/5899))
|
||||
|
||||
### Changed
|
||||
|
||||
- Keyboard shortcut additions and changes _community pr!_ ([#5717](https://github.com/lbryio/lbry-desktop/pull/5717))
|
||||
- Removed the 10k character-limit when editing _Posts_ ([#5719](https://github.com/lbryio/lbry-desktop/pull/5719))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Lazy-load claim images to improve app responsiveness ([#5795](https://github.com/lbryio/lbry-desktop/issues/5795))
|
||||
- Fix display of upload date and view count on smaller screens ([#5822](https://github.com/lbryio/lbry-desktop/issues/5822))
|
||||
- Autoplay looping to a previous video or itself ([#5711](https://github.com/lbryio/lbry-desktop/pull/5711))
|
||||
- Autoplay not working in mini-player mode ([#5716](https://github.com/lbryio/lbry-desktop/pull/5716))
|
||||
- Edited claim accidentally moved to 'Anonymous' ([#5767](https://github.com/lbryio/lbry-desktop/pull/5767))
|
||||
|
||||
## [0.50.2] - [2021-04-2]
|
||||
|
||||
### Changed
|
||||
|
||||
- Disable PDFs until security issue is fixed
|
||||
|
||||
## [0.50.1] - [2021-03-18]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Upgrade modal extended beyond the height of the app ([#5709](https://github.com/lbryio/lbry-desktop/pull/5709))
|
||||
|
||||
## [0.50.0] - [2021-03-18]
|
||||
|
||||
### Added
|
||||
|
||||
- New moderation tools: block & mute ([#5572](https://github.com/lbryio/lbry-desktop/pull/5572))
|
||||
- Improved markdown file styling ([#5659](https://github.com/lbryio/lbry-desktop/pull/5659))
|
||||
- Wallet balance UI improvements ([#5276](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Mass tip unlock ([#5409](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Zoomable image viewer in Markdown (posts and comments) _community pr!_ ([#5387](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Enable PDF Viewer in App _community pr!_ ([#2903](https://github.com/lbryio/lbry-desktop/issues/2903))
|
||||
- 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
|
||||
|
||||
- Updated lbry-sdk to [0.92.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.92.0)
|
||||
- Re-enable PDF Viewer in desktop app _community pr!_ ([#5420](https://github.com/lbryio/lbry-desktop/issues/5420))
|
||||
|
||||
### Fixed
|
||||
|
||||
- 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]
|
||||
|
||||
|
||||
+26
-24
@@ -1,19 +1,21 @@
|
||||
# Contribute to LBRY
|
||||
|
||||
|
||||
**First:** if you're unsure or afraid of anything, just ask or submit the issue or pull request anyways. You won't be yelled at for giving your best effort. The worst that can happen is that you'll be politely asked to change something. We appreciate any sort of contributions, and don't want a wall of rules to get in the way of that.
|
||||
|
||||
However, for those individuals who want a bit more guidance on the best way to contribute to the project, read on. This document will cover what we're looking for. By addressing all the points we're looking for, it raises the chances we can quickly merge or address your contributions.
|
||||
|
||||
|
||||
## TL;DR?
|
||||
|
||||
- [Here](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
|
||||
* [Here](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
|
||||
is a list of help wanted issues.
|
||||
- Comment on an issue to let us know if you are going to work on it, don't take an issue that someone reserved less than 3 days ago.
|
||||
- Submit a pull request and get paid in LBC.
|
||||
- Don't hesitate to contact us with any questions or comments.
|
||||
* Comment on an issue to let us know if you are going to work on it, don't take an issue that someone reserved less than 3 days ago.
|
||||
* Submit a pull request and get paid in LBC.
|
||||
* Don't hesitate to contact us with any questions or comments.
|
||||
* [Check out this video for a quickstart guide to running and developing the desktop app](https://spee.ch/7da73fc508ffc4ff8b2711e3c3950110430b0c5f/LBRYAppDesign.mp4).
|
||||
|
||||
## Contents
|
||||
|
||||
- [Choose an Issue](#choose-an-issue)
|
||||
- [Code Overview](#code-overview)
|
||||
- [Libraries](#libraries)
|
||||
@@ -36,20 +38,20 @@ receives contributions from individuals outside the core team -- such as yoursel
|
||||
|
||||
To make contributing as easy and rewarding as possible, we have instituted the following system:
|
||||
|
||||
- Anyone can view all issues in the system by clicking on the
|
||||
* Anyone can view all issues in the system by clicking on the
|
||||
[Issues](https://github.com/lbryio/lbry-desktop/issues) button at the top of the page. Feel free to
|
||||
add an issue if you think we have missed something (and you might earn some LBC in the process
|
||||
because we do tip people for reporting bugs).
|
||||
- Once on the [Issues](https://github.com/lbryio/lbry-desktop/issues) page, a potential contributor can
|
||||
* Once on the [Issues](https://github.com/lbryio/lbry-desktop/issues) page, a potential contributor can
|
||||
filter issues by the
|
||||
[Help Wanted](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
|
||||
label to see a curated list of suggested issues with which community members can help.
|
||||
- Every
|
||||
* Every
|
||||
[Help Wanted](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+no%3Aassignee)
|
||||
issue is ranked on a scale from zero to four.
|
||||
|
||||
| Level | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| Level | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
|
||||
| [**level 0**](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level%3A+0%22+no%3Aassignee) | Typos and text edits -- a tech-savvy non-programmer can fix these. |
|
||||
| [**level 1**](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level%3A+1%22+no%3Aassignee) | Programming issues that require little knowledge of how the LBRY app works. |
|
||||
| [**level 2**](https://github.com/lbryio/lbry-desktop/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+label%3A%22level%3A+2%22+no%3Aassignee) | Issues of average difficulty that require the developer to dig into how the app works a little bit. |
|
||||
@@ -78,7 +80,7 @@ our styling rules and code best practices.
|
||||
|
||||
### Libraries
|
||||
|
||||
This project uses [lbry-redux](https://github.com/lbryio/lbry-redux) and [lbryionc](https://github.com/lbryio/lbryinc) to share Redux and LBRY API specific code with other LBRY apps. Over time, more Redux code that is suitable to be shared will be moved into lbry-redux. If modifying Redux code, you may be asked to make some of your changes in lbry-redux rather than lbry-desktop. The steps to work with lbry-redux locally can be found [here](https://github.com/lbryio/lbry-redux#local-development).
|
||||
This project uses [lbry-redux](https://github.com/lbryio/lbry-redux) and [lbryionc](https://github.com/lbryio/lbryinc) to share Redux and LBRY API specific code with [lbry-android](https://github.com/lbryio/lbry-android) and other LBRY apps. Over time, more Redux code that is suitable to be shared will be moved into lbry-redux. If modifying Redux code, you may be asked to make some of your changes in lbry-redux rather than lbry-desktop. The steps to work with lbry-redux locally can be found [here](https://github.com/lbryio/lbry-redux#local-development).
|
||||
|
||||
### Flow
|
||||
|
||||
@@ -138,15 +140,15 @@ Editor integrations are available [here](https://prettier.io/docs/en/editors.htm
|
||||
|
||||
There are a few tools integrated to the project that will ease the process of debugging:
|
||||
|
||||
- [Chrome DevTools](https://developer.chrome.com/devtools)
|
||||
- Also available for the main process as a [remote target](chrome://inspect/#devices).
|
||||
- [Electron Devtron](https://electronjs.org/devtron)
|
||||
- [React DevTools](https://github.com/facebook/react-devtools)
|
||||
- [Redux DevTools](https://github.com/gaearon/redux-devtools)
|
||||
* [Chrome DevTools](https://developer.chrome.com/devtools)
|
||||
* Also available for the main process as a [remote target](chrome://inspect/#devices).
|
||||
* [Electron Devtron](https://electronjs.org/devtron)
|
||||
* [React DevTools](https://github.com/facebook/react-devtools)
|
||||
* [Redux DevTools](https://github.com/gaearon/redux-devtools)
|
||||
|
||||
## Submit a Pull Request
|
||||
|
||||
- After deciding what to work on, a potential contributor can
|
||||
* After deciding what to work on, a potential contributor can
|
||||
[fork](https://help.github.com/articles/fork-a-repo/) this repository, make his or her changes,
|
||||
and submit a
|
||||
[pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). A
|
||||
@@ -155,12 +157,12 @@ There are a few tools integrated to the project that will ease the process of de
|
||||
manner and, therefore, not begin working on anything reserved (or updated) within the last 3 days.
|
||||
If someone has been officially assigned an issue via GitHub's assignment system, it is also not
|
||||
available. Contributors are encouraged to ask if they have any questions about issue availability.
|
||||
- The [changelog](https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md) should be updated to
|
||||
* The [changelog](https://github.com/lbryio/lbry-desktop/blob/master/CHANGELOG.md) should be updated to
|
||||
include a reference to the fix/change/addition. See previous entries for format.
|
||||
- Once the pull request is visible in the LBRY repo, a LBRY team member will review it and make sure
|
||||
* Once the pull request is visible in the LBRY repo, a LBRY team member will review it and make sure
|
||||
it is up to our standards. At this point, the contributor may have to change his or her code based
|
||||
on our suggestions and comments.
|
||||
- Then, upon a satisfactory review of the code, we will merge it and send the contributor a tip (in
|
||||
* Then, upon a satisfactory review of the code, we will merge it and send the contributor a tip (in
|
||||
LBC) for the contribution.
|
||||
|
||||
We are dedicated to being fair and friendly in this process. In **general**, level 4 issues will be
|
||||
@@ -189,10 +191,10 @@ will earn you an extra 50 LBC on top of what we would otherwise tip you.
|
||||
|
||||
# Get in Touch
|
||||
|
||||
| Name | Role | Discord | Email |
|
||||
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------- |
|
||||
| [Tom](https://github.com/tzarebczan) | Community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. | jiggytom | tom@lbry.com |
|
||||
| [Sean](https://github.com/seanyesmunt) | The primary engineer working on the app. Feel free to ask any questions about the code. | sean | sean@lbry.com |
|
||||
| Name | Role | Discord | Email |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------
|
||||
| [Tom](https://github.com/tzarebczan) | Community manager. He knows more than anyone about the app and all of its flaws. Reach out to him with any questions about how the app works, if a bug has been reported, or if a feature should be requested. | jiggytom | tom@lbry.com |
|
||||
| [Sean](https://github.com/seanyesmunt) | The primary engineer working on the app. Feel free to ask any questions about the code. | sean | sean@lbry.com |
|
||||
|
||||
Join our Discord [here](https://chat.lbry.com/).
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ We provide installers for Windows, macOS (v10.12.4, Sierra, or greater), and Deb
|
||||
| Latest Pre-release | [Download](https://lbry.com/get/lbry.pre.exe) | [Download](https://lbry.com/get/lbry.pre.dmg) | [Download](https://lbry.com/get/lbry.pre.deb) |
|
||||
|
||||
Our [releases page](https://github.com/lbryio/lbry-desktop/releases) also contains the latest
|
||||
release, pre-releases, and past builds.
|
||||
release, pre-releases, and past builds.
|
||||
_Note: If the deb fails to install using the Ubuntu Software Center, install manually via `sudo dpkg -i <path to deb>`. You'll need to run `sudo apt-get install -f` if this is the first time installing it to install dependencies_
|
||||
|
||||
To install from source or make changes to the application, continue to the next section below.
|
||||
@@ -63,10 +63,10 @@ To install from source or make changes to the application, continue to the next
|
||||
**Community maintained** builds for Arch Linux and Flatpak are available, see below. These installs will need to be updated manually as the in-app update process only supports Debian installs at this time.
|
||||
_Note: If coming from a deb install, the directory structure is different and you'll need to [migrate data](https://lbry.com/faq/backup-data)._
|
||||
|
||||
| | Flatpak | Arch | Nixpkgs | ARM/ARM64 |
|
||||
| -------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------- |
|
||||
| Latest Release | [FlatHub Page](https://flathub.org/apps/details/io.lbry.lbry-app) | [AUR Package](https://aur.archlinux.org/packages/lbry-app-bin/) | [Nixpkgs](https://search.nixos.org/packages?channel=unstable&show=lbry&query=lbry) | [Build Guide](https://lbry.tv/@LBRYarm:5) |
|
||||
| Maintainers | [@kcSeb](https://keybase.io/kcseb) | [@kcSeb](https://keybase.io/kcseb)/[@TimurKiyivinski](https://github.com/TimurKiyivinski) | [@Enderger](https://github.com/enderger) | [@Madiator2011](https://github.com/kodxana) |
|
||||
| | Flatpak | Arch | ARM/ARM64 |
|
||||
| -------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------- |
|
||||
| Latest Release | [FlatHub Page](https://flathub.org/apps/details/io.lbry.lbry-app) | [AUR Package](https://aur.archlinux.org/packages/lbry-app-bin/) | [Build Guide](https://lbry.tv/@LBRYarm:5) |
|
||||
| Maintainers | [@kcSeb](https://keybase.io/kcseb) | [@kcSeb](https://keybase.io/kcseb)/[@TimurKiyivinski](https://github.com/TimurKiyivinski) | [@Madiator2011](https://github.com/kodxana) |
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -88,12 +88,16 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
|
||||
|
||||
#### Run the electron app
|
||||
|
||||
`yarn compile:electron` (this is only needed the first time you run the app)
|
||||
|
||||
`yarn dev`
|
||||
|
||||
- If you want to build and launch the production app you can run `yarn build`. This will give you an executable inside the `/dist` folder. We use [electron-builder](https://github.com/electron-userland/electron-builder) to create distributable packages.
|
||||
|
||||
#### Run the web app for development
|
||||
|
||||
`yarn compile:web` (this is only needed the first time you run the app)
|
||||
|
||||
`yarn dev:web`
|
||||
|
||||
- This uses webpack-dev-server and includes hot-reloading. If you want to debug the [web server we use in production](https://github.com/lbryio/lbry-desktop/blob/master/src/platforms/web/server.js) you can run `yarn dev:web-server`. This starts a server at `localhost:1337` and does not include hot reloading.
|
||||
@@ -106,12 +110,11 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
|
||||
cp .env.defaults .env
|
||||
nano .env
|
||||
```
|
||||
|
||||
- To specify your own OG-IMAGE
|
||||
You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env
|
||||
You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env
|
||||
|
||||
- To specify your own channels to be followed on first run
|
||||
`AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a`
|
||||
`AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a`
|
||||
|
||||
- If you want to customize the homepage content
|
||||
|
||||
@@ -129,7 +132,7 @@ PINNED_LABEL_2=OtherLinkText
|
||||
```
|
||||
|
||||
- Finally `NODE_ENV=production yarn compile:web` to rebuild
|
||||
_Note: You don't need to edit the .env file in the /web folder - that is copied during compile._
|
||||
_Note: You don't need to edit the .env file in the /web folder - that is copied during compile._
|
||||
|
||||
#### Deploy the web app (_experimental_)
|
||||
|
||||
@@ -170,9 +173,8 @@ This project is MIT licensed. For the full license, see [LICENSE](LICENSE).
|
||||
|
||||
## Security
|
||||
|
||||
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://lbry.com/faq/pgp-key) if you need it. Previous versions up to v0.50.2 were signed by [Sean Yesmunt](https://keybase.io/seanyesmunt/key.asc).
|
||||
New Releases are signed by [Jessop Breth](https://keybase.io/jessopb/key.asc).
|
||||
We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is [here](https://keybase.io/lbry/key.asc) if you need it. All releases are signed by [Sean Yesmunt](https://keybase.io/seanyesmunt/key.asc).
|
||||
|
||||
## Contact
|
||||
|
||||
The primary contact for this project is [@jessopb](https://github.com/jessopb).
|
||||
The primary contact for this project is [@seanyesmunt](https://github.com/seanyesmunt).
|
||||
@@ -21,14 +21,12 @@ 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,
|
||||
OG_IMAGE_URL: process.env.OG_IMAGE_URL,
|
||||
YRBL_HAPPY_IMG_URL: process.env.YRBL_HAPPY_IMG_URL,
|
||||
YRBL_SAD_IMG_URL: process.env.YRBL_SAD_IMG_URL,
|
||||
LOGIN_IMG_URL: process.env.LOGIN_IMG_URL,
|
||||
SITE_CANONICAL_URL: process.env.SITE_CANONICAL_URL,
|
||||
DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE,
|
||||
AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS,
|
||||
@@ -36,11 +34,6 @@ const config = {
|
||||
ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true',
|
||||
ENABLE_FILE_REACTIONS: process.env.ENABLE_FILE_REACTIONS === 'true',
|
||||
ENABLE_CREATOR_REACTIONS: process.env.ENABLE_CREATOR_REACTIONS === 'true',
|
||||
ENABLE_NO_SOURCE_CLAIMS: process.env.ENABLE_NO_SOURCE_CLAIMS === 'true',
|
||||
ENABLE_PREROLL_ADS: process.env.ENABLE_PREROLL_ADS === 'true',
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: process.env.CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS,
|
||||
CHANNEL_STAKED_LEVEL_LIVESTREAM: process.env.CHANNEL_STAKED_LEVEL_LIVESTREAM,
|
||||
WEB_PUBLISH_SIZE_LIMIT_GB: process.env.WEB_PUBLISH_SIZE_LIMIT_GB,
|
||||
SIMPLE_SITE: process.env.SIMPLE_SITE === 'true',
|
||||
SHOW_ADS: process.env.SHOW_ADS === 'true',
|
||||
PINNED_URI_1: process.env.PINNED_URI_1,
|
||||
|
||||
+1
-4
@@ -46,10 +46,7 @@ let lbryFirst;
|
||||
|
||||
const appState = {};
|
||||
|
||||
if (process.platform !== 'linux') {
|
||||
app.setAsDefaultProtocolClient('lbry');
|
||||
}
|
||||
|
||||
app.setAsDefaultProtocolClient('lbry');
|
||||
app.name = 'LBRY';
|
||||
app.setAppUserModelId('io.lbry.LBRY');
|
||||
app.commandLine.appendSwitch('force-color-profile', 'srgb');
|
||||
|
||||
Vendored
-75
@@ -12,21 +12,11 @@ declare type Comment = {
|
||||
is_channel_signature_valid?: boolean, // whether or not the signature could be validated
|
||||
parent_id?: number, // comment_id of comment this is in reply to
|
||||
is_pinned: boolean,
|
||||
support_amount: number,
|
||||
};
|
||||
|
||||
declare type PerChannelSettings = {
|
||||
words?: Array<string>,
|
||||
comments_enabled?: boolean,
|
||||
min_tip_amount_comment?: number,
|
||||
min_tip_amount_super_chat?: number,
|
||||
slow_mode_min_gap?: number,
|
||||
};
|
||||
|
||||
// todo: relate individual comments to their commentId
|
||||
declare type CommentsState = {
|
||||
commentsByUri: { [string]: string },
|
||||
superChatsByUri: { [string]: { totalAmount: number, comments: Array<Comment> } },
|
||||
byId: { [string]: Array<string> },
|
||||
repliesByParentId: { [string]: Array<string> }, // ParentCommentID -> list of reply comments
|
||||
topLevelCommentsById: { [string]: Array<string> }, // ClaimID -> list of top level comments
|
||||
@@ -37,13 +27,6 @@ declare type CommentsState = {
|
||||
myReactsByCommentId: any,
|
||||
othersReactsByCommentId: any,
|
||||
pendingCommentReactions: Array<string>,
|
||||
moderationBlockList: ?Array<string>,
|
||||
fetchingModerationBlockList: boolean,
|
||||
blockingByUri: {},
|
||||
unBlockingByUri: {},
|
||||
settingsByChannelId: { [string]: PerChannelSettings }, // ChannelID -> settings
|
||||
fetchingSettings: boolean,
|
||||
fetchingBlockedWords: boolean,
|
||||
};
|
||||
|
||||
declare type CommentReactParams = {
|
||||
@@ -54,61 +37,3 @@ declare type CommentReactParams = {
|
||||
clear_types?: string,
|
||||
remove?: boolean,
|
||||
};
|
||||
|
||||
declare type CommentListParams = {
|
||||
page: number,
|
||||
page_size: number,
|
||||
claim_id: string,
|
||||
};
|
||||
|
||||
declare type CommentListResponse = {
|
||||
items: Array<Comment>,
|
||||
total_amount: number,
|
||||
};
|
||||
|
||||
declare type CommentAbandonParams = {
|
||||
comment_id: string,
|
||||
creator_channel_id?: string,
|
||||
creator_channel_name?: string,
|
||||
channel_id?: string,
|
||||
hexdata?: string,
|
||||
};
|
||||
|
||||
declare type CommentCreateParams = {
|
||||
comment: string,
|
||||
claim_id: string,
|
||||
parent_id?: string,
|
||||
signature: string,
|
||||
signing_ts: number,
|
||||
support_tx_id?: string,
|
||||
};
|
||||
|
||||
declare type SuperListParams = {};
|
||||
|
||||
declare type ModerationBlockParams = {};
|
||||
|
||||
declare type SettingsParams = {
|
||||
channel_name: string,
|
||||
channel_id: string,
|
||||
signature: string,
|
||||
signing_ts: string,
|
||||
};
|
||||
|
||||
declare type UpdateSettingsParams = {
|
||||
channel_name: string,
|
||||
channel_id: string,
|
||||
signature: string,
|
||||
signing_ts: string,
|
||||
comments_enabled?: boolean,
|
||||
min_tip_amount_comment?: number,
|
||||
min_tip_amount_super_chat?: number,
|
||||
slow_mode_min_gap?: number,
|
||||
}
|
||||
|
||||
declare type BlockWordParams = {
|
||||
channel_name: string,
|
||||
channel_id: string,
|
||||
signature: string,
|
||||
signing_ts: string,
|
||||
words: string, // CSV list of containing words to block comment on content
|
||||
};
|
||||
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 = {};
|
||||
Vendored
+2
-3
@@ -4,12 +4,12 @@ declare type HomepageObject = {
|
||||
options: any,
|
||||
route: string,
|
||||
title: string,
|
||||
};
|
||||
}
|
||||
|
||||
declare type HomepageData = {
|
||||
[string]: HomepageObject,
|
||||
default: any => any,
|
||||
};
|
||||
}
|
||||
|
||||
declare type RowDataItem = {
|
||||
title: any,
|
||||
@@ -19,7 +19,6 @@ declare type RowDataItem = {
|
||||
extra?: any,
|
||||
options?: {
|
||||
channelIds?: Array<string>,
|
||||
limitClaimsPerChannel?: number,
|
||||
pageSize: number,
|
||||
},
|
||||
route?: string,
|
||||
|
||||
Vendored
-26
@@ -1,26 +0,0 @@
|
||||
// @flow
|
||||
|
||||
declare type LivestreamReplayItem = {
|
||||
data: {
|
||||
claimId: string,
|
||||
deleted: boolean,
|
||||
deletedAt: ?string,
|
||||
ffprobe: any,
|
||||
fileDuration: number, // decimal? float? string?
|
||||
fileType: string,
|
||||
fileLocation: string,
|
||||
fileSize: number,
|
||||
key: string,
|
||||
published: boolean,
|
||||
publishedAt: ?string,
|
||||
service: string,
|
||||
thumbnails: Array<string>,
|
||||
uploadedAt: string, // Date?
|
||||
},
|
||||
id: string,
|
||||
}
|
||||
declare type LivestreamReplayData = Array<LivestreamReplayItem>;
|
||||
|
||||
declare type LivestreamState = {
|
||||
fetchingById: {},
|
||||
}
|
||||
Vendored
-5
@@ -36,8 +36,3 @@ declare type WebNotification = {
|
||||
user_id: number,
|
||||
group_count?: number,
|
||||
};
|
||||
|
||||
declare type NotificationCategory = {
|
||||
name: string,
|
||||
types: ?Array<string>,
|
||||
};
|
||||
Vendored
-1
@@ -11,7 +11,6 @@ declare type UpdatePublishFormData = {
|
||||
thumbnail_url?: string,
|
||||
uploadThumbnailStatus?: string,
|
||||
thumbnailPath?: string,
|
||||
thumbnailError?: boolean,
|
||||
description?: string,
|
||||
language?: string,
|
||||
channel?: string,
|
||||
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
// @flow
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
|
||||
declare type ReportContentState = {
|
||||
isReporting: boolean,
|
||||
error: string,
|
||||
};
|
||||
|
||||
|
||||
Vendored
-13
@@ -14,22 +14,11 @@ declare type SearchOptions = {
|
||||
MEDIA_TEXT: string,
|
||||
MEDIA_IMAGE: string,
|
||||
MEDIA_APPLICATION: string,
|
||||
SORT: string,
|
||||
SORT_ACCENDING: string,
|
||||
SORT_DESCENDING: string,
|
||||
EXACT: string,
|
||||
TIME_FILTER: string,
|
||||
TIME_FILTER_LAST_HOUR: string,
|
||||
TIME_FILTER_TODAY: string,
|
||||
TIME_FILTER_THIS_WEEK: string,
|
||||
TIME_FILTER_THIS_MONTH: string,
|
||||
TIME_FILTER_THIS_YEAR: string,
|
||||
};
|
||||
|
||||
declare type SearchState = {
|
||||
options: SearchOptions,
|
||||
urisByQuery: {},
|
||||
hasReachedMaxResultsLength: {},
|
||||
searching: boolean,
|
||||
};
|
||||
|
||||
@@ -37,8 +26,6 @@ declare type SearchSuccess = {
|
||||
type: ACTIONS.SEARCH_SUCCESS,
|
||||
data: {
|
||||
query: string,
|
||||
from: number,
|
||||
size: number,
|
||||
uris: Array<string>,
|
||||
},
|
||||
};
|
||||
|
||||
Vendored
+11
@@ -1,4 +1,15 @@
|
||||
// @flow
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
import {
|
||||
DOWNLOADED,
|
||||
DOWNLOADING,
|
||||
NOTIFY_ONLY,
|
||||
VIEW_ALL,
|
||||
VIEW_LATEST_FIRST,
|
||||
SUGGESTED_TOP_BID,
|
||||
SUGGESTED_TOP_SUBSCRIBED,
|
||||
SUGGESTED_FEATURED,
|
||||
} from 'constants/subscriptions';
|
||||
|
||||
declare type Subscription = {
|
||||
channelName: string, // @CryptoCandor,
|
||||
|
||||
Vendored
-3
@@ -28,7 +28,4 @@ declare type User = {
|
||||
device_types: Array<DeviceType>,
|
||||
lbry_first_approved: boolean,
|
||||
experimental_ui: boolean,
|
||||
odysee_live_enabled: boolean,
|
||||
odysee_live_disabled: boolean,
|
||||
global_mod: boolean,
|
||||
};
|
||||
+220
-1248
File diff suppressed because it is too large.
Load diff
+8
-11
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.50.3-rc.1",
|
||||
"version": "0.49.4",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
@@ -53,8 +53,7 @@
|
||||
"electron-updater": "^4.2.4",
|
||||
"express": "^4.17.1",
|
||||
"if-env": "^1.0.4",
|
||||
"react-datetime-picker": "^3.2.1",
|
||||
"remove-markdown": "^0.3.0",
|
||||
"remove-markdown": "^0.3.0",
|
||||
"tempy": "^0.6.0",
|
||||
"videojs-logo": "^2.1.4"
|
||||
},
|
||||
@@ -118,7 +117,6 @@
|
||||
"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",
|
||||
@@ -143,8 +141,8 @@
|
||||
"imagesloaded": "^4.1.4",
|
||||
"json-loader": "^0.5.4",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#508e8d36fd91106beb7d6b4edb9f726dae0e6264",
|
||||
"lbryinc": "lbryio/lbryinc#8f9a58bfc8312a65614fd7327661cdcc502c4e59",
|
||||
"lbry-redux": "lbryio/lbry-redux#f37fd9bf921d0c6d068b02e39014d3b239373fba",
|
||||
"lbryinc": "lbryio/lbryinc#eee2cb730ecec95a1344a755035755b0d4dad5cf",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
"lodash-es": "^4.17.14",
|
||||
@@ -186,7 +184,7 @@
|
||||
"redux-thunk": "^2.2.0",
|
||||
"remark": "^9.0.0",
|
||||
"remark-attr": "^0.8.3",
|
||||
"remark-breaks": "^1.0.5",
|
||||
"remark-breaks": "^1.0.5",
|
||||
"remark-emoji": "^2.0.1",
|
||||
"remark-frontmatter": "^2.0.0",
|
||||
"remark-react": "^8.0.0",
|
||||
@@ -198,13 +196,12 @@
|
||||
"strip-markdown": "^3.0.3",
|
||||
"style-loader": "^0.23.1",
|
||||
"terser-webpack-plugin": "^1.2.3",
|
||||
"three": "^0.125.0",
|
||||
"three": "^0.93.0",
|
||||
"three-full": "^17.1.0",
|
||||
"tiny-relative-date": "^1.3.0",
|
||||
"tree-kill": "^1.1.0",
|
||||
"unist-util-visit": "^2.0.3",
|
||||
"uuid": "^8.3.2",
|
||||
"vast-client": "^3.1.1",
|
||||
"video.js": "^7.10.1",
|
||||
"videojs-contrib-quality-levels": "^2.0.9",
|
||||
"videojs-event-tracking": "^1.0.1",
|
||||
@@ -219,7 +216,7 @@
|
||||
"webpack-hot-middleware": "^2.24.3",
|
||||
"webpack-merge": "^4.2.1",
|
||||
"webpack-node-externals": "^1.7.2",
|
||||
"y18n": "^4.0.1",
|
||||
"y18n": "^4.0.0",
|
||||
"yarnhook": "^0.2.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -227,7 +224,7 @@
|
||||
"yarn": "^1.3"
|
||||
},
|
||||
"lbrySettings": {
|
||||
"lbrynetDaemonVersion": "0.92.0",
|
||||
"lbrynetDaemonVersion": "0.88.0",
|
||||
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
||||
"lbrynetDaemonDir": "static/daemon",
|
||||
"lbrynetDaemonFileName": "lbrynet",
|
||||
|
||||
+40
-406
@@ -32,7 +32,6 @@
|
||||
"Play": "Play",
|
||||
"Subscribe": "Subscribe",
|
||||
"Report content": "Report content",
|
||||
"Report Content": "Report Content",
|
||||
"Content-Type": "Content-Type",
|
||||
"Languages": "Languages",
|
||||
"Media Type": "Media Type",
|
||||
@@ -48,6 +47,9 @@
|
||||
"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",
|
||||
"Deposit": "Deposit",
|
||||
@@ -114,7 +116,6 @@
|
||||
"Recipient address": "Recipient address",
|
||||
"Send": "Send",
|
||||
"Receive Credits": "Receive Credits",
|
||||
"Send Credits": "Send Credits",
|
||||
"Address copied.": "Address copied.",
|
||||
"Get New Address": "Get New Address",
|
||||
"Show QR code": "Show QR code",
|
||||
@@ -173,7 +174,9 @@
|
||||
"Yes": "Yes",
|
||||
"No": "No",
|
||||
"These search results are provided by LBRY, Inc.": "These search results are provided by LBRY, Inc.",
|
||||
"FILTER": "FILTER",
|
||||
"View file": "View file",
|
||||
"Search For": "Search For",
|
||||
"Files": "Files",
|
||||
"Channels": "Channels",
|
||||
"Everything": "Everything",
|
||||
@@ -182,16 +185,6 @@
|
||||
"Other": "Other",
|
||||
"Other Options": "Other Options",
|
||||
"Returned Results": "Returned Results",
|
||||
"Find results that include all the given words in the exact order.\nThis can also be done by surrounding the search query with quotation marks (e.g. \"hello world\").": "Find results that include all the given words in the exact order.\nThis can also be done by surrounding the search query with quotation marks (e.g. \"hello world\").",
|
||||
"Last Hour": "Last Hour",
|
||||
"Last 24 Hours": "Last 24 Hours",
|
||||
"Relevance": "Relevance",
|
||||
"Newest first": "Newest first",
|
||||
"Oldest first": "Oldest first",
|
||||
"Exact match": "Exact match",
|
||||
"Upload Date": "Upload Date",
|
||||
"Creation Date": "Creation Date",
|
||||
"Sort By": "Sort By",
|
||||
"Custom Code": "Custom Code",
|
||||
"Are you a supermodel or rockstar that received a custom reward code? Claim it here.": "Are you a supermodel or rockstar that received a custom reward code? Claim it here.",
|
||||
"Go To Invites": "Go To Invites",
|
||||
@@ -205,7 +198,6 @@
|
||||
"Connecting...": "Connecting...",
|
||||
"Comments": "Comments",
|
||||
"Comment": "Comment",
|
||||
"Comment --[button to submit something]--": "Comment",
|
||||
"Your comment": "Your comment",
|
||||
"Post --[button to submit something]--": "Post",
|
||||
"Post --[noun, markdown post tab button]--": "Post",
|
||||
@@ -302,6 +294,7 @@
|
||||
"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",
|
||||
@@ -309,9 +302,6 @@
|
||||
"upload": "upload",
|
||||
"Uploading thumbnail": "Uploading thumbnail",
|
||||
"Please wait for thumbnail to finish uploading": "Please wait for thumbnail to finish uploading",
|
||||
"A thumbnail is required. Please upload or provide an image URL above.": "A thumbnail is required. Please upload or provide an image URL above.",
|
||||
"Thumbnail is invalid.": "Thumbnail is invalid.",
|
||||
"Please reselect a file after changing the LBRY URL": "Please reselect a file after changing the LBRY URL",
|
||||
"API connection string": "API connection string",
|
||||
"Method": "Method",
|
||||
"Parameters": "Parameters",
|
||||
@@ -328,7 +318,6 @@
|
||||
"This file is downloaded.": "This file is downloaded.",
|
||||
"Featured content. Earn rewards for watching.": "Featured content. Earn rewards for watching.",
|
||||
"You are subscribed to this channel.": "You are subscribed to this channel.",
|
||||
"Your settings.": "Your settings.",
|
||||
"Remove from your library": "Remove from your library",
|
||||
"View tag": "View tag",
|
||||
"Customize Your Tags": "Customize Your Tags",
|
||||
@@ -384,11 +373,8 @@
|
||||
"Email Us": "Email Us",
|
||||
"Today": "Today",
|
||||
"All time": "All time",
|
||||
"Share on Reddit": "Share on Reddit",
|
||||
"Share on Facebook": "Share on Facebook",
|
||||
"Share On Twitter": "Share On Twitter",
|
||||
"Share on Telegram": "Share on Telegram",
|
||||
"Share via...": "Share via...",
|
||||
"View on lbry.tv": "View on lbry.tv",
|
||||
"You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.": "You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.",
|
||||
"Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?": "Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?",
|
||||
@@ -439,9 +425,6 @@
|
||||
"Redeem a custom reward code for": "Redeem a custom reward code for",
|
||||
"Redeem": "Redeem",
|
||||
"Code": "Code",
|
||||
"reward code not found": "reward code not found",
|
||||
"reward code required": "reward code required",
|
||||
"this code has expired": "this code has expired",
|
||||
"Nothing here": "Nothing here",
|
||||
"Upload something and claim this spot!": "Upload something and claim this spot!",
|
||||
"File Size": "File Size",
|
||||
@@ -451,7 +434,6 @@
|
||||
"Trending": "Trending",
|
||||
"Top": "Top",
|
||||
"New": "New",
|
||||
"New --[clears Publish Form]--": "New",
|
||||
"Loading": "Loading",
|
||||
"This file is in your library.": "This file is in your library.",
|
||||
"'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.": "'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.",
|
||||
@@ -477,7 +459,10 @@
|
||||
"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",
|
||||
@@ -486,10 +471,9 @@
|
||||
"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 and muted channels": "Blocked and muted channels",
|
||||
"Blocked channels": "Blocked channels",
|
||||
"Manage": "Manage",
|
||||
"Automatic dark mode": "Automatic dark mode",
|
||||
"24-hour clock": "24-hour clock",
|
||||
"Hide wallet balance in header": "Hide wallet balance in header",
|
||||
"Max Connections": "Max Connections",
|
||||
"For users with good bandwidth, try a higher value to improve streaming and download speeds. Low bandwidth users may benefit from a lower setting. Default is 4.": "For users with good bandwidth, try a higher value to improve streaming and download speeds. Low bandwidth users may benefit from a lower setting. Default is 4.",
|
||||
@@ -502,7 +486,6 @@
|
||||
"From --[the tip sender]--": "From",
|
||||
"From --[initial time]--": "From",
|
||||
"Not enough Credits": "Not enough Credits",
|
||||
"Decrease amount to account for transaction fee": "Decrease amount to account for transaction fee",
|
||||
"You have %credit_amount% in unclaimed rewards.": "You have %credit_amount% in unclaimed rewards.",
|
||||
"In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this channel from our applications.": "In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this channel from our applications.",
|
||||
"Read More": "Read More",
|
||||
@@ -514,7 +497,7 @@
|
||||
"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_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%.",
|
||||
"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.",
|
||||
"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%.",
|
||||
@@ -548,6 +531,7 @@
|
||||
"Extra Verification Needed": "Extra Verification Needed",
|
||||
"We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.": "We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.",
|
||||
"Verify phone number": "Verify phone number",
|
||||
"Verify Phone Number": "Verify Phone Number",
|
||||
"OR": "OR",
|
||||
"Proof via Credit": "Proof via Credit",
|
||||
"If you have a valid credit or debit card, you can use it to instantly prove your humanity. LBRY does not store your credit card information. There is no charge at all for this, now or in the future.": "If you have a valid credit or debit card, you can use it to instantly prove your humanity. LBRY does not store your credit card information. There is no charge at all for this, now or in the future.",
|
||||
@@ -583,6 +567,7 @@
|
||||
"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",
|
||||
@@ -622,9 +607,7 @@
|
||||
"Looks like you don't have any transactions.": "Looks like you don't have any transactions.",
|
||||
"If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.": "If Sync is on, LBRY will backup your wallet and preferences. If disabled, you are responsible for keeping a backup.",
|
||||
"Your update is now pending on LBRY. It will take a few minutes to appear for other users.": "Your update is now pending on LBRY. It will take a few minutes to appear for other users.",
|
||||
"Your livestream is now pending. You will be able to start shortly at the streaming dashboard.": "Your livestream is now pending. You will be able to start shortly at the streaming dashboard.",
|
||||
"Your file is now pending on LBRY. It will take a few minutes to appear for other users.": "Your file is now pending on LBRY. It will take a few minutes to appear for other users.",
|
||||
"Your video will appear on Odysee shortly.": "Your video will appear on Odysee shortly.",
|
||||
"Upload will continue in the background, please do not shut down immediately. Leaving the app running helps the network, thank you!": "Upload will continue in the background, please do not shut down immediately. Leaving the app running helps the network, thank you!",
|
||||
"No results for %query%": "No results for %query%",
|
||||
"You haven't downloaded anything from LBRY yet": "You haven't downloaded anything from LBRY yet",
|
||||
@@ -646,7 +629,7 @@
|
||||
"Claim Channels": "Claim Channels",
|
||||
"Say something about this...": "Say something about this...",
|
||||
"Update email preferences": "Update email preferences",
|
||||
"An account allows you to earn rewards and backup your data.": "An account allows you to earn rewards and backup your data.",
|
||||
"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%. 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.",
|
||||
@@ -698,9 +681,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%.",
|
||||
@@ -732,12 +715,10 @@
|
||||
"This is an experiment, and may be removed in the future. Upload something with the #homepagecagematch tag to battle for the top spot on the home page!": "This is an experiment, and may be removed in the future. Upload something with the #homepagecagematch tag to battle for the top spot on the home page!",
|
||||
"Publishing": "Publishing",
|
||||
"Update published": "Update published",
|
||||
"Livestream Created": "Livestream Created",
|
||||
"Delete this file from my computer": "Delete this file from my computer",
|
||||
"Are you sure you'd like to remove %title% from LBRY?": "Are you sure you'd like to remove %title% from LBRY?",
|
||||
"reclaim %amount%": "reclaim %amount%",
|
||||
"Abandon on blockchain (%lbc%)": "Abandon on blockchain (%lbc%)",
|
||||
"Abandon on blockchain (reclaim %lbc%)": "Abandon on blockchain (reclaim %lbc%)",
|
||||
"This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.": "This will increase the overall bid amount for this content, which will boost its ability to be discovered while active.",
|
||||
"Show this channel your appreciation by sending a donation.": "Show this channel your appreciation by sending a donation.",
|
||||
"LBRY Link": "LBRY Link",
|
||||
@@ -780,7 +761,6 @@
|
||||
"Invite sent to %email_address%": "Invite sent to %email_address%",
|
||||
"Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.": "Woah, you have a lot of friends! You've claimed the maximum amount of invite rewards. Email %email% if you'd like to be whitelisted for more invites.",
|
||||
"Earn %lbc% for inviting a friend, an enemy, a frenemy, or an enefriend. Everyone needs content freedom.": "Earn %lbc% for inviting a friend, an enemy, a frenemy, or an enefriend. Everyone needs content freedom.",
|
||||
"You earned %lbc% for helping LBRY grow. Friendship is magic.": "You earned %lbc% for helping LBRY grow. Friendship is magic.",
|
||||
"This content requires LBRY Desktop to display.": "This content requires LBRY Desktop to display.",
|
||||
"Get the App": "Get the App",
|
||||
"Get The App": "Get The App",
|
||||
@@ -822,7 +802,6 @@
|
||||
"try again in a few seconds.": "try again in a few seconds.",
|
||||
"Any": "Any",
|
||||
"Video": "Video",
|
||||
"Video/Audio": "Video/Audio",
|
||||
"Document": "Document",
|
||||
"Duration": "Duration",
|
||||
"Long": "Long",
|
||||
@@ -834,7 +813,6 @@
|
||||
"gaming, crypto": "gaming, crypto",
|
||||
"Autocomplete": "Autocomplete",
|
||||
"Followed Tags": "Followed Tags",
|
||||
"Manage Tags": "Manage Tags",
|
||||
"%selectTagsLabel% (%number% left)": "%selectTagsLabel% (%number% left)",
|
||||
"Matching": "Matching",
|
||||
"Please check your deposit amount.": "Please check your deposit amount.",
|
||||
@@ -846,6 +824,8 @@
|
||||
"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%",
|
||||
@@ -879,9 +859,11 @@
|
||||
"Tag selection": "Tag selection",
|
||||
"Select some tags to help us show you interesting things.": "Select some tags to help us show you interesting things.",
|
||||
"You are currently following %followingCount% tags": "You are currently following %followingCount% tags",
|
||||
"You are currently following %followingCount% tag": "You are currently following %followingCount% tag",
|
||||
"Back": "Back",
|
||||
"Experimental Transcoding": "Experimental Transcoding",
|
||||
"A Folder containing FFmpeg": "A Folder containing FFmpeg",
|
||||
"Check again": "Check again",
|
||||
"FFmpeg could not be found. Navigate to it or Install, Then %check_again% or quit and restart the app. %learn_more%": "FFmpeg could not be found. Navigate to it or Install, Then %check_again% or quit and restart the app. %learn_more%",
|
||||
"FFmpeg is correctly configured. %learn_more%": "FFmpeg is correctly configured. %learn_more%",
|
||||
"Finnish": "Finnish",
|
||||
@@ -906,7 +888,6 @@
|
||||
"Total Staked Amount": "Total Staked Amount",
|
||||
"Set Inviter": "Set Inviter",
|
||||
"Change Inviter": "Change Inviter",
|
||||
"Reward claimed.": "Reward claimed.",
|
||||
"You haven't uploaded anything yet. This is where you can find them when you do!": "You haven't uploaded anything yet. This is where you can find them when you do!",
|
||||
"You haven't uploaded anything with this channel yet!": "You haven't uploaded anything with this channel yet!",
|
||||
"You haven't uploaded anything": "You haven't uploaded anything",
|
||||
@@ -926,6 +907,7 @@
|
||||
"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.",
|
||||
@@ -939,7 +921,6 @@
|
||||
"Embed this content": "Embed this content",
|
||||
"More actions": "More actions",
|
||||
"music": "music",
|
||||
"Music": "Music",
|
||||
"Transactions": "Transactions",
|
||||
"Payment": "Payment",
|
||||
"Stream": "Stream",
|
||||
@@ -965,7 +946,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 %SITE_NAME% password": "Enter your %SITE_NAME% password",
|
||||
"Enter Your lbry.tv Password": "Enter Your lbry.tv Password",
|
||||
"Logging in as %email%": "Logging in as %email%",
|
||||
"Forgot Password?": "Forgot Password?",
|
||||
"Use Magic Link": "Use Magic Link",
|
||||
@@ -983,9 +964,6 @@
|
||||
"Successfully abandoned your support.": "Successfully abandoned your support.",
|
||||
"Transaction failed": "Transaction failed",
|
||||
"Insufficient credits": "Insufficient credits",
|
||||
"Error abandoning your claim/support": "Error abandoning your claim/support",
|
||||
"Error unlocking your tip": "Error unlocking your tip",
|
||||
"You deposited %lbc% as a support!": "You deposited %lbc% as a support!",
|
||||
"You deposited %amount% LBRY Credits as a support!": "You deposited %amount% LBRY Credits as a support!",
|
||||
"You sent %amount% LBRY Credits as a tip, Mahalo!": "You sent %amount% LBRY Credits as a tip, Mahalo!",
|
||||
"You sent %amount% LBRY Credits": "You sent %amount% LBRY Credits",
|
||||
@@ -1047,6 +1025,9 @@
|
||||
"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",
|
||||
@@ -1064,7 +1045,6 @@
|
||||
"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?",
|
||||
"more --[value for \"more_information\"]--": "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.",
|
||||
"Please %sign_in_link% to comment.": "Please %sign_in_link% to comment.",
|
||||
"Replying as %reply_channel%": "Replying as %reply_channel%",
|
||||
@@ -1151,7 +1131,6 @@
|
||||
"Update Your Password": "Update Your Password",
|
||||
"Your Wallet is Empty": "Your Wallet is Empty",
|
||||
"Buy Credits": "Buy Credits",
|
||||
"Buy/Swap Credits": "Buy/Swap Credits",
|
||||
"LBRY, Inc. partners with Moonpay to provide the option to purchase LBRY Credits. %learn_more%.": "LBRY, Inc. partners with Moonpay to provide the option to purchase LBRY Credits. %learn_more%.",
|
||||
"Earn Rewards": "Earn Rewards",
|
||||
"Rewards are currently disabled for your account. Turn on diagnostic data sharing, in %settings%, to re-enable them.": "Rewards are currently disabled for your account. Turn on diagnostic data sharing, in %settings%, to re-enable them.",
|
||||
@@ -1193,19 +1172,18 @@
|
||||
"Changelog": "Changelog",
|
||||
"Boost your content": "Boost your content",
|
||||
"Boost This Video": "Boost This Video",
|
||||
"Boost This Content": "Boost This Content",
|
||||
"Boost": "Boost",
|
||||
"Send Revocable Support": "Send Revocable Support",
|
||||
"Send a %amount% Tip": "Send a %amount% Tip",
|
||||
"Channel to show support as": "Channel to show support as",
|
||||
"Buy more LBRY Credits": "Buy more LBRY Credits",
|
||||
"Buy or swap more LBRY Credits": "Buy or swap more LBRY Credits",
|
||||
"Support this content": "Support this content",
|
||||
"Make this a tip": "Make this a tip",
|
||||
"Custom support amount": "Custom support amount",
|
||||
"(%lbc_balance% Credits available)": "(%lbc_balance% Credits available)",
|
||||
"Loading your channels...": "Loading your channels...",
|
||||
"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",
|
||||
@@ -1229,15 +1207,12 @@
|
||||
"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",
|
||||
"Log In With YouTube": "Log In With YouTube",
|
||||
"You're free!": "You're free!",
|
||||
"Welcome to Odysee": "Welcome to Odysee",
|
||||
"You've escaped the land of spying, censorship, and exploitation.": "You've escaped the land of spying, censorship, and exploitation.",
|
||||
"Welcome to the land of content freedom.": "Welcome to the land of content freedom.",
|
||||
"You make the party extra special!": "You make the party extra special!",
|
||||
"Cover": "Cover",
|
||||
"A name is required for your url": "A name is required for your url",
|
||||
"Create Channel": "Create Channel",
|
||||
@@ -1254,12 +1229,8 @@
|
||||
"%image_type% %recommended_ratio%": "%image_type% %recommended_ratio%",
|
||||
"%label% • File to upload": "%label% • File to upload",
|
||||
"Video file": "Video file",
|
||||
"Select video or audio file to upload": "Select video or audio file to upload",
|
||||
"Select a file to upload": "Select a file to upload",
|
||||
"Select file to upload": "Select file to upload",
|
||||
"Url copied.": "Url copied.",
|
||||
"Select video file to upload": "Select video file to upload",
|
||||
"Uploading...": "Uploading...",
|
||||
"Creating...": "Creating...",
|
||||
"Use a URL": "Use a URL",
|
||||
"Edit Cover Image": "Edit Cover Image",
|
||||
"Cover Image": "Cover Image",
|
||||
@@ -1293,34 +1264,20 @@
|
||||
"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",
|
||||
"All uploads": "All uploads",
|
||||
"Advanced settings": "Advanced settings",
|
||||
"Browse": "Browse",
|
||||
"Automatic transcoding": "Automatic transcoding",
|
||||
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'.": "Add tags that are relevant to your content so those who're looking for it can find it more easily. If your content is best suited for mature audiences, ensure it is tagged 'mature'.",
|
||||
"Add tags that are relevant to your content so those who're looking for it can find it more easily. If mature content, ensure it is tagged mature. Tag abuse and missing mature tags will not be tolerated.": "Add tags that are relevant to your content so those who're looking for it can find it more easily. If mature content, ensure it is tagged mature. Tag abuse and missing mature tags will not be tolerated.",
|
||||
"%site_name% Terms of Service": "%site_name% Terms of Service",
|
||||
"Descriptive titles work best": "Descriptive titles work best",
|
||||
"What is your content about? Use this space to include any other relevant details you may like to share about your content and channel.": "What is your content about? Use this space to include any other relevant details you may like to share about your content and channel.",
|
||||
"Nothing uploaded to LBRY yet.": "Nothing uploaded to LBRY yet.",
|
||||
"Copyright notice": "Copyright notice",
|
||||
"Upload complete.": "Upload complete.",
|
||||
"Upload Complete": "Upload Complete",
|
||||
"Uploading": "Uploading",
|
||||
"View My Uploads": "View My Uploads",
|
||||
"View My Dashboard": "View My Dashboard",
|
||||
"No recent uploads": "No recent uploads",
|
||||
"Removing...": "Removing...",
|
||||
"License description": "License description",
|
||||
@@ -1362,7 +1319,6 @@
|
||||
"Tech": "Tech",
|
||||
"Lab": "Lab",
|
||||
"Technology": "Technology",
|
||||
"Movies": "Movies",
|
||||
"News": "News",
|
||||
"News & Politics": "News & Politics",
|
||||
"Finance 2.0": "Finance 2.0",
|
||||
@@ -1372,12 +1328,7 @@
|
||||
"Sync YouTube Channel": "Sync YouTube Channel",
|
||||
"Terms": "Terms",
|
||||
"Privacy Policy": "Privacy Policy",
|
||||
"Replies": "Replies",
|
||||
"Others": "Others",
|
||||
"HyperChat": "HyperChat",
|
||||
"New Content": "New Content",
|
||||
"No notifications": "No notifications",
|
||||
"Try selecting another filter.": "Try selecting another filter.",
|
||||
"You don't have any notifications yet, but they will be here when you do!": "You don't have any notifications yet, but they will be here when you do!",
|
||||
"I like this": "I like this",
|
||||
"I dislike this": "I dislike this",
|
||||
@@ -1385,22 +1336,16 @@
|
||||
"An account with %domain% allows you to earn rewards and backup your data.": "An account with %domain% allows you to earn rewards and backup your data.",
|
||||
"Sync my YouTube channel": "Sync my YouTube channel",
|
||||
"Log in to %SITE_NAME%": "Log in to %SITE_NAME%",
|
||||
"Log in": "Log in",
|
||||
"Not Yet": "Not Yet",
|
||||
"Preparing...": "Preparing...",
|
||||
"Confirm Upload": "Confirm Upload",
|
||||
"Confirm Edit": "Confirm Edit",
|
||||
"Create Livestream": "Create Livestream",
|
||||
"File": "File",
|
||||
"Video/audio file": "Video/audio file",
|
||||
"Transcode": "Transcode",
|
||||
"Estimated transaction fee:": "Estimated transaction fee:",
|
||||
"Est. transaction fee:": "Est. transaction fee:",
|
||||
"Skip preview and confirmation": "Skip preview and confirmation",
|
||||
"Upload settings": "Upload settings",
|
||||
"Currently uploading": "Currently uploading",
|
||||
"Your files are currently uploading.": "Your files are currently uploading.",
|
||||
"Your file is currently uploading.": "Your file is currently uploading.",
|
||||
"Enable Sync": "Enable Sync",
|
||||
"Disable Sync": "Disable Sync",
|
||||
"Getting your profiles...": "Getting your profiles...",
|
||||
@@ -1408,6 +1353,7 @@
|
||||
"Disabling sync will switch to your local profile.": "Disabling sync will switch to your local profile.",
|
||||
"To enable Sync, close LBRY completely and check 'Remember Password' during wallet unlock.": "To enable Sync, close LBRY completely and check 'Remember Password' during wallet unlock.",
|
||||
"Something went wrong. Please %click_here% to learn about sync limitations.": "Something went wrong. Please %click_here% to learn about sync limitations.",
|
||||
"Buy LBC": "Buy LBC",
|
||||
"Continue...": "Continue...",
|
||||
"Leave a comment": "Leave a comment",
|
||||
"Be the first to comment!": "Be the first to comment!",
|
||||
@@ -1427,8 +1373,6 @@
|
||||
"Controversial": "Controversial",
|
||||
"Show Replies": "Show Replies",
|
||||
"Unable to create comment, please try again later.": "Unable to create comment, please try again later.",
|
||||
"Unable to comment. This channel has blocked you.": "Unable to comment. This channel has blocked you.",
|
||||
"The comment contains contents that are blocked by %author%": "The comment contains contents that are blocked by %author%",
|
||||
"Your channel is still being setup, try again in a few moments.": "Your channel is still being setup, try again in a few moments.",
|
||||
"Unable to delete this comment, please try again later.": "Unable to delete this comment, please try again later.",
|
||||
"Unable to edit this comment, please try again later.": "Unable to edit this comment, please try again later.",
|
||||
@@ -1451,41 +1395,33 @@
|
||||
"Never fear though, there are tons of ways to earn %lbc%. You can earn or purchase %lbc%, or you can have your friends send you some.": "Never fear though, there are tons of ways to earn %lbc%. You can earn or purchase %lbc%, or you can have your friends send you some.",
|
||||
"gaming, comedy, educational": "gaming, comedy, educational",
|
||||
"A channel is required to comment on %SITE_NAME%": "A channel is required to comment on %SITE_NAME%",
|
||||
"A channel is required to comment on lbry.tv": "A channel is required to comment on lbry.tv",
|
||||
"A welcome bonus and thank you for your contribution to content freedom.": "A welcome bonus and thank you for your contribution to content freedom.",
|
||||
"You earned %lbc% new user reward.": "You earned %lbc% new user reward.",
|
||||
"Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.": "Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.",
|
||||
"Claim your channel! Create an identity used to securely publish content.": "Claim your channel! Create an identity used to securely publish content.",
|
||||
"You earned %lbc% for creating a channel.": "You earned %lbc% for creating a channel.",
|
||||
"Launch your own channel by sharing a video.": "Launch your own channel by sharing a video.",
|
||||
"You earned %lbc% for making your first upload.": "You earned %lbc% for making your first upload.",
|
||||
"Your First Credit:": "Your First Credit:",
|
||||
"Return to the app 24-48 hours following your first use of the app. This reward will self destruct after that time span.": "Return to the app 24-48 hours following your first use of the app. This reward will self destruct after that time span.",
|
||||
"Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 2). Only up to 10 views per day count.": "Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 2). Only up to 10 views per day count.",
|
||||
"Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 1).": "Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 1).",
|
||||
"A small amount of Credits to get you started.": "A small amount of Credits to get you started.",
|
||||
"Gain a following to earn this reward. 1 validated followers needed for level 1 (Current Score: 0). This amount may not match your total followers.": "Gain a following to earn this reward. 1 validated followers needed for level 1 (Current Score: 0). This amount may not match your total followers.",
|
||||
"Some extra Credits for you and the person that brought you to us.": "Some extra Credits for you and the person that brought you to us.",
|
||||
"Daily Watch Reward": "Daily Watch Reward",
|
||||
"%SITE_NAME% view reward": "%SITE_NAME% view reward",
|
||||
"You earned %lbc% for looking at neat stuff. ": "You earned %lbc% for looking at neat stuff. ",
|
||||
"Earn a random reward of at least %lbc% for watching anything at all.": "Earn a random reward of at least %lbc% for watching anything at all.",
|
||||
"You have already claimed this reward within the last 24 hours.": "You have already claimed this reward within the last 24 hours.",
|
||||
"Please watch some content to earn this reward.": "Please watch some content to earn this reward.",
|
||||
"You will receive an SMS text message confirming your phone number is valid.": "You will receive an SMS text message confirming your phone number is valid.",
|
||||
"Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.": "Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.",
|
||||
"Your First Nickel": "Your First Nickel",
|
||||
"Your First Credit": "Your First Credit",
|
||||
"Go for a Stream": "Go for a Stream",
|
||||
"Channel Surfing": "Channel Surfing",
|
||||
"First Upload": "First Upload",
|
||||
"Welcome Back": "Welcome Back",
|
||||
"You earned %lbc% for coming back.": "You earned %lbc% for coming back.",
|
||||
"Email Verified": "Email Verified",
|
||||
"You earned %lbc% for adding your email.": "You earned %lbc% for adding your email.",
|
||||
"Inviter Bonus": "Inviter Bonus",
|
||||
"You earned %lbc% reward for you and your friend.": "You earned %lbc% reward for you and your friend.",
|
||||
"Daily Watch Reward": "Daily Watch Reward",
|
||||
"Odyseenaut": "Odyseenaut",
|
||||
"Watch 10 things, like 5 things, and leave a comment on odysee.com.": "Watch 10 things, like 5 things, and leave a comment on odysee.com.",
|
||||
"You earned %lbc% for trying out Odysee.": "You earned %lbc% for trying out Odysee.",
|
||||
"Earn an upgrade reward with each LBRY update. Patches will not trigger a new reward.": "Earn an upgrade reward with each LBRY update. Patches will not trigger a new reward.",
|
||||
"You earned %lbc% for upgrading to the latest release of LBRY.": "You earned %lbc% for upgrading to the latest release of LBRY.",
|
||||
"Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 1). Only up to 10 views per day count.": "Watch content and earn more Credits for each level unlocked! 10 views required for level 1 (Current Score: 1). Only up to 10 views per day count.",
|
||||
"Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 12).": "Follow your favorite creators and earn more Credits for each level unlocked! Follow 1 creators for level 1 (Current Score: 12).",
|
||||
"Create A Channel": "Create A Channel",
|
||||
"At least 10 views are required to earn the reward, consume more!": "At least 10 views are required to earn the reward, consume more!",
|
||||
"Blocked %channel%": "Blocked %channel%",
|
||||
@@ -1508,30 +1444,12 @@
|
||||
"You earned %lbc% for successfully completing Coveted Creator L3: Score of Subs.": "You earned %lbc% for successfully completing Coveted Creator L3: Score of Subs.",
|
||||
"You earned %lbc% for successfully completing Coveted Creator L2: High Five.": "You earned %lbc% for successfully completing Coveted Creator L2: High Five.",
|
||||
"You earned %lbc% for successfully completing Coveted Creator L1: Loneliest Number.": "You earned %lbc% for successfully completing Coveted Creator L1: Loneliest Number.",
|
||||
"Favorite Five 🖐️": "Favorite Five 🖐️",
|
||||
"When creators repost other creators, it makes a delicious shared audience fondue. Repost 5 of your favorite creators with the qualified channel.": "When creators repost other creators, it makes a delicious shared audience fondue. Repost 5 of your favorite creators with the qualified channel.",
|
||||
"You earned %lbc% for reposting your favorite creators.": "You earned %lbc% for reposting your favorite creators.",
|
||||
"🎁 Treats are available": "🎁 Treats are available",
|
||||
"Claiming your daily reward is as easy as pressing this bell 🔔": "Claiming your daily reward is as easy as pressing this bell 🔔",
|
||||
"Press ▶️ for 🎁": "Press ▶️ for 🎁",
|
||||
"Your daily watch reward is ready": "Your daily watch reward is ready",
|
||||
"Subscribe and s̶̶a̶̶v̶̶e̶ Earn": "Subscribe and s̶̶a̶̶v̶̶e̶ Earn",
|
||||
"Follow your first channel for a reward 🎁": "Follow your first channel for a reward 🎁",
|
||||
"Free LBC?": "Free LBC?",
|
||||
"Free Credits?": "Free Credits?",
|
||||
"You missed out on the daily view reward, sign up for our rewards program!": "You missed out on the daily view reward, sign up for our rewards program!",
|
||||
"A Welcome 🎁": "A Welcome 🎁",
|
||||
"Receive free Credits just for doing what you're already doing": "Receive free Credits just for doing what you're already doing",
|
||||
"Watch more content to get to the next level.": "Watch more content to get to the next level.",
|
||||
"Follow more channels to reach the next level.": "Follow more channels to reach the next level.",
|
||||
"You need to improve the cool-aid (gain more followers) to get to the next level.": "You need to improve the cool-aid (gain more followers) to get to the next level.",
|
||||
"A channel is required to repost on %SITE_NAME%": "A channel is required to repost on %SITE_NAME%",
|
||||
"A channel is required to repost on lbry.tv": "A channel is required to repost on lbry.tv",
|
||||
"No channels": "No channels",
|
||||
"You haven't created a channel yet. All of your beautiful channels will be listed here!": "You haven't created a channel yet. All of your beautiful channels will be listed here!",
|
||||
"Something didn't work. Please try again.": "Something didn't work. Please try again.",
|
||||
"Sync your YouTube channel to %site_name%": "Sync your YouTube channel to %site_name%",
|
||||
"You earned %lbc% for syncing your YouTube channel.": "You earned %lbc% for syncing your YouTube channel.",
|
||||
"Get your YouTube videos in front of the %site_name% audience.": "Get your YouTube videos in front of the %site_name% audience.",
|
||||
"Your %site_name% channel name": "Your %site_name% channel name",
|
||||
"these terms": "these terms",
|
||||
@@ -1574,7 +1492,6 @@
|
||||
"Pin": "Pin",
|
||||
"Unpin": "Unpin",
|
||||
"LBRY leveled up": "LBRY leveled up",
|
||||
"Channel language": "Channel language",
|
||||
"Primary Language": "Primary Language",
|
||||
"Your main content language": "Your main content language",
|
||||
"None selected": "None selected",
|
||||
@@ -1583,14 +1500,10 @@
|
||||
"Search only in this language by default": "Search only in this language by default",
|
||||
"This link leads to an external website.": "This link leads to an external website.",
|
||||
"No Content Found": "No Content Found",
|
||||
"No Lists Found": "No Lists Found",
|
||||
"No Reposts Found": "No Reposts Found",
|
||||
"Publish Something": "Publish Something",
|
||||
"Repost Something": "Repost Something",
|
||||
"Watch on lbry.tv": "Watch on lbry.tv",
|
||||
"Paid content cannot be embedded.": "Paid content cannot be embedded.",
|
||||
"Please wait a bit, we are still getting your account ready.": "Please wait a bit, we are still getting your account ready.",
|
||||
"this channel is connected to a different account. Contact hello@lbry.com for help.": "this channel is connected to a different account. Contact hello@lbry.com for help.",
|
||||
"Most supported": "Most supported",
|
||||
"Most Supported": "Most Supported",
|
||||
"Search Results": "Search Results",
|
||||
@@ -1624,13 +1537,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",
|
||||
"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.",
|
||||
"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.",
|
||||
"Content preview": "Content preview",
|
||||
"Repost url": "Repost url",
|
||||
"Repost URL": "Repost URL",
|
||||
"Close sidebar - hide channels you are following": "Close sidebar - hide channels you are following",
|
||||
"Expand sidebar - view channels you are following.": "Expand sidebar - view channels you are following.",
|
||||
"You have found the edge of the internet. %repost% or %publish% your stuff here to claim this spot.": "You have found the edge of the internet. %repost% or %publish% your stuff here to claim this spot.",
|
||||
@@ -1671,286 +1581,10 @@
|
||||
"%balance% available.": "%balance% available.",
|
||||
"Unlock all tips": "Unlock all tips",
|
||||
"Unlock All": "Unlock All",
|
||||
"just like the simulations": "just like the simulations",
|
||||
"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",
|
||||
"Nothing found here. Like big tech ethics.": "Nothing found here. Like big tech ethics.",
|
||||
"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",
|
||||
"Announcements, updates, and rewards specific to users of LBRY Android.": "Announcements, updates, and rewards specific to users of LBRY Android.",
|
||||
"LBRY has special programs and opportunities for people in school.": "LBRY has special programs and opportunities for people in school.",
|
||||
"Creator specific news, automated reports, and other updates.": "Creator specific news, automated reports, and other updates.",
|
||||
"Get notified when other channels repost your content.": "Get notified when other channels repost your content.",
|
||||
"Technical updates and other news for software engineers and technical users.": "Technical updates and other news for software engineers and technical users.",
|
||||
"Be an iOS alpha tester, earn LBC, and receive notification when the app goes live!": "Be an iOS alpha tester, earn LBC, and receive notification when the app goes live!",
|
||||
"News and updates from LBRY": "News and updates from LBRY",
|
||||
"Announcements, updates, and rewards specific to users of LBRY Desktop": "Announcements, updates, and rewards specific to users of LBRY Desktop",
|
||||
"Communications about lbry.org, the community-owned and operated LBRY group": "Communications about lbry.org, the community-owned and operated LBRY group",
|
||||
"Announcements, updates, and rewards specific to users of lbry.tv": "Announcements, updates, and rewards specific to users of lbry.tv",
|
||||
"Receive emails about the latest rewards that are available to LBRY users.": "Receive emails about the latest rewards that are available to LBRY users.",
|
||||
"Stay up to date on the latest content from your favorite creators.": "Stay up to date on the latest content from your favorite creators.",
|
||||
"Receive tutorial emails related to LBRY ": "Receive tutorial emails related to LBRY ",
|
||||
"Create A LiveStream": "Create A LiveStream",
|
||||
"%channel% has disabled chat for this stream. Enjoy the stream!": "%channel% has disabled chat for this stream. Enjoy the stream!",
|
||||
"%channel% isn't live right now, but the chat is! Check back later to watch the stream.": "%channel% isn't live right now, but the chat is! Check back later to watch the stream.",
|
||||
"Right now": "Right now",
|
||||
"%viewer_count% currently watching": "%viewer_count% currently watching",
|
||||
"Slowmode is on. You can comment again in %time% seconds.": "Slowmode is on. You can comment again in %time% seconds.",
|
||||
"Live stream in progress": "Live stream in progress",
|
||||
"Live discussion": "Live discussion",
|
||||
"Livestream": "Livestream",
|
||||
"Your stream key": "Your stream key",
|
||||
"Stream server": "Stream server",
|
||||
"Stream key": "Stream key",
|
||||
"Your livestream uploads": "Your livestream uploads",
|
||||
"Your pending livestream uploads": "Your pending livestream uploads",
|
||||
"No livestream publishes found": "No livestream publishes found",
|
||||
"Nothing here yet. %check_again%": "Nothing here yet. %check_again%",
|
||||
"Check again": "Check again",
|
||||
"Check again...": "Check again...",
|
||||
"You need to upload your livestream details before you can go live. If you already created one in this channel, it should appear soon.": "You need to upload your livestream details before you can go live. If you already created one in this channel, it should appear soon.",
|
||||
"Create A Livestream": "Create A Livestream",
|
||||
"Create a Livestream by first submitting your Livestream details and waiting for approval confirmation.": "Create a Livestream by first submitting your Livestream details and waiting for approval confirmation.",
|
||||
"The livestream will not be visible on your channel until you are live, but you can share the URL in advance.": "The livestream will not be visible on your channel until you are live, but you can share the URL in advance.",
|
||||
"Once the your livestream is confirmed, configure your streaming software (OBS, Restream, etc) and input the server URL along with the stream key in it.": "Once the your livestream is confirmed, configure your streaming software (OBS, Restream, etc) and input the server URL along with the stream key in it.",
|
||||
"To ensure the best streaming experience with OBS, open settings -> output": "To ensure the best streaming experience with OBS, open settings -> output",
|
||||
"Select advanced mode from the dropdown at the top.": "Select advanced mode from the dropdown at the top.",
|
||||
"Ensure the following settings are selected under the streaming tab:": "Ensure the following settings are selected under the streaming tab:",
|
||||
"Bitrate: 1000 to 2500 kbps": "Bitrate: 1000 to 2500 kbps",
|
||||
"Keyframes: 1": "Keyframes: 1",
|
||||
"Profile: High": "Profile: High",
|
||||
"Tune: Zerolatency": "Tune: Zerolatency",
|
||||
"If using other livestreaming software, make sure the bitrate is below 5000 kbps or the stream will not work.": "If using other livestreaming software, make sure the bitrate is below 5000 kbps or the stream will not work.",
|
||||
"Please note: You'll need to record your own stream through your software if you plan to share it afterward. You can also delete it if you prefer not to upload the copy.": "Please note: You'll need to record your own stream through your software if you plan to share it afterward. You can also delete it if you prefer not to upload the copy.",
|
||||
"In the near future, this manual step will be removed and you will be able to share the stream right after its finished without needing to record it yourself.": "In the near future, this manual step will be removed and you will be able to share the stream right after its finished without needing to record it yourself.",
|
||||
"After your livestream:\nClick the Publish Replay button. This will allow you to edit details before sharing on Odysee. Be sure to select the saved mp4 file you recorded.": "After your livestream:\nClick the Publish Replay button. This will allow you to edit details before sharing on Odysee. Be sure to select the saved mp4 file you recorded.",
|
||||
"Click Save and you are done!": "Click Save and you are done!",
|
||||
"How does this work?": "How does this work?",
|
||||
"Update your livestream": "Update your livestream",
|
||||
"Prepare an upcoming livestream": "Prepare an upcoming livestream",
|
||||
"Edit your post": "Edit your post",
|
||||
"Update your video": "Update your video",
|
||||
"Go Live on Odysee": "Go Live on Odysee",
|
||||
"You're invited to try out our new livestreaming service while in beta!": "You're invited to try out our new livestreaming service while in beta!",
|
||||
"lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead": "lbry.tv is being retired in favor of %odysee% and new sign ups are disabled. Sign up on %odysee% instead",
|
||||
"lbry.tv is being retired in favor of %odysee%": "lbry.tv is being retired in favor of %odysee%",
|
||||
"You will have to switch to the %desktop_app% or %odysee% in the near future. Your existing login details will work on %odysee% and all of your %credits% and other settings will be there.": "You will have to switch to the %desktop_app% or %odysee% in the near future. Your existing login details will work on %odysee% and all of your %credits% and other settings will be there.",
|
||||
"Swap": "Swap",
|
||||
"Swap Crypto": "Swap Crypto",
|
||||
"Enter desired %lbc%": "Enter desired %lbc%",
|
||||
"Estimated BTC price": "Estimated BTC price",
|
||||
"Start Swap": "Start Swap",
|
||||
"To": "To",
|
||||
"Receiving": "Receiving",
|
||||
"Send crypto to the address provided and you will be sent an equivalent amount of Credits. You can pay with BCH, LTC, ETH, USDC or DAI after starting the swap.": "Send crypto to the address provided and you will be sent an equivalent amount of Credits. You can pay with BCH, LTC, ETH, USDC or DAI after starting the swap.",
|
||||
"Swap Crypto for %lbc%": "Swap Crypto for %lbc%",
|
||||
"Processing...": "Processing...",
|
||||
"View Past Swaps": "View Past Swaps",
|
||||
"Remove swap": "Remove swap",
|
||||
"Waiting": "Waiting",
|
||||
"Waiting to receive your crypto.": "Waiting to receive your crypto.",
|
||||
"Confirming transaction.": "Confirming transaction.",
|
||||
"Sending Credits": "Sending Credits",
|
||||
"Crypto received. Sending your Credits.": "Crypto received. Sending your Credits.",
|
||||
"Completed": "Completed",
|
||||
"Credits sent. You should see it in your wallet.": "Credits sent. You should see it in your wallet.",
|
||||
"Expired": "Expired",
|
||||
"Swap expired.": "Swap expired.",
|
||||
"Failed": "Failed",
|
||||
"An error occurred on the previous swap.": "An error occurred on the previous swap.",
|
||||
"Alternative coins": "Alternative coins",
|
||||
"Failed to initiate swap.": "Failed to initiate swap.",
|
||||
"Failed to query swap status.": "Failed to query swap status.",
|
||||
"The system is currently down. Come back later.": "The system is currently down. Come back later.",
|
||||
"Unable to obtain exchange rate. Try again later.": "Unable to obtain exchange rate. Try again later.",
|
||||
"The amount needs to be higher": "The amount needs to be higher",
|
||||
"The amount is too high": "The amount is too high",
|
||||
"Confirm Swap Removal": "Confirm Swap Removal",
|
||||
"Remove Swap": "Remove Swap",
|
||||
"Remove %address%?": "Remove %address%?",
|
||||
"This process cannot be reversed.": "This process cannot be reversed.",
|
||||
"View transaction": "View transaction",
|
||||
"Use the copy button to ensure the EXACT amount is sent!": "Use the copy button to ensure the EXACT amount is sent!",
|
||||
"Amount copied.": "Amount copied.",
|
||||
"Copy transaction ID": "Copy transaction ID",
|
||||
"Transaction ID copied.": "Transaction ID copied.",
|
||||
"This page can be closed while the transactions are in progress.\nYou can view the status later from:\n • Wallet » Swap » View Past Swaps": "This page can be closed while the transactions are in progress.\nYou can view the status later from:\n • Wallet » Swap » View Past Swaps",
|
||||
"Credits sent": "Credits sent",
|
||||
"Unresolved": "Unresolved",
|
||||
"Received amount did not match order code %chargeCode%. Contact hello@lbry.com to resolve the payment.": "Received amount did not match order code %chargeCode%. Contact hello@lbry.com to resolve the payment.",
|
||||
"Users are currently limited to 4 completed swaps per month or 5 pending swaps.": "Users are currently limited to 4 completed swaps per month or 5 pending swaps.",
|
||||
"publish": "publish",
|
||||
"Sexual content": "Sexual content",
|
||||
"Violent or repulsive content": "Violent or repulsive content",
|
||||
"Hateful or abusive content": "Hateful or abusive content",
|
||||
"Harmful or dangerous acts": "Harmful or dangerous acts",
|
||||
"Child abuse": "Child abuse",
|
||||
"Promotes terrorism": "Promotes terrorism",
|
||||
"Spam or misleading": "Spam or misleading",
|
||||
"Infringes my rights": "Infringes my rights",
|
||||
"Next": "Next",
|
||||
"Graphic sexual activity": "Graphic sexual activity",
|
||||
"Nudity": "Nudity",
|
||||
"Suggestive, but without nudity": "Suggestive, but without nudity",
|
||||
"Content involving minors": "Content involving minors",
|
||||
"Sexual Abusive title or description": "Sexual Abusive title or description",
|
||||
"Other sexual content": "Other sexual content",
|
||||
"Timestamp": "Timestamp",
|
||||
"Provide additional details": "Provide additional details",
|
||||
"e.g. John Doe": "e.g. John Doe",
|
||||
"e.g. john@example.com": "e.g. john@example.com",
|
||||
"e.g. satoshi@example.com": "e.g. satoshi@example.com",
|
||||
"Your channel": "Your channel",
|
||||
"Set to \"Anonymous\" if you do not want to associate your channel in this report.": "Set to \"Anonymous\" if you do not want to associate your channel in this report.",
|
||||
"Send report?": "Send report?",
|
||||
"Send Report": "Send Report",
|
||||
"Contact details": "Contact details",
|
||||
"Report submitted": "Report submitted",
|
||||
"We will review and respond shortly.": "We will review and respond shortly.",
|
||||
"Adults fighting": "Adults fighting",
|
||||
"Physical attack": "Physical attack",
|
||||
"Youth violence": "Youth violence",
|
||||
"Animal abuse": "Animal abuse",
|
||||
"Promotes hatred or violence": "Promotes hatred or violence",
|
||||
"Bullying": "Bullying",
|
||||
"Hateful Abusive title or description": "Hateful Abusive title or description",
|
||||
"Pharmaceutical or drug abuse": "Pharmaceutical or drug abuse",
|
||||
"Abuse of fire or explosives": "Abuse of fire or explosives",
|
||||
"Suicide or self injury": "Suicide or self injury",
|
||||
"Other dangerous acts": "Other dangerous acts",
|
||||
"Mass advertising": "Mass advertising",
|
||||
"Pharmaceutical drugs for sale": "Pharmaceutical drugs for sale",
|
||||
"Misleading text": "Misleading text",
|
||||
"Misleading thumbnail": "Misleading thumbnail",
|
||||
"Scams or fraud": "Scams or fraud",
|
||||
"Copyright issue": "Copyright issue",
|
||||
"Other legal issue": "Other legal issue",
|
||||
"Affected party": "Affected party",
|
||||
"Myself": "Myself",
|
||||
"My company, organization, or client": "My company, organization, or client",
|
||||
"Copyright owner name": "Copyright owner name",
|
||||
"Relationship to copyrighted content": "Relationship to copyrighted content",
|
||||
"(between 10 to 500 characters)": "(between 10 to 500 characters)",
|
||||
"Remove now": "Remove now",
|
||||
"Additional email (optional)": "Additional email (optional)",
|
||||
"Phone number": "Phone number",
|
||||
"Address": "Address",
|
||||
"City": "City",
|
||||
"State/province": "State/province",
|
||||
"Zip code": "Zip code",
|
||||
"Signature": "Signature",
|
||||
"Your name": "Your name",
|
||||
"Acting on behalf of": "Acting on behalf of",
|
||||
"Self": "Self",
|
||||
"Client": "Client",
|
||||
"Title of specific law": "Title of specific law",
|
||||
"Specific law": "Specific law",
|
||||
"Law URL": "Law URL",
|
||||
"Clarification": "Clarification",
|
||||
"Client name": "Client name",
|
||||
"Creator settings": "Creator settings",
|
||||
"Muted words": "Muted words",
|
||||
"Add words": "Add words",
|
||||
"Suggestions": "Suggestions",
|
||||
"Add words to block": "Add words to block",
|
||||
"Enable comments for channel.": "Enable comments for channel.",
|
||||
"Minimum time gap in seconds for Slow Mode in livestream chat.": "Minimum time gap in seconds for Slow Mode in livestream chat.",
|
||||
"Minimum %lbc% tip amount for comments": "Minimum %lbc% tip amount for comments",
|
||||
"Enabling a minimum amount to comment will force all comments, including livestreams, to have tips associated with them. This can help prevent spam.": "Enabling a minimum amount to comment will force all comments, including livestreams, to have tips associated with them. This can help prevent spam.",
|
||||
"Minimum %lbc% tip amount for hyperchats": "Minimum %lbc% tip amount for hyperchats",
|
||||
"Enabling a minimum amount to hyperchat will force all TIPPED comments to have this value in order to be shown. This still allows regular comments to be posted.": "Enabling a minimum amount to hyperchat will force all TIPPED comments to have this value in order to be shown. This still allows regular comments to be posted.",
|
||||
"Settings unavailable for this channel": "Settings unavailable for this channel",
|
||||
"This channel isn't staking enough LBRY Credits to enable Creator Settings.": "This channel isn't staking enough LBRY Credits to enable Creator Settings.",
|
||||
"We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.": "We apologize for this inconvenience, but have added this additional step to prevent abuse. Users on VPN or shared connections will continue to see this message and are not eligible for Rewards.",
|
||||
"Help LBRY Save Crypto": "Help LBRY Save Crypto",
|
||||
"The US government is attempting to destroy the cryptocurrency industry. Can you help?": "The US government is attempting to destroy the cryptocurrency industry. Can you help?",
|
||||
"Learn more and sign petition": "Learn more and sign petition",
|
||||
"View claim details": "View claim details",
|
||||
"Publishing...": "Publishing...",
|
||||
"Collection": "Collection",
|
||||
"Enter a name, @username or URL": "Enter a name, @username or URL:",
|
||||
"Recipient search": "Recipient search",
|
||||
"Fetch transaction data for export": "Fetch transaction data for export",
|
||||
"Fetching data": "Fetching data",
|
||||
"Download fetched file": "Download fetched file",
|
||||
"No data to export": "No data to export",
|
||||
"Failed to process fetched data.": "Failed to process fetched data.",
|
||||
"More from %claim_name%": "More from %claim_name%",
|
||||
"Update your video/audio": "Update your video/audio",
|
||||
"Upload that unlabeled video you found behind the TV in 1991": "Upload that unlabeled video you found behind the TV in 1991",
|
||||
"Upload that unlabeled video or cassette you found behind the TV in 1991": "Upload that unlabeled video or cassette you found behind the TV in 1991",
|
||||
"Select Replay": "Select Replay",
|
||||
"Craft an epic post clearly explaining... whatever.": "Craft an epic post clearly explaining... whatever.",
|
||||
"%viewer_count% currently %viewer_state%": "%viewer_count% currently %viewer_state%",
|
||||
"watching": "watching",
|
||||
"waiting": "waiting",
|
||||
"Choose Replay": "Choose Replay",
|
||||
"Choose a replay file, or select None": "Choose a replay file, or select None",
|
||||
"No replays found.": "No replays found.",
|
||||
"Replay video available": "Replay video available",
|
||||
"Check for Replays:": "Check for Replays",
|
||||
"You can upload your own recording or select a replay when your stream is over": "You can upload your own recording or select a replay when your stream is over",
|
||||
"This channel isn't staking enough LBRY Credits for inline image previews.": "This channel isn't staking enough LBRY Credits for inline image previews.",
|
||||
"Latest": "Latest",
|
||||
"Channel Not Found": "Channel Not Found",
|
||||
"Probably because you didn't make it.": "Probably because you didn't make it.",
|
||||
"Release date": "Release date",
|
||||
"Set custom release date": "Set custom release date",
|
||||
"Now": "Now",
|
||||
"Set to current date and time": "Set to current date and time",
|
||||
"Remove custom release date": "Remove custom release date",
|
||||
"%SITE_NAME% login": "%SITE_NAME% login",
|
||||
"Lists": "Lists",
|
||||
"Watch Later": "Watch Later",
|
||||
"Add to Lists": "Add to Lists",
|
||||
"Nothing in %collection_name%": "Nothing in %collection_name%",
|
||||
"Playlists": "Playlists",
|
||||
"Edit List": "Edit List",
|
||||
"Delete List": "Delete List",
|
||||
"Private": "Private",
|
||||
"View List": "View List",
|
||||
"Delete Collection": "Delete Collection",
|
||||
"Info": "Info",
|
||||
"Publishes": "Publishes",
|
||||
"Add To...": "Add To...",
|
||||
"Unpublished Edits": "Unpublished Edits",
|
||||
"Report channel": "Report channel",
|
||||
"List": "List",
|
||||
"Items": "Items",
|
||||
"Credits": "Credits",
|
||||
"MyAwesomeCollection": "MyAwesomeCollection",
|
||||
"My Awesome Collection": "My Awesome Collection",
|
||||
"This collection has no items.": "This collection has no items.",
|
||||
"Select File": "Select File",
|
||||
"File Selected": "File Selected",
|
||||
"Url": "Url",
|
||||
"URL Selected": "URL Selected",
|
||||
"Keep": "Keep",
|
||||
"Add this claim to a list": "Add this claim to a list",
|
||||
"List is Empty": "List is Empty",
|
||||
"Confirm Collection Unpublish": "Confirm Collection Unpublish",
|
||||
"This will permanently delete the list.": "This will permanently delete the list.",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
+20
-26
@@ -26,10 +26,10 @@ if (isProduction) {
|
||||
// @endif
|
||||
|
||||
type Analytics = {
|
||||
error: (string) => Promise<any>,
|
||||
error: string => Promise<any>,
|
||||
sentryError: ({} | string, {}) => Promise<any>,
|
||||
pageView: (string, ?string) => void,
|
||||
setUser: (Object) => void,
|
||||
setUser: Object => void,
|
||||
toggleInternal: (boolean, ?boolean) => void,
|
||||
apiLogView: (string, string, string, ?number, ?() => void) => Promise<any>,
|
||||
apiLogPublish: (ChannelClaim | StreamClaim) => void,
|
||||
@@ -38,9 +38,6 @@ type Analytics = {
|
||||
playerLoadedEvent: (?boolean) => void,
|
||||
playerStartedEvent: (?boolean) => void,
|
||||
videoStartEvent: (string, number) => void,
|
||||
adsFetchedEvent: () => void,
|
||||
adsReceivedEvent: (any) => void,
|
||||
adsErrorEvent: (any) => void,
|
||||
videoBufferEvent: (
|
||||
StreamClaim,
|
||||
{
|
||||
@@ -57,9 +54,9 @@ type Analytics = {
|
||||
emailVerifiedEvent: () => void,
|
||||
rewardEligibleEvent: () => void,
|
||||
startupEvent: () => void,
|
||||
purchaseEvent: (number) => void,
|
||||
readyEvent: (number) => void,
|
||||
openUrlEvent: (string) => void,
|
||||
purchaseEvent: number => void,
|
||||
readyEvent: number => void,
|
||||
openUrlEvent: string => void,
|
||||
};
|
||||
|
||||
type LogPublishParams = {
|
||||
@@ -77,8 +74,8 @@ if (window.localStorage.getItem(SHARE_INTERNAL) === 'true') internalAnalyticsEna
|
||||
// @endif
|
||||
|
||||
const analytics: Analytics = {
|
||||
error: (message) => {
|
||||
return new Promise((resolve) => {
|
||||
error: message => {
|
||||
return new Promise(resolve => {
|
||||
if (internalAnalyticsEnabled && isProduction) {
|
||||
return Lbryio.call('event', 'desktop_error', { error_message: message }).then(() => {
|
||||
resolve(true);
|
||||
@@ -89,9 +86,9 @@ const analytics: Analytics = {
|
||||
});
|
||||
},
|
||||
sentryError: (error, errorInfo) => {
|
||||
return new Promise((resolve) => {
|
||||
return new Promise(resolve => {
|
||||
if (internalAnalyticsEnabled && isProduction) {
|
||||
Sentry.withScope((scope) => {
|
||||
Sentry.withScope(scope => {
|
||||
scope.setExtras(errorInfo);
|
||||
const eventId = Sentry.captureException(error);
|
||||
resolve(eventId);
|
||||
@@ -116,7 +113,7 @@ const analytics: Analytics = {
|
||||
MatomoInstance.trackPageView(params);
|
||||
}
|
||||
},
|
||||
setUser: (userId) => {
|
||||
setUser: userId => {
|
||||
if (internalAnalyticsEnabled && userId) {
|
||||
window._paq.push(['setUserId', String(userId)]);
|
||||
// @if TARGET='app'
|
||||
@@ -190,12 +187,18 @@ const analytics: Analytics = {
|
||||
}
|
||||
},
|
||||
|
||||
apiSyncTags: (params) => {
|
||||
apiSyncTags: params => {
|
||||
if (internalAnalyticsEnabled && isProduction) {
|
||||
Lbryio.call('content_tags', 'sync', params);
|
||||
}
|
||||
},
|
||||
|
||||
apiSearchFeedback: (query, vote) => {
|
||||
if (isProduction) {
|
||||
// We don't need to worry about analytics enabled here because users manually click on the button to provide feedback
|
||||
Lbryio.call('feedback', 'search', { query, vote });
|
||||
}
|
||||
},
|
||||
videoStartEvent: (claimId, duration) => {
|
||||
sendPromMetric('time_to_start', duration);
|
||||
sendMatomoEvent('Media', 'TimeToStart', claimId, duration);
|
||||
@@ -228,19 +231,10 @@ const analytics: Analytics = {
|
||||
});
|
||||
}
|
||||
},
|
||||
adsFetchedEvent: () => {
|
||||
sendMatomoEvent('Media', 'AdsFetched');
|
||||
},
|
||||
adsReceivedEvent: (response) => {
|
||||
sendMatomoEvent('Media', 'AdsReceived', JSON.stringify(response));
|
||||
},
|
||||
adsErrorEvent: (response) => {
|
||||
sendMatomoEvent('Media', 'AdsError', JSON.stringify(response));
|
||||
},
|
||||
playerLoadedEvent: (embedded) => {
|
||||
playerLoadedEvent: embedded => {
|
||||
sendMatomoEvent('Player', 'Loaded', embedded ? 'embedded' : 'onsite');
|
||||
},
|
||||
playerStartedEvent: (embedded) => {
|
||||
playerStartedEvent: embedded => {
|
||||
sendMatomoEvent('Player', 'Started', embedded ? 'embedded' : 'onsite');
|
||||
},
|
||||
tagFollowEvent: (tag, following) => {
|
||||
@@ -315,7 +309,7 @@ analytics.pageView(
|
||||
|
||||
// Listen for url changes and report
|
||||
// This will include search queries
|
||||
history.listen((location) => {
|
||||
history.listen(location => {
|
||||
const { pathname, search } = location;
|
||||
|
||||
const page = `${pathname}${search}`;
|
||||
|
||||
+2
-16
@@ -6,17 +6,8 @@ const Comments = {
|
||||
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),
|
||||
comment_create: (params: CommentCreateParams) => fetchCommentsApi('comment.Create', params),
|
||||
setting_list: (params: SettingsParams) => fetchCommentsApi('setting.List', params),
|
||||
setting_block_word: (params: BlockWordParams) => fetchCommentsApi('setting.BlockWord', params),
|
||||
setting_unblock_word: (params: BlockWordParams) => fetchCommentsApi('setting.UnBlockWord', params),
|
||||
setting_list_blocked_words: (params: SettingsParams) => fetchCommentsApi('setting.ListBlockedWords', params),
|
||||
setting_update: (params: UpdateSettingsParams) => fetchCommentsApi('setting.Update', params),
|
||||
super_list: (params: SuperListParams) => fetchCommentsApi('comment.SuperChatList', params),
|
||||
};
|
||||
|
||||
function fetchCommentsApi(method: string, params: {}) {
|
||||
@@ -39,13 +30,8 @@ function fetchCommentsApi(method: string, params: {}) {
|
||||
};
|
||||
|
||||
return fetch(url, options)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
if (res.error) {
|
||||
throw new Error(res.error.message);
|
||||
}
|
||||
return res.result;
|
||||
});
|
||||
.then(res => res.json())
|
||||
.then(res => res.result);
|
||||
}
|
||||
|
||||
export default Comments;
|
||||
@@ -30,6 +30,6 @@ export default function I18nMessage(props: Props) {
|
||||
return (
|
||||
// style={{height: iframeHeight}}
|
||||
// ref={iframeRef}
|
||||
<iframe src={src} title={title} onLoad={onLoad} sandbox={!IS_WEB} />
|
||||
<iframe src={src} title={title} onLoad={onLoad} />
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
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) => ({});
|
||||
const select = (state, props) => ({
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
});
|
||||
|
||||
export default connect(select)(AbandonedChannelPreview);
|
||||
export default connect(select, {
|
||||
doChannelUnsubscribe,
|
||||
doOpenModal,
|
||||
})(AbandonedChannelPreview);
|
||||
@@ -2,19 +2,28 @@
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import Button from 'component/button';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import ChannelBlockButton from 'component/channelBlockButton';
|
||||
import ChannelMuteButton from 'component/channelMuteButton';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import * as ICONS from '../../constants/icons';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
|
||||
type SubscriptionArgs = {
|
||||
channelName: string,
|
||||
uri: string,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
doChannelUnsubscribe: SubscriptionArgs => void,
|
||||
type: string,
|
||||
blockedChannelUris: Array<string>,
|
||||
doOpenModal: (string, {}) => void,
|
||||
};
|
||||
|
||||
function AbandonedChannelPreview(props: Props) {
|
||||
const { uri, type } = props;
|
||||
const { uri, doChannelUnsubscribe, type, blockedChannelUris, doOpenModal } = props;
|
||||
const { channelName } = parseURI(uri);
|
||||
const isBlockedChannel = blockedChannelUris.includes(uri);
|
||||
|
||||
return (
|
||||
<li className={classnames('claim-preview__wrapper', 'claim-preview__wrapper--notice')}>
|
||||
@@ -28,11 +37,31 @@ function AbandonedChannelPreview(props: Props) {
|
||||
<div className="media__subtitle">{__(`This channel may have been unpublished.`)}</div>
|
||||
</div>
|
||||
<div className="claim-preview__actions">
|
||||
<div className="section__actions">
|
||||
<ChannelBlockButton uri={uri} />
|
||||
<ChannelMuteButton uri={uri} />
|
||||
<SubscribeButton uri={uri} />
|
||||
</div>
|
||||
{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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@ 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, doFetchCollectionListMine, SETTINGS, selectMyChannelUrls } from 'lbry-redux';
|
||||
import { doFetchChannelListMine, selectMyChannelUrls, SETTINGS } from 'lbry-redux';
|
||||
import {
|
||||
makeSelectClientSetting,
|
||||
selectLanguage,
|
||||
@@ -27,10 +27,9 @@ import {
|
||||
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),
|
||||
@@ -49,20 +48,18 @@ const select = (state) => ({
|
||||
myChannelUrls: selectMyChannelUrls(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
const perform = dispatch => ({
|
||||
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
fetchCollectionListMine: () => dispatch(doFetchCollectionListMine()),
|
||||
setLanguage: (language) => dispatch(doSetLanguage(language)),
|
||||
setLanguage: language => dispatch(doSetLanguage(language)),
|
||||
signIn: () => dispatch(doSignIn()),
|
||||
requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()),
|
||||
updatePreferences: () => dispatch(doGetAndPopulatePreferences()),
|
||||
getWalletSyncPref: () => dispatch(doGetWalletSyncPreference()),
|
||||
syncLoop: (noInterval) => dispatch(doSyncLoop(noInterval)),
|
||||
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));
|
||||
+12
-28
@@ -4,7 +4,6 @@ import React, { useEffect, useRef, useState } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import analytics from 'analytics';
|
||||
import { buildURI, parseURI } from 'lbry-redux';
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import Router from 'component/router/index';
|
||||
import ModalRouter from 'modal/modalRouter';
|
||||
import ReactModal from 'react-modal';
|
||||
@@ -57,15 +56,14 @@ type Props = {
|
||||
goForward: () => void,
|
||||
index: number,
|
||||
length: number,
|
||||
push: (string) => void,
|
||||
push: string => void,
|
||||
},
|
||||
fetchAccessToken: () => void,
|
||||
fetchChannelListMine: () => void,
|
||||
fetchCollectionListMine: () => void,
|
||||
signIn: () => void,
|
||||
requestDownloadUpgrade: () => void,
|
||||
onSignedIn: () => void,
|
||||
setLanguage: (string) => void,
|
||||
setLanguage: string => void,
|
||||
isUpgradeAvailable: boolean,
|
||||
autoUpdateDownloaded: boolean,
|
||||
updatePreferences: () => Promise<any>,
|
||||
@@ -85,8 +83,7 @@ type Props = {
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
myChannelUrls: ?Array<string>,
|
||||
setActiveChannelIfNotSet: () => void,
|
||||
setIncognito: (boolean) => void,
|
||||
fetchModBlockedList: () => void,
|
||||
setIncognito: boolean => void,
|
||||
};
|
||||
|
||||
function App(props: Props) {
|
||||
@@ -95,7 +92,6 @@ function App(props: Props) {
|
||||
user,
|
||||
fetchAccessToken,
|
||||
fetchChannelListMine,
|
||||
fetchCollectionListMine,
|
||||
signIn,
|
||||
autoUpdateDownloaded,
|
||||
isUpgradeAvailable,
|
||||
@@ -118,7 +114,6 @@ function App(props: Props) {
|
||||
activeChannelClaim,
|
||||
setActiveChannelIfNotSet,
|
||||
setIncognito,
|
||||
fetchModBlockedList,
|
||||
} = props;
|
||||
|
||||
const appRef = useRef();
|
||||
@@ -139,7 +134,7 @@ 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(':', '#');
|
||||
@@ -171,7 +166,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
|
||||
};
|
||||
@@ -181,7 +176,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();
|
||||
@@ -197,7 +192,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();
|
||||
}
|
||||
@@ -235,9 +230,8 @@ function App(props: Props) {
|
||||
|
||||
// @if TARGET='app'
|
||||
fetchChannelListMine(); // This is fetched after a user is signed in on web
|
||||
fetchCollectionListMine();
|
||||
// @endif
|
||||
}, [appRef, fetchAccessToken, fetchChannelListMine, fetchCollectionListMine]);
|
||||
}, [appRef, fetchAccessToken, fetchChannelListMine]);
|
||||
|
||||
useEffect(() => {
|
||||
// $FlowFixMe
|
||||
@@ -250,10 +244,6 @@ function App(props: Props) {
|
||||
} else if (hasNoChannels) {
|
||||
setIncognito(true);
|
||||
}
|
||||
|
||||
if (hasMyChannels) {
|
||||
fetchModBlockedList();
|
||||
}
|
||||
}, [hasMyChannels, hasNoChannels, hasActiveChannelClaim, setActiveChannelIfNotSet, setIncognito]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -356,13 +346,7 @@ function App(props: Props) {
|
||||
// @endif
|
||||
|
||||
if (syncFatalError) {
|
||||
return (
|
||||
<SyncFatalError
|
||||
// @if TARGET='web'
|
||||
lbryTvApiStatus={lbryTvApiStatus}
|
||||
// @endif
|
||||
/>
|
||||
);
|
||||
return <SyncFatalError />;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -374,7 +358,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
|
||||
@@ -403,12 +387,12 @@ function App(props: Props) {
|
||||
|
||||
{/* @if TARGET='web' */}
|
||||
<YoutubeWelcome />
|
||||
{!SIMPLE_SITE && !shouldHideNag && <OpenInAppLink uri={uri} />}
|
||||
{!shouldHideNag && <OpenInAppLink uri={uri} />}
|
||||
{!shouldHideNag && <NagContinueFirstRun />}
|
||||
{(lbryTvApiStatus === STATUS_DEGRADED || lbryTvApiStatus === STATUS_FAILING) && !shouldHideNag && (
|
||||
<NagDegradedPerformance onClose={() => setLbryTvApiStatus(STATUS_OK)} />
|
||||
)}
|
||||
{!SIMPLE_SITE && lbryTvApiStatus === STATUS_OK && showAnalyticsNag && !shouldHideNag && (
|
||||
{lbryTvApiStatus === STATUS_OK && showAnalyticsNag && !shouldHideNag && (
|
||||
<NagDataCollection onClose={handleAnalyticsDismiss} />
|
||||
)}
|
||||
{/* @endif */}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, SETTINGS, COLLECTIONS_CONSTS, makeSelectNextUrlForCollectionAndUrl } from 'lbry-redux';
|
||||
import { makeSelectClaimForUri, SETTINGS } from 'lbry-redux';
|
||||
import { withRouter } from 'react-router';
|
||||
import { makeSelectIsPlayerFloating, makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
@@ -8,24 +8,11 @@ import AutoplayCountdown from './view';
|
||||
import { selectModal } from 'redux/selectors/app';
|
||||
|
||||
/*
|
||||
AutoplayCountdown does not fetch it's own next content to play, it relies on <RecommendedContent> being rendered.
|
||||
This is dumb but I'm just the guy who noticed -kj
|
||||
AutoplayCountdown does not fetch it's own next content to play, it relies on <RecommendedContent> being rendered. This is dumb but I'm just the guy who noticed
|
||||
*/
|
||||
const select = (state, props) => {
|
||||
const { location } = props;
|
||||
const { search } = location;
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID);
|
||||
|
||||
let nextRecommendedUri;
|
||||
if (collectionId) {
|
||||
nextRecommendedUri = makeSelectNextUrlForCollectionAndUrl(collectionId, props.uri)(state);
|
||||
} else {
|
||||
nextRecommendedUri = makeSelectNextUnplayedRecommended(props.uri)(state);
|
||||
}
|
||||
|
||||
const nextRecommendedUri = makeSelectNextUnplayedRecommended(props.uri)(state);
|
||||
return {
|
||||
collectionId,
|
||||
nextRecommendedUri,
|
||||
nextRecommendedClaim: makeSelectClaimForUri(nextRecommendedUri)(state),
|
||||
isFloating: makeSelectIsPlayerFloating(props.location)(state),
|
||||
|
||||
@@ -6,19 +6,18 @@ import I18nMessage from 'component/i18nMessage';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { withRouter } from 'react-router';
|
||||
import debounce from 'util/debounce';
|
||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
|
||||
const DEBOUNCE_SCROLL_HANDLER_MS = 150;
|
||||
const CLASSNAME_AUTOPLAY_COUNTDOWN = 'autoplay-countdown';
|
||||
|
||||
type Props = {
|
||||
history: { push: (string) => void },
|
||||
history: { push: string => void },
|
||||
nextRecommendedClaim: ?StreamClaim,
|
||||
nextRecommendedUri: string,
|
||||
isFloating: boolean,
|
||||
doSetPlayingUri: ({ uri: ?string }) => void,
|
||||
doPlayUri: (string) => void,
|
||||
doPlayUri: string => void,
|
||||
modal: { id: string, modalProps: {} },
|
||||
collectionId?: string,
|
||||
};
|
||||
|
||||
function AutoplayCountdown(props: Props) {
|
||||
@@ -30,7 +29,6 @@ function AutoplayCountdown(props: Props) {
|
||||
isFloating,
|
||||
history: { push },
|
||||
modal,
|
||||
collectionId,
|
||||
} = props;
|
||||
const nextTitle = nextRecommendedClaim && nextRecommendedClaim.value && nextRecommendedClaim.value.title;
|
||||
|
||||
@@ -46,11 +44,6 @@ function AutoplayCountdown(props: Props) {
|
||||
let navigateUrl;
|
||||
if (nextTitle) {
|
||||
navigateUrl = formatLbryUrlForWeb(nextRecommendedUri);
|
||||
if (collectionId) {
|
||||
const collectionParams = new URLSearchParams();
|
||||
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, collectionId);
|
||||
navigateUrl = navigateUrl + `?` + collectionParams.toString();
|
||||
}
|
||||
}
|
||||
|
||||
const doNavigate = useCallback(() => {
|
||||
@@ -78,7 +71,7 @@ function AutoplayCountdown(props: Props) {
|
||||
// Ensure correct 'setTimerPaused' on initial render.
|
||||
setTimerPaused(shouldPauseAutoplay());
|
||||
|
||||
const handleScroll = debounce((e) => {
|
||||
const handleScroll = debounce(e => {
|
||||
setTimerPaused(shouldPauseAutoplay());
|
||||
}, DEBOUNCE_SCROLL_HANDLER_MS);
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
@@ -0,0 +1,49 @@
|
||||
// @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;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ function ChannelAbout(props: Props) {
|
||||
<Fragment>
|
||||
<label>{__('Contact')}</label>
|
||||
<div className="media__info-text">
|
||||
<MarkdownPreview content={formatEmail(email)} simpleLinks />
|
||||
<MarkdownPreview content={formatEmail(email)} />
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
@@ -56,7 +56,7 @@ function ChannelAbout(props: Props) {
|
||||
<Fragment>
|
||||
<label>{__('Site')}</label>
|
||||
<div className="media__info-text">
|
||||
<MarkdownPreview content={website} simpleLinks />
|
||||
<MarkdownPreview content={website} />
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
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);
|
||||
@@ -1,41 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
isBlocked: boolean,
|
||||
isBlockingOrUnBlocking: boolean,
|
||||
doCommentModUnBlock: (string, boolean) => void,
|
||||
doCommentModBlock: (string, boolean) => void,
|
||||
};
|
||||
|
||||
function ChannelBlockButton(props: Props) {
|
||||
const { uri, doCommentModUnBlock, doCommentModBlock, isBlocked, isBlockingOrUnBlocking } = props;
|
||||
|
||||
function handleClick() {
|
||||
if (isBlocked) {
|
||||
doCommentModUnBlock(uri, false);
|
||||
} else {
|
||||
doCommentModBlock(uri, false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
button={isBlocked ? 'alt' : 'secondary'}
|
||||
label={
|
||||
isBlocked
|
||||
? isBlockingOrUnBlocking
|
||||
? __('Unblocking...')
|
||||
: __('Unblock')
|
||||
: isBlockingOrUnBlocking
|
||||
? __('Blocking...')
|
||||
: __('Block')
|
||||
}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelBlockButton;
|
||||
@@ -6,13 +6,12 @@ import {
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectTotalPagesInChannelSearch,
|
||||
makeSelectClaimForUri,
|
||||
doResolveUris,
|
||||
SETTINGS,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
|
||||
import { withRouter } from 'react-router';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { makeSelectClientSetting, selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
import ChannelPage from './view';
|
||||
|
||||
@@ -25,16 +24,12 @@ const select = (state, props) => {
|
||||
fetching: makeSelectFetchingChannelClaims(props.uri)(state),
|
||||
totalPages: makeSelectTotalPagesInChannelSearch(props.uri, PAGE_SIZE)(state),
|
||||
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
channelIsBlocked: makeSelectChannelIsMuted(props.uri)(state),
|
||||
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
||||
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
showMature: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
tileLayout: makeSelectClientSetting(SETTINGS.TILE_LAYOUT)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
doResolveUris: (uris, returnCachedUris) => dispatch(doResolveUris(uris, returnCachedUris)),
|
||||
});
|
||||
|
||||
export default withRouter(connect(select, perform)(ChannelPage));
|
||||
export default withRouter(connect(select)(ChannelPage));
|
||||
@@ -9,7 +9,6 @@ import Button from 'component/button';
|
||||
import ClaimListDiscover from 'component/claimListDiscover';
|
||||
import Ads from 'web/component/ads';
|
||||
import Icon from 'component/common/icon';
|
||||
import LivestreamLink from 'component/livestreamLink';
|
||||
import { Form, FormField } from 'component/common/form';
|
||||
import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search';
|
||||
import { lighthouse } from 'redux/actions/search';
|
||||
@@ -26,14 +25,10 @@ type Props = {
|
||||
channelIsBlackListed: boolean,
|
||||
defaultPageSize?: number,
|
||||
defaultInfiniteScroll?: Boolean,
|
||||
claim: Claim,
|
||||
claim: ?Claim,
|
||||
isAuthenticated: boolean,
|
||||
showMature: boolean,
|
||||
tileLayout: boolean,
|
||||
viewHiddenChannels: boolean,
|
||||
doResolveUris: (Array<string>, boolean) => void,
|
||||
claimType: string,
|
||||
empty?: string,
|
||||
};
|
||||
|
||||
function ChannelContent(props: Props) {
|
||||
@@ -49,10 +44,6 @@ function ChannelContent(props: Props) {
|
||||
defaultInfiniteScroll = true,
|
||||
showMature,
|
||||
tileLayout,
|
||||
viewHiddenChannels,
|
||||
doResolveUris,
|
||||
claimType,
|
||||
empty,
|
||||
} = props;
|
||||
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
||||
const [searchQuery, setSearchQuery] = React.useState('');
|
||||
@@ -62,7 +53,6 @@ function ChannelContent(props: Props) {
|
||||
} = useHistory();
|
||||
const url = `${pathname}${search}`;
|
||||
const claimId = claim && claim.claim_id;
|
||||
const showFilters = !claimType || claimType === 'stream';
|
||||
|
||||
function handleInputChange(e) {
|
||||
const { value } = e.target;
|
||||
@@ -78,7 +68,7 @@ function ChannelContent(props: Props) {
|
||||
lighthouse
|
||||
.search(
|
||||
`s=${encodeURIComponent(searchQuery)}&channel_id=${encodeURIComponent(claimId)}${
|
||||
!showMature ? '&nsfw=false&size=50&from=0' : ''
|
||||
!showMature ? '&nsfw=false&size=25&from=0' : ''
|
||||
}`
|
||||
)
|
||||
.then((results) => {
|
||||
@@ -86,11 +76,6 @@ function ChannelContent(props: Props) {
|
||||
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(() => {
|
||||
@@ -112,8 +97,6 @@ function ChannelContent(props: Props) {
|
||||
<HiddenNsfwClaims uri={uri} />
|
||||
)}
|
||||
|
||||
<LivestreamLink uri={uri} />
|
||||
|
||||
{!fetching && channelIsBlackListed && (
|
||||
<section className="card card--section">
|
||||
<p>
|
||||
@@ -135,24 +118,18 @@ function ChannelContent(props: Props) {
|
||||
|
||||
{!channelIsMine && claimsInChannel > 0 && <HiddenNsfwClaims uri={uri} />}
|
||||
|
||||
<ClaimListDiscover
|
||||
hideLivestreamClaims
|
||||
showHiddenByUser={viewHiddenChannels}
|
||||
forceShowReposts
|
||||
hideFilters={!showFilters}
|
||||
hideAdvancedFilter={!showFilters}
|
||||
tileLayout={tileLayout}
|
||||
uris={searchResults}
|
||||
streamType={CS.CONTENT_ALL}
|
||||
channelIds={[claim.claim_id]}
|
||||
claimType={claimType}
|
||||
feeAmount={CS.FEE_AMOUNT_ANY}
|
||||
defaultOrderBy={CS.ORDER_BY_NEW}
|
||||
pageSize={defaultPageSize}
|
||||
infiniteScroll={defaultInfiniteScroll}
|
||||
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||
meta={
|
||||
showFilters && (
|
||||
{claim && claimsInChannel > 0 ? (
|
||||
<ClaimListDiscover
|
||||
forceShowReposts
|
||||
tileLayout={tileLayout}
|
||||
uris={searchResults}
|
||||
channelIds={[claim.claim_id]}
|
||||
feeAmount={CS.FEE_AMOUNT_ANY}
|
||||
defaultOrderBy={CS.ORDER_BY_NEW}
|
||||
pageSize={defaultPageSize}
|
||||
infiniteScroll={defaultInfiniteScroll}
|
||||
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||
meta={
|
||||
<Form onSubmit={() => {}} className="wunderbar--inline">
|
||||
<Icon icon={ICONS.SEARCH} />
|
||||
<FormField
|
||||
@@ -163,12 +140,11 @@ function ChannelContent(props: Props) {
|
||||
placeholder={__('Search')}
|
||||
/>
|
||||
</Form>
|
||||
)
|
||||
}
|
||||
isChannel
|
||||
channelIsMine={channelIsMine}
|
||||
empty={empty}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<section className="main--empty">{__("This channel hasn't published anything yet")}</section>
|
||||
)}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
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);
|
||||
@@ -0,0 +1,149 @@
|
||||
// @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';
|
||||
import WalletSpendableBalanceHelp from 'component/walletSpendableBalanceHelp';
|
||||
|
||||
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 available 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.'
|
||||
)}
|
||||
<WalletSpendableBalanceHelp inline />
|
||||
</>
|
||||
}
|
||||
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;
|
||||
@@ -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,16 +38,12 @@ 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, (channelClaim) => {
|
||||
dispatch(doUpdateBlockListForPublishedChannel(channelClaim));
|
||||
})
|
||||
);
|
||||
return dispatch(doCreateChannel('@' + name, amount, optionalParams));
|
||||
},
|
||||
clearChannelErrors: () => dispatch(doClearChannelErrors()),
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import classnames from 'classnames';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import TagsSearch from 'component/tagsSearch';
|
||||
import { FF_MAX_CHARS_IN_DESCRIPTION } from 'constants/form-field';
|
||||
import { FF_MAX_CHARS_IN_DESCRIPTION_CHANNEL } from 'constants/form-field';
|
||||
import ErrorText from 'component/common/error-text';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import { isNameValid, parseURI } from 'lbry-redux';
|
||||
@@ -20,8 +20,6 @@ import analytics from 'analytics';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import WalletSpendableBalanceHelp from 'component/walletSpendableBalanceHelp';
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import { sortLanguageMap } from 'util/default-languages';
|
||||
|
||||
const LANG_NONE = 'none';
|
||||
|
||||
@@ -41,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,
|
||||
@@ -120,7 +118,7 @@ function ChannelForm(props: Props) {
|
||||
languages: languages || [],
|
||||
locations: locations || [],
|
||||
tags: tags
|
||||
? tags.map((tag) => {
|
||||
? tags.map(tag => {
|
||||
return { name: tag };
|
||||
})
|
||||
: [],
|
||||
@@ -183,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();
|
||||
@@ -198,12 +196,6 @@ 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) {
|
||||
@@ -230,7 +222,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'),
|
||||
@@ -254,7 +246,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'),
|
||||
@@ -305,7 +297,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>}
|
||||
@@ -316,7 +308,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"
|
||||
@@ -324,8 +316,8 @@ function ChannelForm(props: Props) {
|
||||
label={__('Description')}
|
||||
placeholder={__('Description of your content')}
|
||||
value={params.description}
|
||||
onChange={(text) => setParams({ ...params, description: text })}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}
|
||||
onChange={text => setParams({ ...params, description: text })}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION_CHANNEL}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
@@ -344,7 +336,7 @@ 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={
|
||||
<>
|
||||
@@ -360,23 +352,22 @@ function ChannelForm(props: Props) {
|
||||
<Card
|
||||
body={
|
||||
<TagsSearch
|
||||
suggestMature={!SIMPLE_SITE}
|
||||
suggestMature
|
||||
disableAutoFocus
|
||||
disableControlTags
|
||||
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) });
|
||||
}
|
||||
});
|
||||
}}
|
||||
@@ -395,7 +386,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"
|
||||
@@ -404,22 +395,22 @@ 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>
|
||||
{sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
|
||||
<option key={langKey} value={langKey}>
|
||||
{langName}
|
||||
{Object.keys(SUPPORTED_LANGUAGES).map(language => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
@@ -427,7 +418,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')}
|
||||
@@ -435,11 +426,13 @@ function ChannelForm(props: Props) {
|
||||
<option key={'sec-langNone'} value={LANG_NONE}>
|
||||
{__('None selected')}
|
||||
</option>
|
||||
{sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
|
||||
<option key={langKey} value={langKey} disabled={langKey === languageParam[0]}>
|
||||
{langName}
|
||||
</option>
|
||||
))}
|
||||
{Object.keys(SUPPORTED_LANGUAGES)
|
||||
.filter(lang => lang !== languageParam[0])
|
||||
.map(language => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</>
|
||||
}
|
||||
@@ -463,8 +456,8 @@ function ChannelForm(props: Props) {
|
||||
/>
|
||||
<Button button="link" label={__('Cancel')} onClick={onDone} />
|
||||
</div>
|
||||
{errorMsg ? (
|
||||
<ErrorText>{errorMsg}</ErrorText>
|
||||
{updateError || createError ? (
|
||||
<ErrorText>{updateError || createError}</ErrorText>
|
||||
) : (
|
||||
<p className="help">
|
||||
{__('After submitting, it will take a few minutes for your changes to be live for everyone.')}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
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);
|
||||
@@ -0,0 +1,63 @@
|
||||
// @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;
|
||||
@@ -1,13 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doChannelMute, doChannelUnmute } 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, {
|
||||
doChannelMute,
|
||||
doChannelUnmute,
|
||||
})(ChannelMuteButton);
|
||||
@@ -1,33 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
isMuted: boolean,
|
||||
channelClaim: ?ChannelClaim,
|
||||
doChannelMute: (string, boolean) => void,
|
||||
doChannelUnmute: (string, boolean) => void,
|
||||
};
|
||||
|
||||
function ChannelBlockButton(props: Props) {
|
||||
const { uri, doChannelMute, doChannelUnmute, isMuted } = props;
|
||||
|
||||
function handleClick() {
|
||||
if (isMuted) {
|
||||
doChannelUnmute(uri, false);
|
||||
} else {
|
||||
doChannelMute(uri, false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
button={isMuted ? 'alt' : 'secondary'}
|
||||
label={isMuted ? __('Unmute') : __('Mute')}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelBlockButton;
|
||||
@@ -30,7 +30,7 @@ function ChannelListItem(props: ListItemProps) {
|
||||
|
||||
return (
|
||||
<div className={classnames('channel__list-item', { 'channel__list-item--selected': isSelected })}>
|
||||
<ChannelThumbnail uri={uri} hideStakedIndicator />
|
||||
<ChannelThumbnail uri={uri} />
|
||||
<ChannelTitle uri={uri} />
|
||||
{isSelected && <Icon icon={ICONS.DOWN} />}
|
||||
</div>
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectStakedLevelForChannelUri,
|
||||
makeSelectTotalStakedAmountForChannelUri,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectClaimForUri } 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);
|
||||
@@ -10,12 +10,30 @@ import CreditAmount from 'component/common/credit-amount';
|
||||
|
||||
type Props = {
|
||||
channelClaim: ChannelClaim,
|
||||
amount: number,
|
||||
level: number,
|
||||
large?: boolean,
|
||||
inline?: boolean,
|
||||
};
|
||||
|
||||
function getChannelLevel(amount: number): number {
|
||||
let level = 1;
|
||||
|
||||
switch (true) {
|
||||
case amount >= 1 && amount < 50:
|
||||
level = 2;
|
||||
break;
|
||||
case amount >= 50 && amount < 250:
|
||||
level = 3;
|
||||
break;
|
||||
case amount >= 250 && amount < 1000:
|
||||
level = 4;
|
||||
break;
|
||||
case amount >= 1000:
|
||||
level = 5;
|
||||
break;
|
||||
}
|
||||
|
||||
return level;
|
||||
}
|
||||
|
||||
function getChannelIcon(level: number): string {
|
||||
const icons = {
|
||||
'1': ICONS.CHANNEL_LEVEL_1,
|
||||
@@ -29,13 +47,15 @@ function getChannelIcon(level: number): string {
|
||||
}
|
||||
|
||||
function ChannelStakedIndicator(props: Props) {
|
||||
const { channelClaim, amount, level, large = false, inline = false } = props;
|
||||
const { channelClaim, large = false } = props;
|
||||
|
||||
if (!channelClaim || !channelClaim.meta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const amount = parseFloat(channelClaim.amount) + parseFloat(channelClaim.meta.support_amount) || 0;
|
||||
const isControlling = channelClaim && channelClaim.meta.is_controlling;
|
||||
const level = getChannelLevel(amount);
|
||||
const icon = getChannelIcon(level);
|
||||
|
||||
return (
|
||||
@@ -59,7 +79,6 @@ function ChannelStakedIndicator(props: Props) {
|
||||
<div
|
||||
className={classnames('channel-staked__wrapper', {
|
||||
'channel-staked__wrapper--large': large,
|
||||
'channel-staked__wrapper--inline': inline,
|
||||
})}
|
||||
>
|
||||
<LevelIcon icon={icon} large={large} isControlling={isControlling} />
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 120 B |
@@ -2,12 +2,9 @@
|
||||
import React from 'react';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import classnames from 'classnames';
|
||||
import Spaceman from './spaceman.png';
|
||||
import Transparent from './transparent_1x1.png';
|
||||
import Gerbil from './gerbil.png';
|
||||
import FreezeframeWrapper from 'component/fileThumbnail/FreezeframeWrapper';
|
||||
import ChannelStakedIndicator from 'component/channelStakedIndicator';
|
||||
import { getThumbnailCdnUrl } from 'util/thumbnail';
|
||||
import useLazyLoading from 'effects/use-lazy-loading';
|
||||
|
||||
type Props = {
|
||||
thumbnail: ?string,
|
||||
@@ -22,8 +19,6 @@ type Props = {
|
||||
isResolving: boolean,
|
||||
showDelayedMessage?: boolean,
|
||||
hideStakedIndicator?: boolean,
|
||||
xsmall?: boolean,
|
||||
noOptimization?: boolean,
|
||||
};
|
||||
|
||||
function ChannelThumbnail(props: Props) {
|
||||
@@ -34,23 +29,19 @@ function ChannelThumbnail(props: Props) {
|
||||
thumbnailPreview: rawThumbnailPreview,
|
||||
obscure,
|
||||
small = false,
|
||||
xsmall = false,
|
||||
allowGifs = false,
|
||||
claim,
|
||||
doResolveUri,
|
||||
isResolving,
|
||||
showDelayedMessage = false,
|
||||
hideStakedIndicator = false,
|
||||
noOptimization,
|
||||
} = props;
|
||||
const [thumbError, setThumbError] = React.useState(false);
|
||||
const shouldResolve = claim === undefined;
|
||||
const thumbnail = rawThumbnail && rawThumbnail.trim().replace(/^http:\/\//i, 'https://');
|
||||
const thumbnailPreview = rawThumbnailPreview && rawThumbnailPreview.trim().replace(/^http:\/\//i, 'https://');
|
||||
const channelThumbnail = thumbnail || thumbnailPreview;
|
||||
const isGif = channelThumbnail && channelThumbnail.endsWith('gif');
|
||||
const showThumb = (!obscure && !!thumbnail) || thumbnailPreview;
|
||||
const thumbnailRef = React.useRef(null);
|
||||
// Generate a random color class based on the first letter of the channel name
|
||||
const { channelName } = parseURI(uri);
|
||||
let initializer;
|
||||
@@ -68,9 +59,7 @@ function ChannelThumbnail(props: Props) {
|
||||
}
|
||||
}, [doResolveUri, shouldResolve, uri]);
|
||||
|
||||
useLazyLoading(thumbnailRef, 0.25, [showThumb, thumbError, channelThumbnail]);
|
||||
|
||||
if (isGif && !allowGifs) {
|
||||
if (channelThumbnail && channelThumbnail.endsWith('gif') && !allowGifs) {
|
||||
return (
|
||||
<FreezeframeWrapper src={channelThumbnail} className={classnames('channel-thumbnail', className)}>
|
||||
{!hideStakedIndicator && <ChannelStakedIndicator uri={uri} claim={claim} />}
|
||||
@@ -78,30 +67,19 @@ function ChannelThumbnail(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
let url = channelThumbnail;
|
||||
// @if TARGET='web'
|
||||
// Pass image urls through a compression proxy, except for GIFs.
|
||||
if (thumbnail && !noOptimization && !(isGif && allowGifs)) {
|
||||
url = getThumbnailCdnUrl({ thumbnail });
|
||||
}
|
||||
// @endif
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classnames('channel-thumbnail', className, {
|
||||
[colorClassName]: !showThumb,
|
||||
'channel-thumbnail--small': small,
|
||||
'channel-thumbnail--xsmall': xsmall,
|
||||
'channel-thumbnail--resolving': isResolving,
|
||||
})}
|
||||
>
|
||||
{!showThumb && (
|
||||
<img
|
||||
ref={thumbnailRef}
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__default"
|
||||
data-src={!thumbError && url ? url : Spaceman}
|
||||
src={Transparent}
|
||||
src={!thumbError && thumbnailPreview ? thumbnailPreview : Gerbil}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
)}
|
||||
@@ -111,11 +89,9 @@ function ChannelThumbnail(props: Props) {
|
||||
<div className="chanel-thumbnail--waiting">{__('This will be visible in a few minutes.')}</div>
|
||||
) : (
|
||||
<img
|
||||
ref={thumbnailRef}
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__custom"
|
||||
data-src={!thumbError && url ? url : Spaceman}
|
||||
src={Transparent}
|
||||
src={!thumbError ? thumbnailPreview || thumbnail : Gerbil}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -6,22 +6,13 @@ import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
doOpenModal: (string, {}) => void,
|
||||
claim: Claim,
|
||||
abandonActionCallback: (any) => void,
|
||||
claim: StreamClaim,
|
||||
abandonActionCallback: any => void,
|
||||
iconSize: number,
|
||||
};
|
||||
|
||||
export default function ClaimAbandonButton(props: Props) {
|
||||
const { doOpenModal, claim, abandonActionCallback } = props;
|
||||
const { value_type } = claim || {};
|
||||
let buttonLabel;
|
||||
if (value_type === 'channel') {
|
||||
buttonLabel = __('Delete Channel');
|
||||
} else if (value_type === 'collection') {
|
||||
buttonLabel = __('Delete List');
|
||||
} else if (value_type === 'stream') {
|
||||
buttonLabel = __('Delete Publish');
|
||||
}
|
||||
|
||||
function abandonClaim() {
|
||||
doOpenModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim: claim, cb: abandonActionCallback });
|
||||
@@ -30,7 +21,7 @@ export default function ClaimAbandonButton(props: Props) {
|
||||
return (
|
||||
<Button
|
||||
disabled={!claim}
|
||||
label={buttonLabel}
|
||||
label={__('Delete Channel')}
|
||||
button="alt"
|
||||
iconColor="red"
|
||||
icon={ICONS.DELETE}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ClaimCollectionAdd from './view';
|
||||
import { withRouter } from 'react-router';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
doLocalCollectionCreate,
|
||||
selectBuiltinCollections,
|
||||
selectMyPublishedCollections,
|
||||
selectMyUnpublishedCollections,
|
||||
} from 'lbry-redux';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
builtin: selectBuiltinCollections(state),
|
||||
published: selectMyPublishedCollections(state),
|
||||
unpublished: selectMyUnpublishedCollections(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
addCollection: (name, items, type) => dispatch(doLocalCollectionCreate(name, items, type)),
|
||||
});
|
||||
|
||||
export default withRouter(connect(select, perform)(ClaimCollectionAdd));
|
||||
@@ -1,148 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import type { ElementRef } from 'react';
|
||||
import Button from 'component/button';
|
||||
import Card from 'component/common/card';
|
||||
import { FormField } from 'component/common/form';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import CollectionSelectItem from 'component/collectionSelectItem';
|
||||
|
||||
type Props = {
|
||||
claim: Claim,
|
||||
builtin: any,
|
||||
published: any,
|
||||
unpublished: any,
|
||||
addCollection: (string, Array<string>, string) => void,
|
||||
closeModal: () => void,
|
||||
uri: string,
|
||||
};
|
||||
|
||||
const ClaimCollectionAdd = (props: Props) => {
|
||||
const { builtin, published, unpublished, addCollection, claim, closeModal, uri } = props;
|
||||
const buttonref: ElementRef<any> = React.useRef();
|
||||
const permanentUrl = claim && claim.permanent_url;
|
||||
const isChannel = claim && claim.value_type === 'channel';
|
||||
|
||||
const [addNewCollection, setAddNewCollection] = React.useState(false);
|
||||
const [newCollectionName, setNewCollectionName] = React.useState('');
|
||||
|
||||
// TODO: when other collection types added, filter list in context
|
||||
// const isPlayable =
|
||||
// claim &&
|
||||
// claim.value &&
|
||||
// // $FlowFixMe
|
||||
// claim.value.stream_type &&
|
||||
// (claim.value.stream_type === 'audio' || claim.value.stream_type === 'video');
|
||||
|
||||
function handleNameInput(e) {
|
||||
const { value } = e.target;
|
||||
setNewCollectionName(value);
|
||||
}
|
||||
|
||||
function handleAddCollection() {
|
||||
addCollection(newCollectionName, [permanentUrl], isChannel ? 'collection' : 'playlist');
|
||||
setNewCollectionName('');
|
||||
setAddNewCollection(false);
|
||||
}
|
||||
|
||||
function altEnterListener(e: SyntheticKeyboardEvent<*>) {
|
||||
const KEYCODE_ENTER = 13;
|
||||
if (e.keyCode === KEYCODE_ENTER) {
|
||||
e.preventDefault();
|
||||
buttonref.current.click();
|
||||
}
|
||||
}
|
||||
|
||||
function onTextareaFocus() {
|
||||
window.addEventListener('keydown', altEnterListener);
|
||||
}
|
||||
|
||||
function onTextareaBlur() {
|
||||
window.removeEventListener('keydown', altEnterListener);
|
||||
}
|
||||
|
||||
function handleClearNew() {
|
||||
setNewCollectionName('');
|
||||
setAddNewCollection(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={__('Add To...')}
|
||||
actions={
|
||||
<div className="card__body">
|
||||
{uri && (
|
||||
<fieldset-section>
|
||||
<div className={'card__body-scrollable'}>
|
||||
{(Object.values(builtin): any)
|
||||
// $FlowFixMe
|
||||
.filter((list) => (isChannel ? list.type === 'collection' : list.type === 'playlist'))
|
||||
.map((l) => {
|
||||
const { id } = l;
|
||||
return <CollectionSelectItem claim={claim} collectionId={id} uri={permanentUrl} key={id} category={'builtin'} />;
|
||||
})}
|
||||
{unpublished &&
|
||||
(Object.values(unpublished): any)
|
||||
// $FlowFixMe
|
||||
.filter((list) => (isChannel ? list.type === 'collection' : list.type === 'playlist'))
|
||||
.map((l) => {
|
||||
const { id } = l;
|
||||
return (
|
||||
<CollectionSelectItem claim={claim} collectionId={id} uri={permanentUrl} key={id} category={'unpublished'} />
|
||||
);
|
||||
})}
|
||||
{published &&
|
||||
(Object.values(published): any).map((l) => {
|
||||
// $FlowFixMe
|
||||
const { id } = l;
|
||||
return (
|
||||
<CollectionSelectItem claim={claim} collectionId={id} uri={permanentUrl} key={id} category={'published'} />
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</fieldset-section>
|
||||
)}
|
||||
<fieldset-section>
|
||||
{addNewCollection && (
|
||||
<FormField
|
||||
autoFocus
|
||||
type="text"
|
||||
name="new_collection"
|
||||
value={newCollectionName}
|
||||
label={'New List Title'}
|
||||
onFocus={onTextareaFocus}
|
||||
onBlur={onTextareaBlur}
|
||||
inputButton={
|
||||
<>
|
||||
<Button
|
||||
button={'alt'}
|
||||
icon={ICONS.ADD}
|
||||
className={'button-toggle'}
|
||||
disabled={!newCollectionName.length}
|
||||
onClick={() => handleAddCollection()}
|
||||
ref={buttonref}
|
||||
/>
|
||||
<Button
|
||||
button={'alt'}
|
||||
className={'button-toggle'}
|
||||
icon={ICONS.REMOVE}
|
||||
onClick={() => handleClearNew()}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
onChange={handleNameInput}
|
||||
/>
|
||||
)}
|
||||
{!addNewCollection && (
|
||||
<Button button={'link'} label={'New List'} onClick={() => setAddNewCollection(true)} />
|
||||
)}
|
||||
</fieldset-section>
|
||||
<div className="card__actions">
|
||||
<Button button="secondary" label={__('Done')} disabled={addNewCollection} onClick={closeModal} />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default ClaimCollectionAdd;
|
||||
@@ -1,12 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import PlaylistAddButton from './view';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
doOpenModal,
|
||||
})(PlaylistAddButton);
|
||||
@@ -1,40 +0,0 @@
|
||||
// @flow
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import classnames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
doOpenModal: (string, {}) => void,
|
||||
fileAction?: boolean,
|
||||
type?: boolean,
|
||||
claim: Claim,
|
||||
};
|
||||
|
||||
export default function CollectionAddButton(props: Props) {
|
||||
const { doOpenModal, uri, fileAction, type = 'playlist', claim } = props;
|
||||
|
||||
// $FlowFixMe
|
||||
const streamType = (claim && claim.value && claim.value.stream_type) || '';
|
||||
const isPlayable = streamType === 'video' || streamType === 'audio';
|
||||
|
||||
if (!isPlayable) return null;
|
||||
return (
|
||||
<Button
|
||||
button={fileAction ? undefined : 'alt'}
|
||||
className={classnames({ 'button--file-action': fileAction })}
|
||||
icon={fileAction ? ICONS.ADD : ICONS.LIBRARY}
|
||||
iconSize={fileAction ? 22 : undefined}
|
||||
label={uri ? __('Save') : 'New List'}
|
||||
requiresAuth={IS_WEB}
|
||||
title={__('Add this claim to a list')}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
doOpenModal(MODALS.COLLECTION_ADD, { uri, type });
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import EmbedPlayButton from 'component/embedPlayButton';
|
||||
import Button from 'component/button';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import { INLINE_PLAYER_WRAPPER_CLASS } from 'component/fileRenderFloating/view';
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -13,7 +12,7 @@ type Props = {
|
||||
children: React.Node,
|
||||
description: ?string,
|
||||
isResolvingUri: boolean,
|
||||
doResolveUri: (string) => void,
|
||||
doResolveUri: string => void,
|
||||
blackListedOutpoints: Array<{
|
||||
txid: string,
|
||||
nout: number,
|
||||
@@ -21,7 +20,6 @@ type Props = {
|
||||
playingUri: ?PlayingUri,
|
||||
parentCommentId?: string,
|
||||
isMarkdownPost?: boolean,
|
||||
allowPreview: boolean,
|
||||
};
|
||||
|
||||
class ClaimLink extends React.Component<Props> {
|
||||
@@ -31,7 +29,6 @@ class ClaimLink extends React.Component<Props> {
|
||||
thumbnail: null,
|
||||
description: null,
|
||||
isResolvingUri: false,
|
||||
allowPreview: false,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
@@ -49,7 +46,7 @@ class ClaimLink extends React.Component<Props> {
|
||||
let blackListed = false;
|
||||
|
||||
blackListed = blackListedOutpoints.some(
|
||||
(outpoint) =>
|
||||
outpoint =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
@@ -66,16 +63,7 @@ class ClaimLink extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
uri,
|
||||
claim,
|
||||
children,
|
||||
isResolvingUri,
|
||||
playingUri,
|
||||
parentCommentId,
|
||||
isMarkdownPost,
|
||||
allowPreview,
|
||||
} = this.props;
|
||||
const { uri, claim, children, isResolvingUri, playingUri, parentCommentId, isMarkdownPost } = this.props;
|
||||
const isUnresolved = (!isResolvingUri && !claim) || !claim;
|
||||
const isBlacklisted = this.isClaimBlackListed();
|
||||
const isPlayingInline =
|
||||
@@ -93,7 +81,7 @@ class ClaimLink extends React.Component<Props> {
|
||||
|
||||
return isChannel ? (
|
||||
<UriIndicator uri={uri} link />
|
||||
) : allowPreview ? (
|
||||
) : (
|
||||
<div className={classnames('claim-link')}>
|
||||
<div
|
||||
className={classnames({
|
||||
@@ -104,14 +92,6 @@ class ClaimLink extends React.Component<Props> {
|
||||
</div>
|
||||
<Button button="link" className="preview-link__url" label={uri} navigate={uri} />
|
||||
</div>
|
||||
) : (
|
||||
<Button
|
||||
button="link"
|
||||
title={SIMPLE_SITE ? __("This channel isn't staking enough LBRY Credits for link previews.") : children}
|
||||
label={children}
|
||||
className="button--external-link"
|
||||
navigate={uri}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ClaimList from './view';
|
||||
import { SETTINGS, selectClaimSearchByQuery, selectClaimsByUri } from 'lbry-redux';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
const select = (state) => ({
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
claimsByUri: selectClaimsByUri(state),
|
||||
});
|
||||
|
||||
export default connect(select)(ClaimList);
|
||||
const perform = (dispatch) => ({});
|
||||
|
||||
export default connect(select, perform)(ClaimList);
|
||||
@@ -9,7 +9,6 @@ import { FormField } from 'component/common/form';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import debounce from 'util/debounce';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
import { prioritizeActiveLivestreams } from 'component/claimTilesDiscover/view';
|
||||
|
||||
const DEBOUNCE_SCROLL_HANDLER_MS = 150;
|
||||
const SORT_NEW = 'new';
|
||||
@@ -31,21 +30,14 @@ type Props = {
|
||||
persistedStorageKey?: string,
|
||||
showHiddenByUser: boolean,
|
||||
showUnresolvedClaims?: boolean,
|
||||
renderActions?: (Claim) => ?Node,
|
||||
renderProperties?: (Claim) => ?Node,
|
||||
renderProperties: ?(Claim) => Node,
|
||||
includeSupportAction?: boolean,
|
||||
hideBlock: boolean,
|
||||
injectedItem: ?Node,
|
||||
timedOutMessage?: Node,
|
||||
tileLayout?: boolean,
|
||||
renderActions?: (Claim) => ?Node,
|
||||
searchInLanguage: boolean,
|
||||
hideMenu?: boolean,
|
||||
claimSearchByQuery: { [string]: Array<string> },
|
||||
claimsByUri: { [string]: any },
|
||||
liveLivestreamsFirst?: boolean,
|
||||
livestreamMap?: { [string]: any },
|
||||
searchOptions?: any,
|
||||
collectionId?: string,
|
||||
hideLivestreamClaims?: boolean,
|
||||
};
|
||||
|
||||
export default function ClaimList(props: Props) {
|
||||
@@ -63,44 +55,24 @@ export default function ClaimList(props: Props) {
|
||||
page,
|
||||
showHiddenByUser,
|
||||
showUnresolvedClaims,
|
||||
renderProperties,
|
||||
includeSupportAction,
|
||||
hideBlock,
|
||||
injectedItem,
|
||||
timedOutMessage,
|
||||
tileLayout = false,
|
||||
renderActions,
|
||||
renderProperties,
|
||||
searchInLanguage,
|
||||
hideMenu,
|
||||
claimSearchByQuery,
|
||||
claimsByUri,
|
||||
liveLivestreamsFirst,
|
||||
livestreamMap,
|
||||
searchOptions,
|
||||
collectionId,
|
||||
hideLivestreamClaims,
|
||||
} = props;
|
||||
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||
const timedOut = uris === null;
|
||||
const urisLength = (uris && uris.length) || 0;
|
||||
|
||||
const liveUris = [];
|
||||
if (liveLivestreamsFirst && livestreamMap) {
|
||||
prioritizeActiveLivestreams(uris, liveUris, livestreamMap, claimsByUri, claimSearchByQuery, searchOptions);
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
const resolveLive = (index) => {
|
||||
if (liveLivestreamsFirst && livestreamMap && index < liveUris.length) {
|
||||
return true;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
function handleSortChange() {
|
||||
setCurrentSort(currentSort === SORT_NEW ? SORT_OLD : SORT_NEW);
|
||||
}
|
||||
@@ -128,18 +100,7 @@ export default function ClaimList(props: Props) {
|
||||
|
||||
return tileLayout && !header ? (
|
||||
<section className="claim-grid">
|
||||
{urisLength > 0 &&
|
||||
uris.map((uri, index) => (
|
||||
<ClaimPreviewTile
|
||||
key={uri}
|
||||
uri={uri}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
properties={renderProperties}
|
||||
live={resolveLive(index)}
|
||||
collectionId={collectionId}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
/>
|
||||
))}
|
||||
{urisLength > 0 && uris.map((uri) => <ClaimPreviewTile key={uri} uri={uri} />)}
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
|
||||
{timedOut && timedOutMessage && <div className="empty main--empty">{timedOutMessage}</div>}
|
||||
</section>
|
||||
@@ -155,23 +116,21 @@ export default function ClaimList(props: Props) {
|
||||
<div className={classnames('claim-list__header', { 'section__title--small': type === 'small' })}>
|
||||
{header}
|
||||
{loading && <Spinner type="small" />}
|
||||
{(headerAltControls || defaultSort) && (
|
||||
<div className="claim-list__alt-controls">
|
||||
{headerAltControls}
|
||||
{defaultSort && (
|
||||
<FormField
|
||||
className="claim-list__dropdown"
|
||||
type="select"
|
||||
name="file_sort"
|
||||
value={currentSort}
|
||||
onChange={handleSortChange}
|
||||
>
|
||||
<option value={SORT_NEW}>{__('Newest First')}</option>
|
||||
<option value={SORT_OLD}>{__('Oldest First')}</option>
|
||||
</FormField>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="claim-list__alt-controls">
|
||||
{headerAltControls}
|
||||
{defaultSort && (
|
||||
<FormField
|
||||
className="claim-list__dropdown"
|
||||
type="select"
|
||||
name="file_sort"
|
||||
value={currentSort}
|
||||
onChange={handleSortChange}
|
||||
>
|
||||
<option value={SORT_NEW}>{__('Newest First')}</option>
|
||||
<option value={SORT_OLD}>{__('Oldest First')}</option>
|
||||
</FormField>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</React.Fragment>
|
||||
@@ -190,22 +149,22 @@ 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}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
collectionId={collectionId}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
hideBlock={hideBlock}
|
||||
customShouldHide={(claim: StreamClaim) => {
|
||||
// Hack to hide spee.ch thumbnail publishes
|
||||
// If it meets these requirements, it was probably uploaded here:
|
||||
// https://github.com/lbryio/lbry-redux/blob/master/src/redux/actions/publish.js#L74-L79
|
||||
return claim.name.length === 24 && !claim.name.includes(' ') && claim.value.author === 'Spee.ch';
|
||||
if (claim.name.length === 24 && !claim.name.includes(' ') && claim.value.author === 'Spee.ch') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}}
|
||||
live={resolveLive(index)}
|
||||
/>
|
||||
</React.Fragment>
|
||||
))}
|
||||
|
||||
@@ -7,22 +7,20 @@ import {
|
||||
SETTINGS,
|
||||
} from 'lbry-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { selectBlockedChannels } from 'redux/selectors/blocked';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectShowMatureContent, selectLanguage } from 'redux/selectors/settings';
|
||||
import { selectModerationBlockList } from 'redux/selectors/comments';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import ClaimListDiscover from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
const select = state => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
claimSearchByQueryLastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: selectShowMatureContent(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
languageSetting: selectLanguage(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
blockedUris: selectModerationBlockList(state),
|
||||
hiddenUris: selectBlockedChannels(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import type { Node } from 'react';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import React from 'react';
|
||||
@@ -14,28 +13,24 @@ import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import ClaimListHeader from 'component/claimListHeader';
|
||||
import { useIsLargeScreen } from 'effects/use-screensize';
|
||||
import { getLivestreamOnlyOptions } from 'util/search';
|
||||
|
||||
type Props = {
|
||||
uris: Array<string>,
|
||||
showHeader: boolean,
|
||||
type: string,
|
||||
subscribedChannels: Array<Subscription>,
|
||||
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 },
|
||||
mutedUris: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
hiddenUris: Array<string>,
|
||||
hiddenNsfwMessage?: Node,
|
||||
channelIds?: Array<string>,
|
||||
claimIds?: Array<string>,
|
||||
@@ -48,12 +43,13 @@ type Props = {
|
||||
header?: Node,
|
||||
headerLabel?: string | Node,
|
||||
name?: string,
|
||||
hideBlock?: boolean,
|
||||
hideAdvancedFilter?: boolean,
|
||||
claimType?: string | Array<string>,
|
||||
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,
|
||||
@@ -68,23 +64,12 @@ type Props = {
|
||||
languageSetting: string,
|
||||
searchInLanguage: boolean,
|
||||
scrollAnchor?: string,
|
||||
showHiddenByUser?: boolean,
|
||||
liveLivestreamsFirst?: boolean,
|
||||
livestreamMap?: { [string]: any },
|
||||
hasSource?: boolean,
|
||||
limitClaimsPerChannel?: number,
|
||||
releaseTime?: string,
|
||||
hideLivestreamClaims?: boolean,
|
||||
isChannel?: boolean,
|
||||
empty?: string,
|
||||
};
|
||||
|
||||
function ClaimListDiscover(props: Props) {
|
||||
const {
|
||||
doClaimSearch,
|
||||
claimSearchByQuery,
|
||||
showHeader = true,
|
||||
type,
|
||||
claimSearchByQueryLastPageReached,
|
||||
tags,
|
||||
defaultTags,
|
||||
@@ -95,8 +80,7 @@ function ClaimListDiscover(props: Props) {
|
||||
hideReposts,
|
||||
history,
|
||||
location,
|
||||
mutedUris,
|
||||
blockedUris,
|
||||
hiddenUris,
|
||||
hiddenNsfwMessage,
|
||||
defaultOrderBy,
|
||||
orderBy,
|
||||
@@ -105,9 +89,10 @@ function ClaimListDiscover(props: Props) {
|
||||
name,
|
||||
claimType,
|
||||
pageSize,
|
||||
hideBlock,
|
||||
defaultClaimType,
|
||||
streamType = CS.FILE_VIDEO,
|
||||
defaultStreamType = CS.FILE_VIDEO,
|
||||
streamType,
|
||||
defaultStreamType,
|
||||
freshness,
|
||||
defaultFreshness = CS.FRESH_WEEK,
|
||||
renderProperties,
|
||||
@@ -126,16 +111,7 @@ function ClaimListDiscover(props: Props) {
|
||||
forceShowReposts = false,
|
||||
languageSetting,
|
||||
searchInLanguage,
|
||||
limitClaimsPerChannel,
|
||||
releaseTime,
|
||||
scrollAnchor,
|
||||
showHiddenByUser = false,
|
||||
liveLivestreamsFirst,
|
||||
livestreamMap,
|
||||
hasSource,
|
||||
isChannel = false,
|
||||
hideLivestreamClaims,
|
||||
empty,
|
||||
} = props;
|
||||
const didNavigateForward = history.action === 'PUSH';
|
||||
const { search } = location;
|
||||
@@ -144,14 +120,13 @@ 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
|
||||
@@ -174,12 +149,12 @@ function ClaimListDiscover(props: Props) {
|
||||
const durationParam = urlParams.get(CS.DURATION_KEY) || null;
|
||||
const channelIdsInUrl = urlParams.get(CS.CHANNEL_IDS_KEY);
|
||||
const channelIdsParam = channelIdsInUrl ? channelIdsInUrl.split(',') : channelIds;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount || CS.FEE_AMOUNT_ONLY_FREE;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount;
|
||||
const originalPageSize = pageSize || CS.PAGE_SIZE;
|
||||
const dynamicPageSize = isLargeScreen ? Math.ceil(originalPageSize * (3 / 2)) : originalPageSize;
|
||||
const historyAction = history.action;
|
||||
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy || orderParamEntry;
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
|
||||
|
||||
if (!orderParam) {
|
||||
if (historyAction === 'POP') {
|
||||
@@ -212,18 +187,15 @@ function ClaimListDiscover(props: Props) {
|
||||
not_tags: Array<string>,
|
||||
channel_ids?: Array<string>,
|
||||
claim_ids?: Array<string>,
|
||||
not_channel_ids?: Array<string>,
|
||||
not_channel_ids: Array<string>,
|
||||
order_by: Array<string>,
|
||||
release_time?: string,
|
||||
claim_type?: string | Array<string>,
|
||||
claim_type?: Array<string>,
|
||||
name?: string,
|
||||
duration?: string,
|
||||
reposted_claim_id?: string,
|
||||
stream_types?: any,
|
||||
fee_amount?: string,
|
||||
has_source?: boolean,
|
||||
has_no_source?: boolean,
|
||||
limit_claims_per_channel?: number,
|
||||
} = {
|
||||
page_size: dynamicPageSize,
|
||||
page,
|
||||
@@ -232,7 +204,9 @@ function ClaimListDiscover(props: Props) {
|
||||
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
||||
// it's faster, but we will need to remove it if we start using total_pages
|
||||
no_totals: true,
|
||||
not_channel_ids: isChannel ? undefined : mutedAndBlockedChannelIds,
|
||||
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]) : [],
|
||||
not_tags: !showNsfw ? MATURE_TAGS : [],
|
||||
order_by:
|
||||
orderParam === CS.ORDER_BY_TRENDING
|
||||
@@ -242,14 +216,6 @@ function ClaimListDiscover(props: Props) {
|
||||
: CS.ORDER_BY_TOP_VALUE, // Sort by top
|
||||
};
|
||||
|
||||
if (hasSource || (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === CS.CLAIM_STREAM))) {
|
||||
options.has_source = true;
|
||||
}
|
||||
|
||||
if (limitClaimsPerChannel) {
|
||||
options.limit_claims_per_channel = limitClaimsPerChannel;
|
||||
}
|
||||
|
||||
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
||||
options.fee_amount = feeAmountParam;
|
||||
}
|
||||
@@ -279,12 +245,14 @@ function ClaimListDiscover(props: Props) {
|
||||
options.reposted_claim_id = repostedClaimId;
|
||||
}
|
||||
|
||||
// IF release time, set it, else set fallback release times using the hack below.
|
||||
if (releaseTime) {
|
||||
options.release_time = releaseTime;
|
||||
} else if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
|
||||
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
|
||||
@@ -295,15 +263,29 @@ 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()
|
||||
)}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -351,34 +333,18 @@ 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);
|
||||
let claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
const claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
const claimSearchResultLastPageReached = claimSearchByQueryLastPageReached[claimSearchCacheQuery];
|
||||
|
||||
// uncomment to fix an item on a page
|
||||
// const fixUri = 'lbry://@corbettreport#0/lbryodysee#5';
|
||||
// if (
|
||||
// orderParam === CS.ORDER_BY_NEW &&
|
||||
// claimSearchResult &&
|
||||
// claimSearchResult.length > 2 &&
|
||||
// window.location.pathname === '/$/rabbithole'
|
||||
// ) {
|
||||
// if (claimSearchResult.indexOf(fixUri) !== -1) {
|
||||
// claimSearchResult.splice(claimSearchResult.indexOf(fixUri), 1);
|
||||
// } else {
|
||||
// claimSearchResult.pop();
|
||||
// }
|
||||
// claimSearchResult.splice(2, 0, fixUri);
|
||||
// }
|
||||
|
||||
const [prevOptions, setPrevOptions] = React.useState(null);
|
||||
|
||||
if (!isJustScrollingToNewPage(prevOptions, options)) {
|
||||
@@ -485,10 +451,6 @@ function ClaimListDiscover(props: Props) {
|
||||
if (shouldPerformSearch) {
|
||||
const searchOptions = JSON.parse(optionsStringForEffect);
|
||||
doClaimSearch(searchOptions);
|
||||
|
||||
if (liveLivestreamsFirst && options.page === 1) {
|
||||
doClaimSearch(getLivestreamOnlyOptions(searchOptions));
|
||||
}
|
||||
}
|
||||
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect, forceRefresh]);
|
||||
|
||||
@@ -502,7 +464,7 @@ function ClaimListDiscover(props: Props) {
|
||||
claimType={claimType}
|
||||
streamType={streamType}
|
||||
defaultStreamType={defaultStreamType}
|
||||
// feeAmount={feeAmount}
|
||||
feeAmount={feeAmount}
|
||||
orderBy={orderBy}
|
||||
defaultOrderBy={defaultOrderBy}
|
||||
hideAdvancedFilter={hideAdvancedFilter}
|
||||
@@ -537,13 +499,8 @@ function ClaimListDiscover(props: Props) {
|
||||
timedOutMessage={timedOutMessage}
|
||||
renderProperties={renderProperties}
|
||||
includeSupportAction={includeSupportAction}
|
||||
hideBlock={hideBlock}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
liveLivestreamsFirst={liveLivestreamsFirst}
|
||||
livestreamMap={livestreamMap}
|
||||
searchOptions={options}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
empty={empty}
|
||||
/>
|
||||
{loading && (
|
||||
<div className="claim-grid">
|
||||
@@ -555,15 +512,13 @@ function ClaimListDiscover(props: Props) {
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
{showHeader && (
|
||||
<div className="section__header--actions">
|
||||
{headerToUse}
|
||||
{meta && <div className="section__actions--no-margin">{meta}</div>}
|
||||
</div>
|
||||
)}
|
||||
<div className="section__header--actions">
|
||||
{headerToUse}
|
||||
{meta && <div className="section__actions--no-margin">{meta}</div>}
|
||||
</div>
|
||||
|
||||
<ClaimList
|
||||
id={claimSearchCacheQuery}
|
||||
type={type}
|
||||
loading={loading}
|
||||
uris={uris || claimSearchResult}
|
||||
onScrollBottom={handleScrollBottom}
|
||||
@@ -572,18 +527,10 @@ function ClaimListDiscover(props: Props) {
|
||||
timedOutMessage={timedOutMessage}
|
||||
renderProperties={renderProperties}
|
||||
includeSupportAction={includeSupportAction}
|
||||
hideBlock={hideBlock}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
liveLivestreamsFirst={liveLivestreamsFirst}
|
||||
livestreamMap={livestreamMap}
|
||||
searchOptions={options}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
empty={empty}
|
||||
/>
|
||||
{loading &&
|
||||
new Array(dynamicPageSize)
|
||||
.fill(1)
|
||||
.map((x, i) => <ClaimPreview key={i} placeholder="loading" type={type} />)}
|
||||
{loading && new Array(dynamicPageSize).fill(1).map((x, i) => <ClaimPreview key={i} placeholder="loading" />)}
|
||||
</div>
|
||||
)}
|
||||
</React.Fragment>
|
||||
|
||||
@@ -2,14 +2,14 @@ import { connect } from 'react-redux';
|
||||
import { selectFetchingClaimSearch, SETTINGS } from 'lbry-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectShowMatureContent, selectLanguage } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import ClaimListHeader from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
const select = state => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: selectShowMatureContent(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
languageSetting: selectLanguage(state),
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ type Props = {
|
||||
channelIds?: Array<string>,
|
||||
tileLayout: boolean,
|
||||
doSetClientSetting: (string, boolean, ?boolean) => void,
|
||||
setPage: (number) => void,
|
||||
setPage: number => void,
|
||||
hideFilters: boolean,
|
||||
searchInLanguage: boolean,
|
||||
languageSetting: string,
|
||||
@@ -74,7 +74,7 @@ function ClaimListHeader(props: Props) {
|
||||
const channelIdsInUrl = urlParams.get(CS.CHANNEL_IDS_KEY);
|
||||
const channelIdsParam = channelIdsInUrl ? channelIdsInUrl.split(',') : channelIds;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount || CS.FEE_AMOUNT_ANY;
|
||||
const showDuration = !(claimType && claimType === CS.CLAIM_CHANNEL && claimType === CS.CLAIM_COLLECTION);
|
||||
const showDuration = !(claimType && claimType === CS.CLAIM_CHANNEL);
|
||||
const isFiltered = () =>
|
||||
Boolean(
|
||||
urlParams.get(CS.FRESH_KEY) ||
|
||||
@@ -144,7 +144,7 @@ function ClaimListHeader(props: Props) {
|
||||
|
||||
function buildUrl(delta) {
|
||||
const newUrlParams = new URLSearchParams(location.search);
|
||||
CS.KEYS.forEach((k) => {
|
||||
CS.KEYS.forEach(k => {
|
||||
// $FlowFixMe get() can return null
|
||||
if (urlParams.get(k) !== null) newUrlParams.set(k, urlParams.get(k));
|
||||
});
|
||||
@@ -161,11 +161,7 @@ function ClaimListHeader(props: Props) {
|
||||
}
|
||||
break;
|
||||
case CS.CONTENT_KEY:
|
||||
if (
|
||||
delta.value === CS.CLAIM_CHANNEL ||
|
||||
delta.value === CS.CLAIM_REPOST ||
|
||||
delta.value === CS.CLAIM_COLLECTION
|
||||
) {
|
||||
if (delta.value === CS.CLAIM_CHANNEL || delta.value === CS.CLAIM_REPOST) {
|
||||
newUrlParams.delete(CS.DURATION_KEY);
|
||||
newUrlParams.set(CS.CONTENT_KEY, delta.value);
|
||||
} else if (delta.value === CS.CONTENT_ALL) {
|
||||
@@ -216,13 +212,13 @@ function ClaimListHeader(props: Props) {
|
||||
<>
|
||||
<div className="claim-search__wrapper">
|
||||
<div className="claim-search__top">
|
||||
{!hideFilters && (
|
||||
<div className="claim-search__menu-group">
|
||||
{CS.ORDER_BY_TYPES.map((type) => (
|
||||
<div className="claim-search__menu-group">
|
||||
{!hideFilters &&
|
||||
CS.ORDER_BY_TYPES.map(type => (
|
||||
<Button
|
||||
key={type}
|
||||
button="alt"
|
||||
onClick={(e) =>
|
||||
onClick={e =>
|
||||
handleChange({
|
||||
key: CS.ORDER_BY_KEY,
|
||||
value: type,
|
||||
@@ -237,8 +233,8 @@ function ClaimListHeader(props: Props) {
|
||||
label={__(toCapitalCase(type))}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="claim-search__menu-group">
|
||||
{!hideAdvancedFilter && !SIMPLE_SITE && (
|
||||
<Button
|
||||
@@ -280,23 +276,21 @@ function ClaimListHeader(props: Props) {
|
||||
name="trending_time"
|
||||
label={__('How Fresh')}
|
||||
value={freshnessParam}
|
||||
onChange={(e) =>
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.FRESH_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.FRESH_TYPES.map((time) => (
|
||||
{CS.FRESH_TYPES.map(time => (
|
||||
<option key={time} value={time}>
|
||||
{/* i18fixme */}
|
||||
{time === CS.FRESH_DAY && __('Today')}
|
||||
{
|
||||
time !== CS.FRESH_ALL &&
|
||||
time !== CS.FRESH_DEFAULT &&
|
||||
time !== CS.FRESH_DAY &&
|
||||
__('This ' + toCapitalCase(time)) /* yes, concat before i18n, since it is read from const */
|
||||
}
|
||||
{time !== CS.FRESH_ALL &&
|
||||
time !== CS.FRESH_DEFAULT &&
|
||||
time !== CS.FRESH_DAY &&
|
||||
__('This ' + toCapitalCase(time)) /* yes, concat before i18n, since it is read from const */}
|
||||
{time === CS.FRESH_ALL && __('All time')}
|
||||
{time === CS.FRESH_DEFAULT && __('Default')}
|
||||
</option>
|
||||
@@ -320,19 +314,18 @@ function ClaimListHeader(props: Props) {
|
||||
name="claimType"
|
||||
label={__('Content Type')}
|
||||
value={contentTypeParam || CS.CONTENT_ALL}
|
||||
onChange={(e) =>
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.CONTENT_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.CONTENT_TYPES.map((type) => {
|
||||
{CS.CONTENT_TYPES.map(type => {
|
||||
if (type !== CS.CLAIM_CHANNEL || (type === CS.CLAIM_CHANNEL && !channelIdsParam)) {
|
||||
return (
|
||||
<option key={type} value={type}>
|
||||
{/* i18fixme */}
|
||||
{type === CS.CLAIM_COLLECTION && __('List')}
|
||||
{type === CS.CLAIM_CHANNEL && __('Channel')}
|
||||
{type === CS.CLAIM_REPOST && __('Repost')}
|
||||
{type === CS.FILE_VIDEO && __('Video')}
|
||||
@@ -365,7 +358,7 @@ function ClaimListHeader(props: Props) {
|
||||
name="claimType"
|
||||
label={__('Language')}
|
||||
value={languageValue || CS.LANGUAGES_ALL}
|
||||
onChange={(e) =>
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.LANGUAGE_KEY,
|
||||
value: e.target.value,
|
||||
@@ -405,14 +398,14 @@ function ClaimListHeader(props: Props) {
|
||||
)
|
||||
}
|
||||
value={durationParam || CS.DURATION_ALL}
|
||||
onChange={(e) =>
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.DURATION_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.DURATION_TYPES.map((dur) => (
|
||||
{CS.DURATION_TYPES.map(dur => (
|
||||
<option key={dur} value={dur}>
|
||||
{/* i18fixme */}
|
||||
{dur === CS.DURATION_SHORT && __('Short (< 4 minutes)')}
|
||||
@@ -435,7 +428,7 @@ function ClaimListHeader(props: Props) {
|
||||
type="select"
|
||||
name="paidcontent"
|
||||
value={feeAmountParam}
|
||||
onChange={(e) =>
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.FEE_AMOUNT_KEY,
|
||||
value: e.target.value,
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doCollectionEdit,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectFileInfoForUri,
|
||||
doPrepareEdit,
|
||||
makeSelectCollectionForIdHasClaimUrl,
|
||||
makeSelectNameForCollectionId,
|
||||
makeSelectCollectionIsMine,
|
||||
COLLECTIONS_CONSTS,
|
||||
makeSelectEditedCollectionForId,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked';
|
||||
import { doSetActiveChannel, doSetIncognito, doOpenModal } from 'redux/actions/app';
|
||||
import { doCommentModBlock, doCommentModUnBlock } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsBlocked } from 'redux/selectors/comments';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { makeSelectSigningIsMine } from 'redux/selectors/content';
|
||||
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
||||
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
||||
import ClaimPreview from './view';
|
||||
import fs from 'fs';
|
||||
|
||||
const select = (state, props) => {
|
||||
const claim = makeSelectClaimForUri(props.uri, false)(state);
|
||||
const permanentUri = claim && claim.permanent_url;
|
||||
return {
|
||||
claim,
|
||||
claimIsMine: makeSelectSigningIsMine(props.uri)(state),
|
||||
hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl(COLLECTIONS_CONSTS.WATCH_LATER_ID, permanentUri)(state),
|
||||
channelIsMuted: makeSelectChannelIsMuted(props.uri)(state),
|
||||
channelIsBlocked: makeSelectChannelIsBlocked(props.uri)(state),
|
||||
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||
isSubscribed: makeSelectIsSubscribed(props.channelUri, true)(state),
|
||||
claimInCollection: makeSelectCollectionForIdHasClaimUrl(props.collectionId, permanentUri)(state),
|
||||
collectionName: makeSelectNameForCollectionId(props.collectionId)(state),
|
||||
isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state),
|
||||
editedCollection: makeSelectEditedCollectionForId(props.collectionId)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
prepareEdit: (publishData, uri, fileInfo) => {
|
||||
if (publishData.signing_channel) {
|
||||
dispatch(doSetIncognito(false));
|
||||
dispatch(doSetActiveChannel(publishData.signing_channel.claim_id));
|
||||
} else {
|
||||
dispatch(doSetIncognito(true));
|
||||
}
|
||||
|
||||
dispatch(doPrepareEdit(publishData, uri, fileInfo, fs));
|
||||
},
|
||||
doToast: (props) => dispatch(doToast(props)),
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
doChannelMute: (channelUri) => dispatch(doChannelMute(channelUri)),
|
||||
doChannelUnmute: (channelUri) => dispatch(doChannelUnmute(channelUri)),
|
||||
doCommentModBlock: (channelUri) => dispatch(doCommentModBlock(channelUri)),
|
||||
doCommentModUnBlock: (channelUri) => dispatch(doCommentModUnBlock(channelUri)),
|
||||
doChannelSubscribe: (subscription) => dispatch(doChannelSubscribe(subscription)),
|
||||
doChannelUnsubscribe: (subscription) => dispatch(doChannelUnsubscribe(subscription)),
|
||||
doCollectionEdit: (collection, props) => dispatch(doCollectionEdit(collection, props)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimPreview);
|
||||
@@ -1,347 +0,0 @@
|
||||
// @flow
|
||||
import { URL, SHARE_DOMAIN_URL } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
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';
|
||||
import { useHistory } from 'react-router';
|
||||
import { buildURI, parseURI, COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
|
||||
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
|
||||
const PAGE_VIEW_QUERY = `view`;
|
||||
const EDIT_PAGE = 'edit';
|
||||
|
||||
type SubscriptionArgs = {
|
||||
channelName: string,
|
||||
uri: string,
|
||||
notificationsDisabled?: boolean,
|
||||
};
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
channelUri: string,
|
||||
claim: ?Claim,
|
||||
openModal: (id: string, {}) => void,
|
||||
inline?: boolean,
|
||||
channelIsMuted: boolean,
|
||||
channelIsBlocked: boolean,
|
||||
doChannelMute: (string) => void,
|
||||
doChannelUnmute: (string) => void,
|
||||
doCommentModBlock: (string) => void,
|
||||
doCommentModUnBlock: (string) => void,
|
||||
isRepost: boolean,
|
||||
doCollectionEdit: (string, any) => void,
|
||||
hasClaimInWatchLater: boolean,
|
||||
claimInCollection: boolean,
|
||||
collectionName?: string,
|
||||
collectionId: string,
|
||||
isMyCollection: boolean,
|
||||
doToast: ({ message: string }) => void,
|
||||
claimIsMine: boolean,
|
||||
fileInfo: FileListItem,
|
||||
prepareEdit: ({}, string, {}) => void,
|
||||
isSubscribed: boolean,
|
||||
doChannelSubscribe: (SubscriptionArgs) => void,
|
||||
doChannelUnsubscribe: (SubscriptionArgs) => void,
|
||||
isChannelPage: boolean,
|
||||
editedCollection: Collection,
|
||||
};
|
||||
|
||||
function ClaimMenuList(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
channelUri,
|
||||
claim,
|
||||
openModal,
|
||||
inline = false,
|
||||
doChannelMute,
|
||||
doChannelUnmute,
|
||||
channelIsMuted,
|
||||
channelIsBlocked,
|
||||
doCommentModBlock,
|
||||
doCommentModUnBlock,
|
||||
isRepost,
|
||||
doCollectionEdit,
|
||||
hasClaimInWatchLater,
|
||||
collectionId,
|
||||
collectionName,
|
||||
isMyCollection,
|
||||
doToast,
|
||||
claimIsMine,
|
||||
fileInfo,
|
||||
prepareEdit,
|
||||
isSubscribed,
|
||||
doChannelSubscribe,
|
||||
doChannelUnsubscribe,
|
||||
isChannelPage = false,
|
||||
editedCollection,
|
||||
} = props;
|
||||
const repostedContent = claim && claim.reposted_claim;
|
||||
const contentClaim = repostedContent || claim;
|
||||
const incognitoClaim = channelUri && !channelUri.includes('@');
|
||||
const signingChannel = claim && (claim.signing_channel || claim);
|
||||
const permanentUrl = String(channelUri);
|
||||
const isChannel = !incognitoClaim && signingChannel === claim;
|
||||
const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
|
||||
const subscriptionLabel = isSubscribed ? __('Unfollow') : __('Follow');
|
||||
|
||||
const { push, replace } = useHistory();
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const shareUrl: string = generateShareUrl(SHARE_DOMAIN, uri);
|
||||
const isCollectionClaim = claim && claim.value_type === 'collection';
|
||||
// $FlowFixMe
|
||||
const isPlayable =
|
||||
contentClaim &&
|
||||
// $FlowFixMe
|
||||
contentClaim.value &&
|
||||
// $FlowFixMe
|
||||
contentClaim.value.stream_type &&
|
||||
// $FlowFixMe
|
||||
(contentClaim.value.stream_type === 'audio' || contentClaim.value.stream_type === 'video');
|
||||
|
||||
function handleFollow() {
|
||||
const { channelName } = parseURI(permanentUrl);
|
||||
const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe;
|
||||
|
||||
subscriptionHandler({
|
||||
channelName: '@' + channelName,
|
||||
uri: permanentUrl,
|
||||
notificationsDisabled: true,
|
||||
});
|
||||
}
|
||||
|
||||
function handleToggleMute() {
|
||||
if (channelIsMuted) {
|
||||
doChannelUnmute(channelUri);
|
||||
} else {
|
||||
doChannelMute(channelUri);
|
||||
}
|
||||
}
|
||||
|
||||
function handleToggleBlock() {
|
||||
if (channelIsBlocked) {
|
||||
doCommentModUnBlock(channelUri);
|
||||
} else {
|
||||
doCommentModBlock(channelUri);
|
||||
}
|
||||
}
|
||||
|
||||
function handleEdit() {
|
||||
if (!isChannel) {
|
||||
const signingChannelName = signingChannel && signingChannel.name;
|
||||
|
||||
const uriObject: { streamName: string, streamClaimId: string, channelName?: string } = {
|
||||
streamName: claim.name,
|
||||
streamClaimId: claim.claim_id,
|
||||
};
|
||||
if (signingChannelName) {
|
||||
uriObject.channelName = signingChannelName;
|
||||
}
|
||||
const editUri = buildURI(uriObject);
|
||||
|
||||
push(`/$/${PAGES.UPLOAD}`);
|
||||
prepareEdit(claim, editUri, fileInfo);
|
||||
} else {
|
||||
const channelUrl = claim.name + ':' + claim.claim_id;
|
||||
push(`/${channelUrl}?${PAGE_VIEW_QUERY}=${EDIT_PAGE}`);
|
||||
}
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
if (!isRepost && !isChannel) {
|
||||
openModal(MODALS.CONFIRM_FILE_REMOVE, { uri });
|
||||
} else {
|
||||
openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim, cb: !isRepost && (() => replace(`/$/${PAGES.CHANNELS}`)) });
|
||||
}
|
||||
}
|
||||
|
||||
function handleSupport() {
|
||||
openModal(MODALS.SEND_TIP, { uri, isSupport: true });
|
||||
}
|
||||
|
||||
function handleCopyLink() {
|
||||
navigator.clipboard.writeText(shareUrl);
|
||||
}
|
||||
|
||||
function handleReportContent() {
|
||||
// $FlowFixMe
|
||||
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${(repostedContent && repostedContent.claim_id) || claim.claim_id}`);
|
||||
}
|
||||
|
||||
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">
|
||||
{/* WATCH LATER */}
|
||||
<>
|
||||
{isPlayable && !collectionId && (
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => {
|
||||
doToast({
|
||||
message: __('Item %action% Watch Later', {
|
||||
action: hasClaimInWatchLater ? __('removed from') : __('added to'),
|
||||
}),
|
||||
});
|
||||
doCollectionEdit(COLLECTIONS_CONSTS.WATCH_LATER_ID, {
|
||||
claims: [contentClaim],
|
||||
remove: hasClaimInWatchLater,
|
||||
type: 'playlist',
|
||||
});
|
||||
}}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} />
|
||||
{hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
{/* COLLECTION OPERATIONS */}
|
||||
{collectionId && collectionName && isCollectionClaim && (
|
||||
<>
|
||||
{Boolean(editedCollection) && (
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden iconColor={'red'} icon={ICONS.PUBLISH} />
|
||||
{__('Publish')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
<MenuItem className="comment__menu-option" onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}`)}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.VIEW} />
|
||||
{__('View List')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => openModal(MODALS.COLLECTION_DELETE, { collectionId })}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
{__('Delete List')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
)}
|
||||
{/* CURRENTLY ONLY SUPPORT PLAYLISTS FOR PLAYABLE; LATER DIFFERENT TYPES */}
|
||||
{isPlayable && (
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => openModal(MODALS.COLLECTION_ADD, { uri, type: 'playlist' })}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.STACK} />
|
||||
{__('Add to Lists')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
</>
|
||||
{!isChannelPage && (
|
||||
<>
|
||||
<hr className="menu__separator" />
|
||||
<MenuItem className="comment__menu-option" onSelect={handleSupport}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.LBC} />
|
||||
{__('Support')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
)}
|
||||
|
||||
{!incognitoClaim && !isRepost && !claimIsMine && !isChannelPage && (
|
||||
<>
|
||||
<hr className="menu__separator" />
|
||||
<MenuItem className="comment__menu-option" onSelect={handleFollow}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.SUBSCRIBE} />
|
||||
{subscriptionLabel}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
)}
|
||||
{!isMyCollection && (
|
||||
<>
|
||||
{(!claimIsMine || channelIsBlocked) && channelUri ? (
|
||||
!incognitoClaim &&
|
||||
!isRepost && (
|
||||
<>
|
||||
<hr className="menu__separator" />
|
||||
<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>
|
||||
</>
|
||||
)
|
||||
) : (
|
||||
<>
|
||||
{!isChannelPage && !isRepost && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleEdit}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.EDIT} />
|
||||
{__('Edit')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
{showDelete && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleDelete}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
{__('Delete')}
|
||||
</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 && !isMyCollection && (
|
||||
<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;
|
||||
@@ -10,18 +10,12 @@ import {
|
||||
makeSelectReflectingClaimForUri,
|
||||
makeSelectClaimWasPurchased,
|
||||
makeSelectStreamingUrlForUri,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
makeSelectCollectionIsMine,
|
||||
doCollectionEdit,
|
||||
makeSelectUrlsForCollectionId,
|
||||
makeSelectIndexForUrlInCollection,
|
||||
} from 'lbry-redux';
|
||||
import { selectMutedChannels, makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { selectBlockedChannels, selectChannelIsBlocked } 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) => ({
|
||||
@@ -36,23 +30,17 @@ const select = (state, props) => ({
|
||||
nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
blockedUris: selectModerationBlockList(state),
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
hasVisitedUri: props.uri && makeSelectHasVisitedUri(props.uri)(state),
|
||||
channelIsBlocked: props.uri && makeSelectChannelIsMuted(props.uri)(state),
|
||||
channelIsBlocked: props.uri && selectChannelIsBlocked(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),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
isCollectionMine: makeSelectCollectionIsMine(props.collectionId)(state),
|
||||
collectionUris: makeSelectUrlsForCollectionId(props.collectionId)(state),
|
||||
collectionIndex: makeSelectIndexForUrlInCollection(props.uri, props.collectionId)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
resolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||
getFile: (uri) => dispatch(doFileGet(uri, false)),
|
||||
editCollection: (id, params) => dispatch(doCollectionEdit(id, params)),
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
getFile: uri => dispatch(doFileGet(uri, false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimPreview);
|
||||
+130
-200
@@ -3,15 +3,20 @@ import type { Node } from 'react';
|
||||
import React, { useEffect, forwardRef } from 'react';
|
||||
import { NavLink, withRouter } from 'react-router-dom';
|
||||
import classnames from 'classnames';
|
||||
import { parseURI, COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
// @if TARGET='app'
|
||||
import { openClaimPreviewMenu } from 'util/context-menu';
|
||||
// @endif
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { isEmpty } from 'util/object';
|
||||
import FileThumbnail from 'component/fileThumbnail';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import PreviewOverlayProperties from 'component/previewOverlayProperties';
|
||||
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';
|
||||
@@ -20,13 +25,9 @@ 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';
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import Button from 'component/button';
|
||||
import * as ICONS from 'constants/icons';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -52,13 +53,14 @@ type Props = {
|
||||
txid: string,
|
||||
nout: number,
|
||||
}>,
|
||||
mutedUris: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
blockedChannelUris: Array<string>,
|
||||
channelIsBlocked: boolean,
|
||||
isSubscribed: boolean,
|
||||
actions: boolean | Node | string | number,
|
||||
properties: boolean | Node | string | number | ((Claim) => Node),
|
||||
empty?: Node,
|
||||
onClick?: (any) => any,
|
||||
hideBlock?: boolean,
|
||||
streamingUrl: ?string,
|
||||
getFile: (string) => void,
|
||||
customShouldHide?: (Claim) => boolean,
|
||||
@@ -70,14 +72,6 @@ type Props = {
|
||||
wrapperElement?: string,
|
||||
hideRepostLabel?: boolean,
|
||||
repostUrl?: string,
|
||||
hideMenu?: boolean,
|
||||
isLivestream?: boolean,
|
||||
live?: boolean,
|
||||
collectionId?: string,
|
||||
editCollection: (string, CollectionEditParams) => void,
|
||||
isCollectionMine: boolean,
|
||||
collectionUris: Array<Collection>,
|
||||
collectionIndex?: number,
|
||||
};
|
||||
|
||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
@@ -93,6 +87,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
// is the claim consider nsfw?
|
||||
nsfw,
|
||||
claimIsMine,
|
||||
isSubscribed,
|
||||
streamingUrl,
|
||||
// user properties
|
||||
channelIsBlocked,
|
||||
@@ -118,32 +113,21 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
hideActions = false,
|
||||
properties,
|
||||
onClick,
|
||||
hideBlock,
|
||||
actions,
|
||||
mutedUris,
|
||||
blockedUris,
|
||||
blockedChannelUris,
|
||||
blackListedOutpoints,
|
||||
filteredOutpoints,
|
||||
includeSupportAction,
|
||||
renderActions,
|
||||
hideMenu = false,
|
||||
// repostUrl,
|
||||
isLivestream, // need both? CHECK
|
||||
live,
|
||||
collectionId,
|
||||
collectionIndex,
|
||||
editCollection,
|
||||
isCollectionMine,
|
||||
collectionUris,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
const WrapperElement = wrapperElement || 'li';
|
||||
const shouldFetch =
|
||||
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
||||
const abandoned = !isResolvingUri && !claim;
|
||||
const isMyCollection = collectionId && (isCollectionMine || collectionId.includes('-'));
|
||||
const shouldHideActions = hideActions || isMyCollection || type === 'small' || type === 'tooltip';
|
||||
const shouldHideActions = hideActions || type === 'small' || type === 'tooltip';
|
||||
const canonicalUrl = claim && claim.canonical_url;
|
||||
const lastCollectionIndex = collectionUris ? collectionUris.length - 1 : 0;
|
||||
let isValid = false;
|
||||
if (uri) {
|
||||
try {
|
||||
@@ -153,16 +137,12 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
const isCollection = claim && claim.value_type === 'collection';
|
||||
const isChannelUri = isValid ? parseURI(uri).isChannel : false;
|
||||
const isRepost = claim && claim.repost_url;
|
||||
|
||||
const contentUri = claim && isRepost ? claim.canonical_url || claim.permanent_url : uri;
|
||||
const isChannelUri = isValid ? parseURI(contentUri).isChannel : false;
|
||||
const signingChannel = claim && claim.signing_channel;
|
||||
let navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
|
||||
if (collectionId) {
|
||||
const collectionParams = new URLSearchParams();
|
||||
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, collectionId);
|
||||
navigateUrl = navigateUrl + `?` + collectionParams.toString();
|
||||
}
|
||||
const channelUri = claim && (signingChannel ? signingChannel.permanent_url : claim.permanent_url);
|
||||
const navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
|
||||
const navLinkProps = {
|
||||
to: navigateUrl,
|
||||
onClick: (e) => e.stopPropagation(),
|
||||
@@ -192,11 +172,13 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
);
|
||||
}
|
||||
// block stream claims
|
||||
if (claim && !shouldHide && !showUserBlocked && mutedUris.length && signingChannel) {
|
||||
shouldHide = mutedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
if (claim && !shouldHide && !showUserBlocked && blockedChannelUris.length && signingChannel) {
|
||||
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
}
|
||||
if (claim && !shouldHide && !showUserBlocked && blockedUris.length && signingChannel) {
|
||||
shouldHide = blockedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
// block channel claims if we can't control for them in claim search
|
||||
// e.g. fetchRecommendedSubscriptions
|
||||
if (claim && isChannelUri && !shouldHide && !showUserBlocked && blockedChannelUris.length) {
|
||||
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url);
|
||||
}
|
||||
|
||||
if (!shouldHide && customShouldHide && claim) {
|
||||
@@ -207,7 +189,15 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
|
||||
// Weird placement warning
|
||||
// Make sure this happens after we figure out if this claim needs to be hidden
|
||||
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide);
|
||||
const thumbnailUrl = useGetThumbnail(contentUri, claim, streamingUrl, getFile, shouldHide);
|
||||
|
||||
function handleContextMenu(e) {
|
||||
// @if TARGET='app'
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
openClaimPreviewMenu(claim, e);
|
||||
// @endif
|
||||
}
|
||||
|
||||
function handleOnClick(e) {
|
||||
if (onClick) {
|
||||
@@ -225,7 +215,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
}
|
||||
}, [isValid, uri, isResolvingUri, shouldFetch, resolveUri]);
|
||||
|
||||
if ((shouldHide && !showNullPlaceholder) || (isLivestream && !ENABLE_NO_SOURCE_CLAIMS)) {
|
||||
if (shouldHide && !showNullPlaceholder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -251,180 +241,120 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
return empty || <ClaimPreviewNoContent isChannel={isChannelUri} type={type} />;
|
||||
}
|
||||
|
||||
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && isChannelUri && claim === null) {
|
||||
return <AbandonedChannelPreview uri={uri} type />;
|
||||
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && claim === null) {
|
||||
return <AbandonedChannelPreview uri={contentUri} type />;
|
||||
}
|
||||
if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) {
|
||||
if (placeholder === 'publish' && !claim && contentUri.startsWith('lbry://@')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let liveProperty = null;
|
||||
if (live === true) {
|
||||
liveProperty = (claim) => <>LIVE</>;
|
||||
}
|
||||
|
||||
return (
|
||||
<WrapperElement
|
||||
ref={ref}
|
||||
role="link"
|
||||
onClick={pending || type === 'inline' ? undefined : handleOnClick}
|
||||
onContextMenu={handleContextMenu}
|
||||
className={classnames('claim-preview__wrapper', {
|
||||
'claim-preview__wrapper--channel': isChannelUri && type !== 'inline',
|
||||
'claim-preview__wrapper--inline': type === 'inline',
|
||||
'claim-preview__wrapper--small': type === 'small',
|
||||
'claim-preview__live': live,
|
||||
})}
|
||||
>
|
||||
<>
|
||||
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
|
||||
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
|
||||
|
||||
<div
|
||||
className={classnames('claim-preview', {
|
||||
'claim-preview--small': type === 'small' || type === 'tooltip',
|
||||
'claim-preview--large': type === 'large',
|
||||
'claim-preview--inline': type === 'inline',
|
||||
'claim-preview--tooltip': type === 'tooltip',
|
||||
'claim-preview--channel': isChannelUri,
|
||||
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--pending': pending,
|
||||
})}
|
||||
>
|
||||
{isChannelUri && claim ? (
|
||||
<UriIndicator uri={uri} link>
|
||||
<ChannelThumbnail uri={uri} />
|
||||
</UriIndicator>
|
||||
) : (
|
||||
<>
|
||||
{!pending ? (
|
||||
<NavLink {...navLinkProps}>
|
||||
<FileThumbnail thumbnail={thumbnailUrl}>
|
||||
{/* @if TARGET='app' */}
|
||||
{claim && !isCollection && (
|
||||
<div className="claim-preview__hover-actions">
|
||||
<FileDownloadLink uri={canonicalUrl} hideOpenButton hideDownloadStatus />
|
||||
</div>
|
||||
)}
|
||||
{/* @endif */}
|
||||
{!isLivestream && (
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<PreviewOverlayProperties uri={uri} small={type === 'small'} properties={liveProperty} />
|
||||
</div>
|
||||
)}
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
) : (
|
||||
<FileThumbnail thumbnail={thumbnailUrl} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="claim-preview__text">
|
||||
<div className="claim-preview-metadata">
|
||||
<div className="claim-preview-info">
|
||||
{pending ? (
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
) : (
|
||||
<NavLink {...navLinkProps}>
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
</NavLink>
|
||||
)}
|
||||
</div>
|
||||
<ClaimPreviewSubtitle uri={uri} type={type} />
|
||||
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
|
||||
</div>
|
||||
{type !== 'small' && (
|
||||
<div className="claim-preview__actions">
|
||||
{!pending && (
|
||||
<>
|
||||
{renderActions && claim && renderActions(claim)}
|
||||
{Boolean(isMyCollection && collectionId) && (
|
||||
<>
|
||||
<div className="collection-preview__edit-buttons">
|
||||
<div className="collection-preview__edit-group">
|
||||
<Button
|
||||
button="alt"
|
||||
className={'button-collection-order'}
|
||||
disabled={collectionIndex === 0}
|
||||
icon={ICONS.UP}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (editCollection) {
|
||||
// $FlowFixMe
|
||||
editCollection(collectionId, {
|
||||
order: { from: collectionIndex, to: Number(collectionIndex) - 1 },
|
||||
});
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
button="alt"
|
||||
className={'button-collection-order'}
|
||||
icon={ICONS.DOWN}
|
||||
disabled={collectionIndex === lastCollectionIndex}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (editCollection) {
|
||||
// $FlowFixMe
|
||||
editCollection(collectionId, {
|
||||
order: { from: collectionIndex, to: Number(collectionIndex + 1) },
|
||||
});
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="collection-preview__edit-group">
|
||||
<Button
|
||||
button="alt"
|
||||
icon={ICONS.DELETE}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
// $FlowFixMe
|
||||
if (editCollection) editCollection(collectionId, { claims: [claim], remove: true });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{shouldHideActions || renderActions ? null : actions !== undefined ? (
|
||||
actions
|
||||
) : (
|
||||
<div className="claim-preview__primary-actions">
|
||||
{!isChannelUri && signingChannel && (
|
||||
<div className="claim-preview__channel-staked">
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isChannelUri && !channelIsBlocked && !claimIsMine && (
|
||||
<SubscribeButton uri={uri.startsWith('lbry://') ? uri : `lbry://${uri}`} />
|
||||
)}
|
||||
|
||||
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{claim && (
|
||||
<React.Fragment>
|
||||
{typeof properties === 'function' ? (
|
||||
properties(claim)
|
||||
) : properties !== undefined ? (
|
||||
properties
|
||||
) : (
|
||||
<ClaimTags uri={uri} type={type} />
|
||||
)}
|
||||
</React.Fragment>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
className={classnames('claim-preview', {
|
||||
'claim-preview--small': type === 'small' || type === 'tooltip',
|
||||
'claim-preview--large': type === 'large',
|
||||
'claim-preview--inline': type === 'inline',
|
||||
'claim-preview--tooltip': type === 'tooltip',
|
||||
'claim-preview--channel': isChannelUri,
|
||||
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--pending': pending,
|
||||
})}
|
||||
>
|
||||
{isChannelUri && claim ? (
|
||||
<UriIndicator uri={contentUri} link>
|
||||
<ChannelThumbnail uri={contentUri} obscure={channelIsBlocked} />
|
||||
</UriIndicator>
|
||||
) : (
|
||||
<>
|
||||
{!pending ? (
|
||||
<NavLink {...navLinkProps}>
|
||||
<FileThumbnail thumbnail={thumbnailUrl}>
|
||||
{/* @if TARGET='app' */}
|
||||
{claim && (
|
||||
<div className="claim-preview__hover-actions">
|
||||
<FileDownloadLink uri={canonicalUrl} hideOpenButton hideDownloadStatus />
|
||||
</div>
|
||||
)}
|
||||
{/* @endif */}
|
||||
{!isRepost && !isChannelUri && (
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<FileProperties uri={contentUri} small />
|
||||
</div>
|
||||
)}
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
) : (
|
||||
<FileThumbnail thumbnail={thumbnailUrl} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="claim-preview__text">
|
||||
<div className="claim-preview-metadata">
|
||||
<div className="claim-preview-info">
|
||||
{pending ? (
|
||||
<ClaimPreviewTitle uri={contentUri} />
|
||||
) : (
|
||||
<NavLink {...navLinkProps}>
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
</NavLink>
|
||||
)}
|
||||
|
||||
{type !== 'small' && !isChannelUri && signingChannel && SIMPLE_SITE && (
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
)}
|
||||
</div>
|
||||
<ClaimPreviewSubtitle uri={uri} type={type} />
|
||||
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
|
||||
</div>
|
||||
{type !== 'small' && (
|
||||
<div className="claim-preview__actions">
|
||||
{!pending && (
|
||||
<>
|
||||
{renderActions && claim && renderActions(claim)}
|
||||
{shouldHideActions || renderActions ? null : actions !== undefined ? (
|
||||
actions
|
||||
) : (
|
||||
<div className="claim-preview__primary-actions">
|
||||
{isChannelUri && !channelIsBlocked && !claimIsMine && (
|
||||
<SubscribeButton uri={contentUri.startsWith('lbry://') ? contentUri : `lbry://${contentUri}`} />
|
||||
)}
|
||||
{!hideBlock && isChannelUri && !isSubscribed && (!claimIsMine || channelIsBlocked) && (
|
||||
<BlockButton uri={contentUri.startsWith('lbry://') ? contentUri : `lbry://${contentUri}`} />
|
||||
)}
|
||||
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{claim && (
|
||||
<React.Fragment>
|
||||
{typeof properties === 'function' ? (
|
||||
properties(claim)
|
||||
) : properties !== undefined ? (
|
||||
properties
|
||||
) : (
|
||||
<ClaimTags uri={uri} type={type} />
|
||||
)}
|
||||
</React.Fragment>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{!hideMenu && <ClaimMenuList uri={uri} collectionId={collectionId} channelUri={channelUri} isRepost={isRepost} />}
|
||||
</>
|
||||
</div>
|
||||
</WrapperElement>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
import * as PAGES from 'constants/pages';
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsPending,
|
||||
doClearPublish,
|
||||
doPrepareEdit,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectClaimForUri, makeSelectClaimIsPending, doClearPublish, doPrepareEdit } from 'lbry-redux';
|
||||
import { push } from 'connected-react-router';
|
||||
import ClaimPreviewSubtitle from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
pending: makeSelectClaimIsPending(props.uri)(state),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
beginPublish: (name) => {
|
||||
const perform = dispatch => ({
|
||||
beginPublish: name => {
|
||||
dispatch(doClearPublish());
|
||||
dispatch(doPrepareEdit({ name }));
|
||||
dispatch(push(`/$/${PAGES.UPLOAD}`));
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||
import React from 'react';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import DateTime from 'component/dateTime';
|
||||
@@ -12,11 +11,10 @@ type Props = {
|
||||
pending?: boolean,
|
||||
type: string,
|
||||
beginPublish: (string) => void,
|
||||
isLivestream: boolean,
|
||||
};
|
||||
|
||||
function ClaimPreviewSubtitle(props: Props) {
|
||||
const { pending, uri, claim, type, beginPublish, isLivestream } = props;
|
||||
const { pending, uri, claim, type, beginPublish } = props;
|
||||
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
||||
|
||||
let isChannel;
|
||||
@@ -30,16 +28,13 @@ function ClaimPreviewSubtitle(props: Props) {
|
||||
{claim ? (
|
||||
<React.Fragment>
|
||||
<UriIndicator uri={uri} link />{' '}
|
||||
{!pending && claim && (
|
||||
<>
|
||||
{isChannel &&
|
||||
type !== 'inline' &&
|
||||
`${claimsInChannel} ${claimsInChannel === 1 ? __('upload') : __('uploads')}`}
|
||||
|
||||
{!isChannel &&
|
||||
(isLivestream && ENABLE_NO_SOURCE_CLAIMS ? __('Livestream') : <DateTime timeAgo uri={uri} />)}
|
||||
</>
|
||||
)}
|
||||
{!pending &&
|
||||
claim &&
|
||||
(isChannel ? (
|
||||
type !== 'inline' && `${claimsInChannel} ${claimsInChannel === 1 ? __('upload') : __('uploads')}`
|
||||
) : (
|
||||
<DateTime timeAgo uri={uri} />
|
||||
))}
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
|
||||
@@ -8,9 +8,8 @@ import {
|
||||
doFileGet,
|
||||
makeSelectChannelForClaimUri,
|
||||
makeSelectClaimIsNsfw,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
} from 'lbry-redux';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { selectBlockedChannels } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import ClaimPreviewTile from './view';
|
||||
@@ -23,15 +22,14 @@ const select = (state, props) => ({
|
||||
title: props.uri && makeSelectTitleForUri(props.uri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
blockedChannelUris: selectMutedChannels(state),
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
isMature: makeSelectClaimIsNsfw(props.uri)(state),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(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);
|
||||
@@ -10,12 +10,13 @@ import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import useGetThumbnail from 'effects/use-get-thumbnail';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { parseURI, COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import PreviewOverlayProperties from 'component/previewOverlayProperties';
|
||||
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';
|
||||
import CollectionPreviewOverlay from 'component/collectionPreviewOverlay';
|
||||
// @if TARGET='app'
|
||||
import { openClaimPreviewMenu } from 'util/context-menu';
|
||||
// @endif
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -40,12 +41,6 @@ type Props = {
|
||||
streamingUrl: string,
|
||||
isMature: boolean,
|
||||
showMature: boolean,
|
||||
showHiddenByUser?: boolean,
|
||||
properties?: (Claim) => void,
|
||||
live?: boolean,
|
||||
collectionId?: string,
|
||||
hideLivestreamClaims?: boolean,
|
||||
isLivestream: boolean,
|
||||
};
|
||||
|
||||
function ClaimPreviewTile(props: Props) {
|
||||
@@ -65,27 +60,13 @@ function ClaimPreviewTile(props: Props) {
|
||||
blockedChannelUris,
|
||||
isMature,
|
||||
showMature,
|
||||
showHiddenByUser,
|
||||
properties,
|
||||
live,
|
||||
hideLivestreamClaims,
|
||||
isLivestream,
|
||||
collectionId,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
const isCollection = claim && claim.value_type === 'collection';
|
||||
const isStream = claim && claim.value_type === 'stream';
|
||||
const collectionClaimId = isCollection && claim && claim.claim_id;
|
||||
const shouldFetch = claim === undefined;
|
||||
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, placeholder) || thumbnail;
|
||||
const canonicalUrl = claim && claim.canonical_url;
|
||||
let navigateUrl = formatLbryUrlForWeb(canonicalUrl || uri || '/');
|
||||
const listId = collectionId || collectionClaimId;
|
||||
if (listId) {
|
||||
const collectionParams = new URLSearchParams();
|
||||
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId);
|
||||
navigateUrl = navigateUrl + `?` + collectionParams.toString();
|
||||
}
|
||||
const navigateUrl = formatLbryUrlForWeb(canonicalUrl || uri || '/');
|
||||
|
||||
const navLinkProps = {
|
||||
to: navigateUrl,
|
||||
onClick: (e) => e.stopPropagation(),
|
||||
@@ -102,8 +83,11 @@ function ClaimPreviewTile(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
let channelUri;
|
||||
const signingChannel = claim && claim.signing_channel;
|
||||
const channelUri = signingChannel && signingChannel.permanent_url;
|
||||
if (signingChannel) {
|
||||
channelUri = signingChannel.permanent_url;
|
||||
}
|
||||
|
||||
function handleClick(e) {
|
||||
if (navigateUrl) {
|
||||
@@ -144,20 +128,20 @@ function ClaimPreviewTile(props: Props) {
|
||||
}
|
||||
|
||||
// block stream claims
|
||||
if (claim && !shouldHide && !showHiddenByUser && blockedChannelUris.length && signingChannel) {
|
||||
if (claim && !shouldHide && 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 && !showHiddenByUser && blockedChannelUris.length) {
|
||||
if (claim && isChannel && !shouldHide && blockedChannelUris.length) {
|
||||
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url);
|
||||
}
|
||||
|
||||
if (shouldHide || (isLivestream && hideLivestreamClaims)) {
|
||||
if (shouldHide) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (placeholder || (!claim && isResolvingUri)) {
|
||||
if (placeholder || isResolvingUri) {
|
||||
return (
|
||||
<li className={classnames('claim-preview--tile', {})}>
|
||||
<div className="placeholder media__thumb" />
|
||||
@@ -169,18 +153,21 @@ function ClaimPreviewTile(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
let liveProperty = null;
|
||||
if (live === true) {
|
||||
liveProperty = (claim) => <>LIVE</>;
|
||||
function handleContextMenu(e) {
|
||||
// @if TARGET='app'
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
openClaimPreviewMenu(claim, e);
|
||||
// @endif
|
||||
}
|
||||
|
||||
return (
|
||||
<li
|
||||
role="link"
|
||||
onClick={handleClick}
|
||||
onContextMenu={handleContextMenu}
|
||||
className={classnames('card claim-preview--tile', {
|
||||
'claim-preview__wrapper--channel': isChannel,
|
||||
'claim-preview__live': live,
|
||||
})}
|
||||
>
|
||||
<NavLink {...navLinkProps}>
|
||||
@@ -188,22 +175,12 @@ function ClaimPreviewTile(props: Props) {
|
||||
{!isChannel && (
|
||||
<React.Fragment>
|
||||
{/* @if TARGET='app' */}
|
||||
{isStream && (
|
||||
<div className="claim-preview__hover-actions">
|
||||
<FileDownloadLink uri={canonicalUrl} hideOpenButton />
|
||||
</div>
|
||||
)}
|
||||
{/* @endif */}
|
||||
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<PreviewOverlayProperties uri={uri} properties={liveProperty || properties} />
|
||||
<div className="claim-preview__hover-actions">
|
||||
<FileDownloadLink uri={canonicalUrl} hideOpenButton />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)}
|
||||
{isCollection && (
|
||||
<React.Fragment>
|
||||
<div className="claim-preview__collection-wrapper">
|
||||
<CollectionPreviewOverlay collectionId={listId} uri={uri} />
|
||||
{/* @endif */}
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<FileProperties uri={uri} small />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)}
|
||||
@@ -214,10 +191,9 @@ function ClaimPreviewTile(props: Props) {
|
||||
<TruncatedText text={title || (claim && claim.name)} lines={isChannel ? 1 : 2} />
|
||||
{isChannel && (
|
||||
<div className="claim-tile__about">
|
||||
<UriIndicator uri={uri} />
|
||||
<UriIndicator uri={uri} link />
|
||||
</div>
|
||||
)}
|
||||
<ClaimMenuList uri={uri} collectionId={listId} channelUri={channelUri} isRepost={isRepost} />
|
||||
</h2>
|
||||
</NavLink>
|
||||
<div>
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import Icon from 'component/common/icon';
|
||||
import FilePrice from 'component/filePrice';
|
||||
import ClaimType from 'component/claimType';
|
||||
import * as COL from 'constants/collections';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
isSubscribed: boolean,
|
||||
small: boolean,
|
||||
claim: Claim | CollectionClaim,
|
||||
iconOnly: boolean,
|
||||
};
|
||||
export default function ClaimProperties(props: Props) {
|
||||
const { uri, isSubscribed, small = false, claim, iconOnly } = props;
|
||||
const isCollection = claim && claim.value_type === 'collection';
|
||||
const size = small ? COL.ICON_SIZE : undefined;
|
||||
// $FlowFixMe
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classnames('claim-preview__overlay-properties', { 'claim-preview__overlay-properties--small': small })}
|
||||
>
|
||||
{
|
||||
<>
|
||||
<ClaimType uri={uri} small />
|
||||
{/* // $FlowFixMe */}
|
||||
{isCollection && claim && claim.value.claims && !iconOnly && <div>{claim.value.claims.length}</div>}
|
||||
{isSubscribed && <Icon size={size} tooltip icon={ICONS.SUBSCRIBE} />}
|
||||
<FilePrice hideFree uri={uri} />
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -52,8 +52,8 @@ export default function ClaimTags(props: Props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={classnames('claim__tags', { 'claim__tags--large': type === 'large' })}>
|
||||
{tagsToDisplay.map((tag) => (
|
||||
<div className={classnames('file-properties--small', { 'file-properties--large': type === 'large' })}>
|
||||
{tagsToDisplay.map(tag => (
|
||||
<Tag key={tag} title={tag} name={tag} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,25 +1,16 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doClaimSearch,
|
||||
selectClaimSearchByQuery,
|
||||
selectFetchingClaimSearchByQuery,
|
||||
SETTINGS,
|
||||
selectClaimsByUri,
|
||||
} from 'lbry-redux';
|
||||
import { doClaimSearch, selectClaimSearchByQuery, selectFetchingClaimSearchByQuery, SETTINGS } from 'lbry-redux';
|
||||
import { selectBlockedChannels } from 'redux/selectors/blocked';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { selectModerationBlockList } from 'redux/selectors/comments';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import ClaimListDiscover from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
const select = state => ({
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
claimsByUri: selectClaimsByUri(state),
|
||||
fetchingClaimSearchByQuery: selectFetchingClaimSearchByQuery(state),
|
||||
showNsfw: selectShowMatureContent(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
blockedUris: selectModerationBlockList(state),
|
||||
hiddenUris: selectBlockedChannels(state),
|
||||
});
|
||||
|
||||
const perform = {
|
||||
|
||||
@@ -1,88 +1,8 @@
|
||||
// @flow
|
||||
import { ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import type { Node } from 'react';
|
||||
import React from 'react';
|
||||
import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
import { useHistory } from 'react-router';
|
||||
import { getLivestreamOnlyOptions } from 'util/search';
|
||||
|
||||
/**
|
||||
* Updates 'uris' by adding and/or moving active livestreams to the front of
|
||||
* list.
|
||||
* 'liveUris' is also updated with any entries that were moved to the
|
||||
* front, for convenience.
|
||||
*
|
||||
* @param uris [Ref]
|
||||
* @param liveUris [Ref]
|
||||
* @param livestreamMap
|
||||
* @param claimsByUri
|
||||
* @param claimSearchByQuery
|
||||
* @param options
|
||||
*/
|
||||
export function prioritizeActiveLivestreams(
|
||||
uris: Array<string>,
|
||||
liveUris: Array<string>,
|
||||
livestreamMap: { [string]: any },
|
||||
claimsByUri: { [string]: any },
|
||||
claimSearchByQuery: { [string]: Array<string> },
|
||||
options: any
|
||||
) {
|
||||
if (!livestreamMap || !uris) return;
|
||||
|
||||
const claimIsLive = (claim, liveChannelIds) => {
|
||||
// This function relies on:
|
||||
// 1. Only 1 actual livestream per channel (i.e. all other livestream-claims
|
||||
// for that channel actually point to the same source).
|
||||
// 2. 'liveChannelIds' needs to be pruned after being accounted for,
|
||||
// otherwise all livestream-claims will be "live" (we'll only take the
|
||||
// latest one as "live" ).
|
||||
return (
|
||||
claim &&
|
||||
claim.value_type === 'stream' &&
|
||||
claim.value.source === undefined &&
|
||||
claim.signing_channel &&
|
||||
liveChannelIds.includes(claim.signing_channel.claim_id)
|
||||
);
|
||||
};
|
||||
|
||||
let liveChannelIds = Object.keys(livestreamMap);
|
||||
|
||||
// 1. Collect active livestreams from the primary search to put in front.
|
||||
uris.forEach((uri) => {
|
||||
const claim = claimsByUri[uri];
|
||||
if (claimIsLive(claim, liveChannelIds)) {
|
||||
liveUris.push(uri);
|
||||
// This live channel has been accounted for, so remove it.
|
||||
liveChannelIds.splice(liveChannelIds.indexOf(claim.signing_channel.claim_id), 1);
|
||||
}
|
||||
});
|
||||
|
||||
// 2. Now, repeat on the secondary search.
|
||||
if (options) {
|
||||
const livestreamsOnlySearchCacheQuery = createNormalizedClaimSearchKey(getLivestreamOnlyOptions(options));
|
||||
const livestreamsOnlyUris = claimSearchByQuery[livestreamsOnlySearchCacheQuery];
|
||||
if (livestreamsOnlyUris) {
|
||||
livestreamsOnlyUris.forEach((uri) => {
|
||||
const claim = claimsByUri[uri];
|
||||
if (!uris.includes(uri) && claimIsLive(claim, liveChannelIds)) {
|
||||
liveUris.push(uri);
|
||||
// This live channel has been accounted for, so remove it.
|
||||
liveChannelIds.splice(liveChannelIds.indexOf(claim.signing_channel.claim_id), 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Finalize uris by putting live livestreams in front.
|
||||
const newUris = liveUris.concat(uris.filter((uri) => !liveUris.includes(uri)));
|
||||
uris.splice(0, uris.length, ...newUris);
|
||||
}
|
||||
|
||||
// ****************************************************************************
|
||||
// ClaimTilesDiscover
|
||||
// ****************************************************************************
|
||||
|
||||
type Props = {
|
||||
prefixUris?: Array<string>,
|
||||
@@ -90,74 +10,56 @@ type Props = {
|
||||
doClaimSearch: ({}) => void,
|
||||
showNsfw: boolean,
|
||||
hideReposts: boolean,
|
||||
history: { action: string, push: (string) => void, replace: (string) => void },
|
||||
claimSearchByQuery: { [string]: Array<string> },
|
||||
fetchingClaimSearchByQuery: { [string]: boolean },
|
||||
claimsByUri: { [string]: any },
|
||||
history: { action: string, push: string => void, replace: string => void },
|
||||
claimSearchByQuery: {
|
||||
[string]: Array<string>,
|
||||
},
|
||||
fetchingClaimSearchByQuery: {
|
||||
[string]: boolean,
|
||||
},
|
||||
// claim search options are below
|
||||
tags: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
mutedUris: Array<string>,
|
||||
hiddenUris: Array<string>,
|
||||
claimIds?: Array<string>,
|
||||
channelIds?: Array<string>,
|
||||
notChannelIds?: Array<string>,
|
||||
pageSize: number,
|
||||
orderBy?: Array<string>,
|
||||
releaseTime?: string,
|
||||
languages?: Array<string>,
|
||||
claimType?: string | Array<string>,
|
||||
streamTypes?: Array<string>,
|
||||
claimType?: Array<string>,
|
||||
timestamp?: string,
|
||||
feeAmount?: string,
|
||||
limitClaimsPerChannel?: number,
|
||||
hasSource?: boolean,
|
||||
hasNoSource?: boolean,
|
||||
renderProperties?: (Claim) => ?Node,
|
||||
liveLivestreamsFirst?: boolean,
|
||||
livestreamMap?: { [string]: any },
|
||||
pin?: boolean,
|
||||
};
|
||||
|
||||
function ClaimTilesDiscover(props: Props) {
|
||||
const {
|
||||
doClaimSearch,
|
||||
claimSearchByQuery,
|
||||
claimsByUri,
|
||||
showNsfw,
|
||||
hideReposts,
|
||||
hiddenUris,
|
||||
// Below are options to pass that are forwarded to claim_search
|
||||
tags,
|
||||
channelIds,
|
||||
claimIds,
|
||||
notChannelIds,
|
||||
orderBy,
|
||||
pageSize = 8,
|
||||
releaseTime,
|
||||
languages,
|
||||
claimType,
|
||||
streamTypes,
|
||||
prefixUris,
|
||||
timestamp,
|
||||
feeAmount,
|
||||
limitClaimsPerChannel,
|
||||
fetchingClaimSearchByQuery,
|
||||
hasSource,
|
||||
hasNoSource,
|
||||
renderProperties,
|
||||
blockedUris,
|
||||
mutedUris,
|
||||
liveLivestreamsFirst,
|
||||
livestreamMap,
|
||||
pin,
|
||||
prefixUris,
|
||||
} = props;
|
||||
|
||||
const { location } = useHistory();
|
||||
const urlParams = new URLSearchParams(location.search);
|
||||
const feeAmountInUrl = urlParams.get('fee_amount');
|
||||
const feeAmountParam = feeAmountInUrl || feeAmount || CS.FEE_AMOUNT_ONLY_FREE;
|
||||
const mutedAndBlockedChannelIds = Array.from(new Set(mutedUris.concat(blockedUris).map((uri) => uri.split('#')[1])));
|
||||
const liveUris = [];
|
||||
|
||||
const [prevUris, setPrevUris] = React.useState([]);
|
||||
|
||||
const feeAmountParam = feeAmountInUrl || feeAmount;
|
||||
const options: {
|
||||
page_size: number,
|
||||
no_totals: boolean,
|
||||
@@ -169,13 +71,11 @@ function ClaimTilesDiscover(props: Props) {
|
||||
order_by: Array<string>,
|
||||
languages?: Array<string>,
|
||||
release_time?: string,
|
||||
claim_type?: string | Array<string>,
|
||||
claim_type?: Array<string>,
|
||||
timestamp?: string,
|
||||
fee_amount?: string,
|
||||
limit_claims_per_channel?: number,
|
||||
stream_types?: Array<string>,
|
||||
has_source?: boolean,
|
||||
has_no_source?: boolean,
|
||||
} = {
|
||||
page_size: pageSize,
|
||||
claim_type: claimType || undefined,
|
||||
@@ -186,18 +86,13 @@ function ClaimTilesDiscover(props: Props) {
|
||||
not_tags: !showNsfw ? MATURE_TAGS : [],
|
||||
any_languages: languages,
|
||||
channel_ids: channelIds || [],
|
||||
not_channel_ids: mutedAndBlockedChannelIds,
|
||||
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]) : []),
|
||||
order_by: orderBy || ['trending_group', 'trending_mixed'],
|
||||
stream_types:
|
||||
streamTypes === null ? undefined : SIMPLE_SITE && !hasNoSource ? [CS.FILE_VIDEO, CS.FILE_AUDIO] : undefined,
|
||||
};
|
||||
|
||||
if (ENABLE_NO_SOURCE_CLAIMS && hasNoSource) {
|
||||
options.has_no_source = true;
|
||||
} else if (hasSource || (!ENABLE_NO_SOURCE_CLAIMS && (!claimType || claimType === 'stream'))) {
|
||||
options.has_source = true;
|
||||
}
|
||||
|
||||
if (releaseTime) {
|
||||
options.release_time = releaseTime;
|
||||
}
|
||||
@@ -213,7 +108,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'];
|
||||
}
|
||||
@@ -231,81 +126,24 @@ function ClaimTilesDiscover(props: Props) {
|
||||
options.claim_ids = claimIds;
|
||||
}
|
||||
|
||||
const mainSearchKey = createNormalizedClaimSearchKey(options);
|
||||
const livestreamSearchKey = liveLivestreamsFirst
|
||||
? createNormalizedClaimSearchKey(getLivestreamOnlyOptions(options))
|
||||
: undefined;
|
||||
|
||||
let uris = (prefixUris || []).concat(claimSearchByQuery[mainSearchKey] || []);
|
||||
|
||||
const isLoading = fetchingClaimSearchByQuery[mainSearchKey];
|
||||
// && !isLoading isn't on master, doesn't seem to affect the functionality, don't recall why it was added.
|
||||
if (liveLivestreamsFirst && livestreamMap && !isLoading) {
|
||||
prioritizeActiveLivestreams(uris, liveUris, livestreamMap, claimsByUri, claimSearchByQuery, options);
|
||||
}
|
||||
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
const uris = (prefixUris || []).concat(claimSearchByQuery[claimSearchCacheQuery] || []);
|
||||
// Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time
|
||||
const optionsStringForEffect = JSON.stringify(options);
|
||||
const isLoading = fetchingClaimSearchByQuery[claimSearchCacheQuery];
|
||||
const shouldPerformSearch = !isLoading && uris.length === 0;
|
||||
|
||||
if (
|
||||
prefixUris === undefined &&
|
||||
(claimSearchByQuery[mainSearchKey] === undefined ||
|
||||
(livestreamSearchKey && claimSearchByQuery[livestreamSearchKey] === undefined))
|
||||
) {
|
||||
// This is a new query and we don't have results yet ...
|
||||
if (prevUris.length !== 0) {
|
||||
// ... but we have previous results. Use it until new results are here.
|
||||
uris = prevUris;
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (shouldPerformSearch) {
|
||||
const searchOptions = JSON.parse(optionsStringForEffect);
|
||||
doClaimSearch(searchOptions);
|
||||
|
||||
if (liveLivestreamsFirst) {
|
||||
doClaimSearch(getLivestreamOnlyOptions(searchOptions));
|
||||
}
|
||||
}
|
||||
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect, liveLivestreamsFirst]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (JSON.stringify(prevUris) !== JSON.stringify(uris) && !shouldPerformSearch) {
|
||||
setPrevUris(uris);
|
||||
}
|
||||
}, [shouldPerformSearch, prevUris, uris]);
|
||||
|
||||
const resolveLive = (index) => {
|
||||
if (liveLivestreamsFirst && livestreamMap && index < liveUris.length) {
|
||||
return true;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const modifiedUris = uris ? uris.slice() : [];
|
||||
const fixUris = [
|
||||
'lbry://@AdrianLogan#5/why-i-talk-to-myself#3',
|
||||
];
|
||||
|
||||
if (pin && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {
|
||||
fixUris.forEach((fixUri) => {
|
||||
if (modifiedUris.indexOf(fixUri) !== -1) {
|
||||
modifiedUris.splice(modifiedUris.indexOf(fixUri), 1);
|
||||
} else {
|
||||
modifiedUris.pop();
|
||||
}
|
||||
});
|
||||
modifiedUris.splice(2, 0, ...fixUris);
|
||||
}
|
||||
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect]);
|
||||
|
||||
return (
|
||||
<ul className="claim-grid">
|
||||
{modifiedUris && modifiedUris.length
|
||||
? modifiedUris.map((uri, index) => (
|
||||
<ClaimPreviewTile key={uri} uri={uri} properties={renderProperties} live={resolveLive(index)} />
|
||||
))
|
||||
{uris && uris.length
|
||||
? uris.map(uri => <ClaimPreviewTile key={uri} uri={uri} />)
|
||||
: new Array(pageSize).fill(1).map((x, i) => <ClaimPreviewTile key={i} placeholder />)}
|
||||
</ul>
|
||||
);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, makeSelectClaimIsStreamPlaceholder } from 'lbry-redux';
|
||||
import FileType from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
isLivestream: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(FileType);
|
||||
@@ -1,29 +0,0 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as COL from 'constants/collections';
|
||||
|
||||
type Props = {
|
||||
claim: Claim,
|
||||
small: boolean,
|
||||
};
|
||||
|
||||
function ClaimType(props: Props) {
|
||||
const { claim, small } = props;
|
||||
const { value_type: claimType } = claim || {};
|
||||
|
||||
const size = small ? COL.ICON_SIZE : undefined;
|
||||
|
||||
if (claimType === 'collection') {
|
||||
return <Icon size={size} icon={ICONS.STACK} />;
|
||||
} else if (claimType === 'channel') {
|
||||
return <Icon size={size} icon={ICONS.CHANNEL} />;
|
||||
} else if (claimType === 'repost') {
|
||||
return <Icon size={size} icon={ICONS.REPOST} />;
|
||||
}
|
||||
|
||||
return <Icon icon={ICONS.DOWNLOADABLE} />;
|
||||
}
|
||||
|
||||
export default ClaimType;
|
||||
@@ -1,30 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectClaimForUri,
|
||||
selectMyChannelClaims,
|
||||
makeSelectClaimIsPending,
|
||||
makeSelectCollectionIsMine,
|
||||
makeSelectEditedCollectionForId,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import CollectionActions from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
costInfo: makeSelectCostInfoForUri(props.uri)(state),
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
claimIsPending: makeSelectClaimIsPending(props.uri)(state),
|
||||
isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state),
|
||||
collectionHasEdits: Boolean(makeSelectEditedCollectionForId(props.collectionId)(state)),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
doToast: (options) => dispatch(doToast(options)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CollectionActions);
|
||||
@@ -1,130 +0,0 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import { useIsMobile } from 'effects/use-screensize';
|
||||
import ClaimSupportButton from 'component/claimSupportButton';
|
||||
import FileReactions from 'component/fileReactions';
|
||||
import { useHistory } from 'react-router';
|
||||
import { EDIT_PAGE, PAGE_VIEW_QUERY } from 'page/collection/view';
|
||||
import classnames from 'classnames';
|
||||
import { ENABLE_FILE_REACTIONS } from 'config';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: StreamClaim,
|
||||
openModal: (id: string, { uri: string, claimIsMine?: boolean, isSupport?: boolean }) => void,
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
doToast: ({ message: string }) => void,
|
||||
claimIsPending: boolean,
|
||||
isMyCollection: boolean,
|
||||
collectionId: string,
|
||||
showInfo: boolean,
|
||||
setShowInfo: (boolean) => void,
|
||||
collectionHasEdits: boolean,
|
||||
};
|
||||
|
||||
function CollectionActions(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
openModal,
|
||||
claim,
|
||||
claimIsPending,
|
||||
isMyCollection,
|
||||
collectionId,
|
||||
showInfo,
|
||||
setShowInfo,
|
||||
collectionHasEdits,
|
||||
} = props;
|
||||
const { push } = useHistory();
|
||||
const isMobile = useIsMobile();
|
||||
const claimId = claim && claim.claim_id;
|
||||
const webShareable = true; // collections have cost?
|
||||
const lhsSection = (
|
||||
<>
|
||||
{ENABLE_FILE_REACTIONS && uri && <FileReactions uri={uri} />}
|
||||
{uri && <ClaimSupportButton uri={uri} fileAction />}
|
||||
{/* TODO Add ClaimRepostButton component */}
|
||||
{uri && (
|
||||
<Button
|
||||
className="button--file-action"
|
||||
icon={ICONS.SHARE}
|
||||
label={__('Share')}
|
||||
title={__('Share')}
|
||||
onClick={() => openModal(MODALS.SOCIAL_SHARE, { uri, webShareable })}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
const rhsSection = (
|
||||
<>
|
||||
{isMyCollection && (
|
||||
<Button
|
||||
title={uri ? __('Update') : __('Publish')}
|
||||
label={uri ? __('Update') : __('Publish')}
|
||||
className={classnames('button--file-action')}
|
||||
onClick={() => push(`?${PAGE_VIEW_QUERY}=${EDIT_PAGE}`)}
|
||||
icon={ICONS.PUBLISH}
|
||||
iconColor={collectionHasEdits && 'red'}
|
||||
iconSize={18}
|
||||
disabled={claimIsPending}
|
||||
/>
|
||||
)}
|
||||
{isMyCollection && (
|
||||
<Button
|
||||
className={classnames('button--file-action')}
|
||||
title={__('Delete List')}
|
||||
onClick={() => openModal(MODALS.COLLECTION_DELETE, { uri, collectionId, redirect: `/$/${PAGES.LISTS}` })}
|
||||
icon={ICONS.DELETE}
|
||||
iconSize={18}
|
||||
description={__('Delete List')}
|
||||
disabled={claimIsPending}
|
||||
/>
|
||||
)}
|
||||
{!isMyCollection && (
|
||||
<Button
|
||||
title={__('Report content')}
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPORT}
|
||||
navigate={`/$/${PAGES.REPORT_CONTENT}?claimId=${claimId}`}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
const infoButton = (
|
||||
<Button
|
||||
title={__('Info')}
|
||||
className={classnames('button-toggle', {
|
||||
'button-toggle--active': showInfo,
|
||||
})}
|
||||
icon={ICONS.MORE}
|
||||
onClick={() => setShowInfo(!showInfo)}
|
||||
/>
|
||||
);
|
||||
|
||||
if (isMobile) {
|
||||
return (
|
||||
<div className="media__actions">
|
||||
{lhsSection}
|
||||
{rhsSection}
|
||||
{uri && <span>{infoButton}</span>}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<div className="media__subtitle--between">
|
||||
<div className="section__actions">
|
||||
{lhsSection}
|
||||
{rhsSection}
|
||||
</div>
|
||||
{uri && <>{infoButton}</>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CollectionActions;
|
||||
@@ -1,24 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import CollectionContent from './view';
|
||||
import {
|
||||
makeSelectUrlsForCollectionId,
|
||||
makeSelectNameForCollectionId,
|
||||
makeSelectCollectionForId,
|
||||
makeSelectClaimForClaimId,
|
||||
makeSelectClaimIsMine,
|
||||
} from 'lbry-redux';
|
||||
|
||||
const select = (state, props) => {
|
||||
const claim = makeSelectClaimForClaimId(props.id)(state);
|
||||
const url = claim && claim.permanent_url;
|
||||
|
||||
return {
|
||||
collection: makeSelectCollectionForId(props.id)(state),
|
||||
collectionUrls: makeSelectUrlsForCollectionId(props.id)(state),
|
||||
collectionName: makeSelectNameForCollectionId(props.id)(state),
|
||||
claim,
|
||||
isMine: makeSelectClaimIsMine(url)(state),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(select)(CollectionContent);
|
||||
@@ -1,42 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import ClaimList from 'component/claimList';
|
||||
import Card from 'component/common/card';
|
||||
import Button from 'component/button';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as ICONS from 'constants/icons';
|
||||
|
||||
type Props = {
|
||||
collectionUrls: Array<Claim>,
|
||||
collectionName: string,
|
||||
collection: any,
|
||||
createUnpublishedCollection: (string, Array<any>, ?string) => void,
|
||||
id: string,
|
||||
claim: Claim,
|
||||
isMine: boolean,
|
||||
};
|
||||
|
||||
export default function CollectionContent(props: Props) {
|
||||
const { collectionUrls, collectionName, id } = props;
|
||||
|
||||
return (
|
||||
<Card
|
||||
isBodyList
|
||||
className="file-page__recommended"
|
||||
title={
|
||||
<span>
|
||||
<Icon icon={ICONS.STACK} className="icon--margin-right" />
|
||||
{collectionName}
|
||||
</span>
|
||||
}
|
||||
titleActions={
|
||||
<>
|
||||
{/* TODO: BUTTON TO SAVE COLLECTION - Probably save/copy modal */}
|
||||
<Button label={'View List'} button="link" navigate={`/$/${PAGES.LIST}/${id}`} />
|
||||
</>
|
||||
}
|
||||
body={<ClaimList isCardBody type="small" uris={collectionUrls} collectionId={id} empty={__('List is Empty')} />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectTitleForUri,
|
||||
makeSelectThumbnailForUri,
|
||||
makeSelectMetadataItemForUri,
|
||||
doCollectionPublish,
|
||||
doCollectionPublishUpdate,
|
||||
makeSelectAmountForUri,
|
||||
makeSelectClaimForUri,
|
||||
selectUpdateCollectionError,
|
||||
selectUpdatingCollection,
|
||||
selectCreateCollectionError,
|
||||
selectBalance,
|
||||
doClearCollectionErrors,
|
||||
selectCreatingCollection,
|
||||
makeSelectCollectionForId,
|
||||
makeSelectUrlsForCollectionId,
|
||||
makeSelectClaimIdsForCollectionId,
|
||||
} from 'lbry-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
|
||||
import CollectionPage from './view';
|
||||
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
thumbnailUrl: makeSelectThumbnailForUri(props.uri)(state),
|
||||
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
||||
tags: makeSelectMetadataItemForUri(props.uri, 'tags')(state),
|
||||
locations: makeSelectMetadataItemForUri(props.uri, 'locations')(state),
|
||||
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
|
||||
amount: makeSelectAmountForUri(props.uri)(state),
|
||||
updateError: selectUpdateCollectionError(state),
|
||||
updatingCollection: selectUpdatingCollection(state),
|
||||
createError: selectCreateCollectionError(state),
|
||||
creatingCollection: selectCreatingCollection(state),
|
||||
balance: selectBalance(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
incognito: selectIncognito(state),
|
||||
collection: makeSelectCollectionForId(props.collectionId)(state),
|
||||
collectionUrls: makeSelectUrlsForCollectionId(props.collectionId)(state),
|
||||
collectionClaimIds: makeSelectClaimIdsForCollectionId(props.collectionId)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
publishCollectionUpdate: (params) => dispatch(doCollectionPublishUpdate(params)),
|
||||
publishCollection: (params, collectionId) => dispatch(doCollectionPublish(params, collectionId)),
|
||||
clearCollectionErrors: () => dispatch(doClearCollectionErrors()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CollectionPage);
|
||||
@@ -1,441 +0,0 @@
|
||||
// @flow
|
||||
import { DOMAIN } from 'config';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import Button from 'component/button';
|
||||
import TagsSearch from 'component/tagsSearch';
|
||||
import ErrorText from 'component/common/error-text';
|
||||
import ClaimAbandonButton from 'component/claimAbandonButton';
|
||||
import ChannelSelector from 'component/channelSelector';
|
||||
import ClaimList from 'component/claimList';
|
||||
import Card from 'component/common/card';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import ThumbnailPicker from 'component/thumbnailPicker';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { isNameValid, regexInvalidURI } from 'lbry-redux';
|
||||
import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'component/common/tabs';
|
||||
import { FormField } from 'component/common/form';
|
||||
import { handleBidChange } from 'util/publish';
|
||||
import { FF_MAX_CHARS_IN_DESCRIPTION } from 'constants/form-field';
|
||||
import { INVALID_NAME_ERROR } from 'constants/claim';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import analytics from 'analytics';
|
||||
const LANG_NONE = 'none';
|
||||
const MAX_TAG_SELECT = 5;
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: CollectionClaim,
|
||||
balance: number,
|
||||
disabled: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
incognito: boolean,
|
||||
// params
|
||||
title: string,
|
||||
amount: number,
|
||||
thumbnailUrl: string,
|
||||
description: string,
|
||||
tags: Array<string>,
|
||||
locations: Array<string>,
|
||||
languages: Array<string>,
|
||||
|
||||
collectionId: string,
|
||||
collection: Collection,
|
||||
collectionClaimIds: Array<string>,
|
||||
collectionUrls: Array<string>,
|
||||
publishCollectionUpdate: (CollectionUpdateParams) => Promise<any>,
|
||||
updatingCollection: boolean,
|
||||
updateError: string,
|
||||
publishCollection: (CollectionPublishParams, string) => Promise<any>,
|
||||
createError: string,
|
||||
creatingCollection: boolean,
|
||||
clearCollectionErrors: () => void,
|
||||
onDone: (string) => void,
|
||||
openModal: (
|
||||
id: string,
|
||||
{ onUpdate: (string) => void, assetName: string, helpText: string, currentValue: string, title: string }
|
||||
) => void,
|
||||
};
|
||||
|
||||
function CollectionForm(props: Props) {
|
||||
const {
|
||||
uri, // collection uri
|
||||
claim,
|
||||
balance,
|
||||
// publish params
|
||||
amount,
|
||||
title,
|
||||
description,
|
||||
thumbnailUrl,
|
||||
tags,
|
||||
locations,
|
||||
languages = [],
|
||||
// rest
|
||||
onDone,
|
||||
publishCollectionUpdate,
|
||||
updateError,
|
||||
updatingCollection,
|
||||
publishCollection,
|
||||
creatingCollection,
|
||||
createError,
|
||||
disabled,
|
||||
activeChannelClaim,
|
||||
incognito,
|
||||
collectionId,
|
||||
collection,
|
||||
collectionUrls,
|
||||
collectionClaimIds,
|
||||
} = props;
|
||||
const activeChannelName = activeChannelClaim && activeChannelClaim.name;
|
||||
let prefix = IS_WEB ? `${DOMAIN}/` : 'lbry://';
|
||||
if (activeChannelName && !incognito) {
|
||||
prefix += `${activeChannelName}/`;
|
||||
}
|
||||
const activeChannelId = activeChannelClaim && activeChannelClaim.claim_id;
|
||||
const collectionName = (claim && claim.name) || (collection && collection.name);
|
||||
|
||||
const [nameError, setNameError] = React.useState(undefined);
|
||||
const [bidError, setBidError] = React.useState('');
|
||||
const [params, setParams]: [any, (any) => void] = React.useState(getCollectionParams());
|
||||
const name = params.name;
|
||||
const isNewCollection = !uri;
|
||||
const { replace } = useHistory();
|
||||
const languageParam = params.languages;
|
||||
const primaryLanguage = Array.isArray(languageParam) && languageParam.length && languageParam[0];
|
||||
const secondaryLanguage = Array.isArray(languageParam) && languageParam.length >= 2 && languageParam[1];
|
||||
|
||||
const collectionClaimIdsString = JSON.stringify(collectionClaimIds);
|
||||
|
||||
function parseName(newName) {
|
||||
let INVALID_URI_CHARS = new RegExp(regexInvalidURI, 'gu');
|
||||
return newName.replace(INVALID_URI_CHARS, '-');
|
||||
}
|
||||
|
||||
function setParam(paramObj) {
|
||||
setParams({ ...params, ...paramObj });
|
||||
}
|
||||
|
||||
function getCollectionParams() {
|
||||
const collectionParams: {
|
||||
thumbnail_url?: string,
|
||||
name?: string,
|
||||
description?: string,
|
||||
title?: string,
|
||||
bid: string,
|
||||
languages?: ?Array<string>,
|
||||
locations?: ?Array<string>,
|
||||
tags?: ?Array<{ name: string }>,
|
||||
claim_id?: string,
|
||||
channel_id?: string,
|
||||
claims: ?Array<string>,
|
||||
} = {
|
||||
thumbnail_url: thumbnailUrl,
|
||||
description,
|
||||
bid: String(amount || 0.001),
|
||||
languages: languages || [],
|
||||
locations: locations || [],
|
||||
tags: tags
|
||||
? tags.map((tag) => {
|
||||
return { name: tag };
|
||||
})
|
||||
: [],
|
||||
claims: collectionClaimIds,
|
||||
};
|
||||
collectionParams['name'] = parseName(collectionName);
|
||||
|
||||
if (activeChannelId) {
|
||||
collectionParams['channel_id'] = activeChannelId;
|
||||
}
|
||||
|
||||
if (!claim) {
|
||||
collectionParams['title'] = collectionName;
|
||||
}
|
||||
|
||||
if (claim) {
|
||||
collectionParams['claim_id'] = claim.claim_id;
|
||||
collectionParams['title'] = title;
|
||||
}
|
||||
|
||||
return collectionParams;
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
const collectionClaimIds = JSON.parse(collectionClaimIdsString);
|
||||
setParams({ ...params, claims: collectionClaimIds });
|
||||
}, [collectionClaimIdsString, setParams]);
|
||||
|
||||
function handleLanguageChange(index, code) {
|
||||
let langs = [...languageParam];
|
||||
if (index === 0) {
|
||||
if (code === LANG_NONE) {
|
||||
// clear all
|
||||
langs = [];
|
||||
} else {
|
||||
langs[0] = code;
|
||||
}
|
||||
} else {
|
||||
if (code === LANG_NONE || code === langs[0]) {
|
||||
langs.splice(1, 1);
|
||||
} else {
|
||||
langs[index] = code;
|
||||
}
|
||||
}
|
||||
setParams({ ...params, languages: langs });
|
||||
}
|
||||
|
||||
function handleThumbnailChange(thumbnailUrl: string) {
|
||||
setParams({ ...params, thumbnail_url: thumbnailUrl });
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
if (uri) {
|
||||
publishCollectionUpdate(params).then((pendingClaim) => {
|
||||
if (pendingClaim) {
|
||||
const claimId = pendingClaim.claim_id;
|
||||
analytics.apiLogPublish(pendingClaim);
|
||||
onDone(claimId);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
publishCollection(params, collectionId).then((pendingClaim) => {
|
||||
if (pendingClaim) {
|
||||
const claimId = pendingClaim.claim_id;
|
||||
analytics.apiLogPublish(pendingClaim);
|
||||
onDone(claimId);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
let nameError;
|
||||
if (!name && name !== undefined) {
|
||||
nameError = __('A name is required for your url');
|
||||
} else if (!isNameValid(name, false)) {
|
||||
nameError = INVALID_NAME_ERROR;
|
||||
}
|
||||
|
||||
setNameError(nameError);
|
||||
}, [name]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (incognito) {
|
||||
const newParams = Object.assign({}, params);
|
||||
delete newParams.channel_id;
|
||||
setParams(newParams);
|
||||
} else if (activeChannelId) {
|
||||
setParams({ ...params, channel_id: activeChannelId });
|
||||
}
|
||||
}, [activeChannelId, incognito, setParams]);
|
||||
const itemError = !params.claims.length ? __('Cannot publish empty collection') : '';
|
||||
const submitError = nameError || bidError || itemError || updateError || createError;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={classnames('main--contained', { 'card--disabled': disabled })}>
|
||||
<Tabs>
|
||||
<TabList className="tabs__list--collection-edit-page">
|
||||
<Tab>{__('General')}</Tab>
|
||||
<Tab>{__('Items')}</Tab>
|
||||
<Tab>{__('Credits')}</Tab>
|
||||
<Tab>{__('Tags')}</Tab>
|
||||
<Tab>{__('Other')}</Tab>
|
||||
</TabList>
|
||||
<TabPanels>
|
||||
<TabPanel>
|
||||
<div className={'card-stack'}>
|
||||
<ChannelSelector disabled={disabled} />
|
||||
<Card
|
||||
body={
|
||||
<>
|
||||
<fieldset-group className="fieldset-group--smushed fieldset-group--disabled-prefix">
|
||||
<fieldset-section>
|
||||
<label htmlFor="channel_name">{__('Channel')}</label>
|
||||
</fieldset-section>
|
||||
</fieldset-group>
|
||||
<fieldset-group class="fieldset-group--smushed fieldset-group--disabled-prefix">
|
||||
<fieldset-section>
|
||||
<label htmlFor="channel_name">{__('Name')}</label>
|
||||
<div className="form-field__prefix">{prefix}</div>
|
||||
</fieldset-section>
|
||||
|
||||
<FormField
|
||||
autoFocus={isNewCollection}
|
||||
type="text"
|
||||
name="channel_name"
|
||||
placeholder={__('MyAwesomeCollection')}
|
||||
value={params.name}
|
||||
error={nameError}
|
||||
disabled={!isNewCollection}
|
||||
onChange={(e) => setParams({ ...params, name: e.target.value || '' })}
|
||||
/>
|
||||
</fieldset-group>
|
||||
{!isNewCollection && (
|
||||
<span className="form-field__help">{__('This field cannot be changed.')}</span>
|
||||
)}
|
||||
|
||||
<FormField
|
||||
type="text"
|
||||
name="channel_title2"
|
||||
label={__('Title')}
|
||||
placeholder={__('My Awesome Collection')}
|
||||
value={params.title}
|
||||
onChange={(e) => setParams({ ...params, title: e.target.value })}
|
||||
/>
|
||||
<ThumbnailPicker
|
||||
inline
|
||||
thumbnailParam={params.thumbnail_url}
|
||||
updateThumbnailParam={handleThumbnailChange}
|
||||
/>
|
||||
<FormField
|
||||
type="markdown"
|
||||
name="content_description2"
|
||||
label={__('Description')}
|
||||
placeholder={__('Description of your content')}
|
||||
value={params.description}
|
||||
onChange={(text) => setParams({ ...params, description: text })}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<ClaimList
|
||||
uris={collectionUrls}
|
||||
collectionId={collectionId}
|
||||
empty={__('This collection has no items.')}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Card
|
||||
body={
|
||||
<FormField
|
||||
className="form-field--price-amount"
|
||||
type="number"
|
||||
name="content_bid2"
|
||||
step="any"
|
||||
label={<LbcSymbol postfix={__('Deposit')} size={14} />}
|
||||
value={params.bid}
|
||||
error={bidError}
|
||||
min="0.0"
|
||||
disabled={false}
|
||||
onChange={(event) =>
|
||||
handleBidChange(parseFloat(event.target.value), amount, balance, setBidError, setParam)
|
||||
}
|
||||
placeholder={0.1}
|
||||
helper={__('Increasing your deposit can help your channel be discovered more easily.')}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Card
|
||||
body={
|
||||
<TagsSearch
|
||||
suggestMature
|
||||
disableAutoFocus
|
||||
limitSelect={MAX_TAG_SELECT}
|
||||
tagsPassedIn={params.tags || []}
|
||||
label={__('Selected Tags')}
|
||||
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)) {
|
||||
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) });
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<Card
|
||||
body={
|
||||
<>
|
||||
<FormField
|
||||
name="language_select"
|
||||
type="select"
|
||||
label={__('Primary Language')}
|
||||
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) => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
<FormField
|
||||
name="language_select2"
|
||||
type="select"
|
||||
label={__('Secondary Language')}
|
||||
onChange={(event) => handleLanguageChange(1, event.target.value)}
|
||||
value={secondaryLanguage}
|
||||
disabled={!languageParam[0]}
|
||||
helper={__('Your other content language')}
|
||||
>
|
||||
<option key={'sec-langNone'} value={LANG_NONE}>
|
||||
{__('None selected')}
|
||||
</option>
|
||||
{Object.keys(SUPPORTED_LANGUAGES)
|
||||
.filter((lang) => lang !== languageParam[0])
|
||||
.map((language) => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</TabPanel>
|
||||
</TabPanels>
|
||||
</Tabs>
|
||||
<Card
|
||||
className="card--after-tabs"
|
||||
actions={
|
||||
<>
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
disabled={creatingCollection || updatingCollection || nameError || bidError || !params.claims.length}
|
||||
label={creatingCollection || updatingCollection ? __('Submitting') : __('Submit')}
|
||||
onClick={handleSubmit}
|
||||
/>
|
||||
<Button button="link" label={__('Cancel')} onClick={() => onDone(collectionId)} />
|
||||
</div>
|
||||
{submitError ? (
|
||||
<ErrorText>{submitError}</ErrorText>
|
||||
) : (
|
||||
<p className="help">
|
||||
{__('After submitting, it will take a few minutes for your changes to be live for everyone.')}
|
||||
</p>
|
||||
)}
|
||||
{!isNewCollection && (
|
||||
<div className="section__actions">
|
||||
<ClaimAbandonButton uri={uri} abandonActionCallback={() => replace(`/$/${PAGES.LIBRARY}`)} />
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default CollectionForm;
|
||||
@@ -1,16 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doCollectionEdit, makeSelectNameForCollectionId, doCollectionDelete } from 'lbry-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import CollectionMenuList from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
return {
|
||||
collectionName: makeSelectNameForCollectionId(props.collectionId)(state),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(select, {
|
||||
doCollectionEdit,
|
||||
doOpenModal,
|
||||
doCollectionDelete,
|
||||
})(CollectionMenuList);
|
||||
@@ -1,68 +0,0 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import { useHistory } from 'react-router';
|
||||
|
||||
type Props = {
|
||||
inline?: boolean,
|
||||
doOpenModal: (string, {}) => void,
|
||||
collectionName?: string,
|
||||
collectionId: string,
|
||||
};
|
||||
|
||||
function ClaimMenuList(props: Props) {
|
||||
const { inline = false, collectionId, collectionName, doOpenModal } = props;
|
||||
|
||||
const { push } = useHistory();
|
||||
|
||||
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">
|
||||
{collectionId && collectionName && (
|
||||
<>
|
||||
<MenuItem className="comment__menu-option" onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}`)}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.VIEW} />
|
||||
{__('View List')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.PUBLISH} />
|
||||
{__('Publish List')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => doOpenModal(MODALS.COLLECTION_DELETE, { collectionId })}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
{__('Delete List')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
)}
|
||||
</MenuList>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
||||
export default ClaimMenuList;
|
||||
@@ -1,30 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectClaimIdForUri,
|
||||
makeSelectClaimForClaimId,
|
||||
makeSelectUrlsForCollectionId,
|
||||
makeSelectNameForCollectionId,
|
||||
makeSelectPendingCollectionForId,
|
||||
makeSelectCountForCollectionId,
|
||||
} from 'lbry-redux';
|
||||
import CollectionPreviewOverlay from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri));
|
||||
const claim = props.collectionId && makeSelectClaimForClaimId(props.collectionId)(state);
|
||||
const collectionUri = props.uri || (claim && (claim.canonical_url || claim.permanent_url)) || null;
|
||||
|
||||
return {
|
||||
collectionId,
|
||||
uri: collectionUri,
|
||||
collectionCount: makeSelectCountForCollectionId(collectionId)(state),
|
||||
collectionName: makeSelectNameForCollectionId(collectionId)(state),
|
||||
collectionItemUrls: makeSelectUrlsForCollectionId(collectionId)(state), // ForId || ForUri
|
||||
pendingCollection: makeSelectPendingCollectionForId(collectionId)(state),
|
||||
claim,
|
||||
isResolvingUri: collectionUri && makeSelectIsUriResolving(collectionUri)(state),
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(select)(CollectionPreviewOverlay);
|
||||
@@ -1,42 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import FileThumbnail from 'component/fileThumbnail';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
collectionId: string,
|
||||
collectionName: string,
|
||||
collectionCount: number,
|
||||
editedCollection?: Collection,
|
||||
pendingCollection?: Collection,
|
||||
claim: ?Claim,
|
||||
collectionItemUrls: Array<string>,
|
||||
};
|
||||
|
||||
function CollectionPreviewTileOverlay(props: Props) {
|
||||
const { collectionItemUrls } = props;
|
||||
|
||||
if (collectionItemUrls && collectionItemUrls.length > 0) {
|
||||
return (
|
||||
<div className="collection-preview__overlay-thumbs">
|
||||
<div className="collection-preview__overlay-side" />
|
||||
<div className="collection-preview__overlay-grid">
|
||||
{collectionItemUrls &&
|
||||
collectionItemUrls.map((item, index) => {
|
||||
if (index < 2) {
|
||||
return (
|
||||
<div className="collection-preview__overlay-grid-items">
|
||||
<FileThumbnail uri={item} key={item} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export default withRouter(CollectionPreviewTileOverlay);
|
||||
@@ -1,19 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import Icon from 'component/common/icon';
|
||||
type Props = {
|
||||
count: number,
|
||||
};
|
||||
|
||||
export default function collectionCount(props: Props) {
|
||||
const { count = 0 } = props;
|
||||
|
||||
return (
|
||||
<div className={classnames('claim-preview__overlay-properties', 'claim-preview__overlay-properties--small')}>
|
||||
<Icon icon={ICONS.STACK} />
|
||||
<div>{count}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import Icon from 'component/common/icon';
|
||||
|
||||
export default function collectionCount() {
|
||||
return (
|
||||
<div className={classnames('claim-preview__overlay-properties', 'claim-preview__overlay-properties--small')}>
|
||||
<Icon icon={ICONS.LOCK} />
|
||||
<div>{__('Private')}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doResolveUri,
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectThumbnailForUri,
|
||||
makeSelectTitleForUri,
|
||||
makeSelectChannelForClaimUri,
|
||||
makeSelectClaimIsNsfw,
|
||||
makeSelectClaimIdForUri,
|
||||
makeSelectClaimForClaimId,
|
||||
makeSelectUrlsForCollectionId,
|
||||
makeSelectNameForCollectionId,
|
||||
doLocalCollectionDelete,
|
||||
doFetchItemsInCollection,
|
||||
makeSelectEditedCollectionForId,
|
||||
makeSelectPendingCollectionForId,
|
||||
makeSelectCountForCollectionId,
|
||||
makeSelectIsResolvingCollectionForId,
|
||||
} from 'lbry-redux';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import CollectionPreviewTile from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const collectionId = props.collectionId || (props.uri && makeSelectClaimIdForUri(props.uri));
|
||||
const claim = props.collectionId && makeSelectClaimForClaimId(props.collectionId)(state);
|
||||
const collectionUri = props.uri || (claim && (claim.canonical_url || claim.permanent_url)) || null;
|
||||
|
||||
return {
|
||||
collectionId,
|
||||
uri: collectionUri,
|
||||
collectionCount: makeSelectCountForCollectionId(collectionId)(state),
|
||||
collectionName: makeSelectNameForCollectionId(collectionId)(state),
|
||||
collectionItemUrls: makeSelectUrlsForCollectionId(collectionId)(state), // ForId || ForUri
|
||||
editedCollection: makeSelectEditedCollectionForId(collectionId)(state),
|
||||
pendingCollection: makeSelectPendingCollectionForId(collectionId)(state),
|
||||
claim,
|
||||
isResolvingCollectionClaims: makeSelectIsResolvingCollectionForId(collectionId)(state),
|
||||
channelClaim: collectionUri && makeSelectChannelForClaimUri(collectionUri)(state),
|
||||
isResolvingUri: collectionUri && makeSelectIsUriResolving(collectionUri)(state),
|
||||
thumbnail: collectionUri && makeSelectThumbnailForUri(collectionUri)(state),
|
||||
title: collectionUri && makeSelectTitleForUri(collectionUri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
blockedChannelUris: selectMutedChannels(state),
|
||||
showMature: selectShowMatureContent(state),
|
||||
isMature: makeSelectClaimIsNsfw(collectionUri)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
resolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||
resolveCollectionItems: (options) => doFetchItemsInCollection(options),
|
||||
deleteCollection: (id) => dispatch(doLocalCollectionDelete(id)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CollectionPreviewTile);
|
||||
@@ -1,171 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { NavLink, useHistory } from 'react-router-dom';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
import TruncatedText from 'component/common/truncated-text';
|
||||
import CollectionCount from './collectionCount';
|
||||
import CollectionPrivate from './collectionPrivate';
|
||||
import CollectionMenuList from 'component/collectionMenuList';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import FileThumbnail from 'component/fileThumbnail';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
collectionId: string,
|
||||
collectionName: string,
|
||||
collectionCount: number,
|
||||
editedCollection?: Collection,
|
||||
pendingCollection?: Collection,
|
||||
claim: ?Claim,
|
||||
channelClaim: ?ChannelClaim,
|
||||
collectionItemUrls: Array<string>,
|
||||
resolveUri: (string) => void,
|
||||
isResolvingUri: boolean,
|
||||
thumbnail?: string,
|
||||
title?: string,
|
||||
placeholder: boolean,
|
||||
blackListedOutpoints: Array<{
|
||||
txid: string,
|
||||
nout: number,
|
||||
}>,
|
||||
filteredOutpoints: Array<{
|
||||
txid: string,
|
||||
nout: number,
|
||||
}>,
|
||||
blockedChannelUris: Array<string>,
|
||||
isMature?: boolean,
|
||||
showMature: boolean,
|
||||
collectionId: string,
|
||||
deleteCollection: (string) => void,
|
||||
resolveCollectionItems: (any) => void,
|
||||
isResolvingCollectionClaims: boolean,
|
||||
};
|
||||
|
||||
function CollectionPreviewTile(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
collectionId,
|
||||
collectionName,
|
||||
collectionCount,
|
||||
isResolvingUri,
|
||||
isResolvingCollectionClaims,
|
||||
collectionItemUrls,
|
||||
claim,
|
||||
resolveCollectionItems,
|
||||
} = props;
|
||||
|
||||
const { push } = useHistory();
|
||||
const hasClaim = Boolean(claim);
|
||||
React.useEffect(() => {
|
||||
if (collectionId && hasClaim && resolveCollectionItems) {
|
||||
resolveCollectionItems({ collectionId, page_size: 5 });
|
||||
}
|
||||
}, [collectionId, hasClaim]);
|
||||
|
||||
// const signingChannel = claim && claim.signing_channel;
|
||||
|
||||
let navigateUrl = formatLbryUrlForWeb(collectionItemUrls[0] || '/');
|
||||
if (collectionId) {
|
||||
const collectionParams = new URLSearchParams();
|
||||
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, collectionId);
|
||||
navigateUrl = navigateUrl + `?` + collectionParams.toString();
|
||||
}
|
||||
|
||||
function handleClick(e) {
|
||||
if (navigateUrl) {
|
||||
push(navigateUrl);
|
||||
}
|
||||
}
|
||||
|
||||
const navLinkProps = {
|
||||
to: navigateUrl,
|
||||
onClick: (e) => e.stopPropagation(),
|
||||
};
|
||||
|
||||
/* REMOVE IF WORKS
|
||||
let shouldHide = false;
|
||||
|
||||
if (isMature && !showMature) {
|
||||
// Unfortunately needed until this is resolved
|
||||
// https://github.com/lbryio/lbry-sdk/issues/2785
|
||||
shouldHide = true;
|
||||
}
|
||||
|
||||
// This will be replaced once blocking is done at the wallet server level
|
||||
if (claim && !shouldHide && blackListedOutpoints) {
|
||||
shouldHide = blackListedOutpoints.some(
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
}
|
||||
// We're checking to see if the stream outpoint
|
||||
// or signing channel outpoint is in the filter list
|
||||
if (claim && !shouldHide && filteredOutpoints) {
|
||||
shouldHide = filteredOutpoints.some(
|
||||
(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);
|
||||
}
|
||||
// block channel claims if we can't control for them in claim search
|
||||
// e.g. fetchRecommendedSubscriptions
|
||||
|
||||
if (shouldHide) {
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
|
||||
if (isResolvingUri || isResolvingCollectionClaims) {
|
||||
return (
|
||||
<li className={classnames('claim-preview--tile', {})}>
|
||||
<div className="placeholder media__thumb" />
|
||||
<div className="placeholder__wrapper">
|
||||
<div className="placeholder claim-tile__title" />
|
||||
<div className="placeholder claim-tile__info" />
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
if (uri) {
|
||||
return <ClaimPreviewTile uri={uri} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<li role="link" onClick={handleClick} className={'card claim-preview--tile'}>
|
||||
<NavLink {...navLinkProps}>
|
||||
<FileThumbnail uri={collectionItemUrls && collectionItemUrls.length && collectionItemUrls[0]}>
|
||||
<React.Fragment>
|
||||
<div className="claim-preview__claim-property-overlay">
|
||||
<CollectionCount count={collectionCount} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
<NavLink {...navLinkProps}>
|
||||
<h2 className="claim-tile__title">
|
||||
<TruncatedText text={collectionName} lines={1} />
|
||||
<CollectionMenuList collectionId={collectionId} />
|
||||
</h2>
|
||||
</NavLink>
|
||||
<div>
|
||||
<div className="claim-tile__info">
|
||||
<React.Fragment>
|
||||
<div className="claim-tile__about">
|
||||
<CollectionPrivate />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
export default CollectionPreviewTile;
|
||||
@@ -1,22 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doCollectionEdit,
|
||||
makeSelectCollectionForId,
|
||||
makeSelectClaimIsPending,
|
||||
makeSelectCollectionForIdHasClaimUrl,
|
||||
} from 'lbry-redux';
|
||||
import CollectionSelectItem from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
return {
|
||||
collection: makeSelectCollectionForId(props.collectionId)(state),
|
||||
hasClaim: makeSelectCollectionForIdHasClaimUrl(props.collectionId, props.uri)(state),
|
||||
collectionPending: makeSelectClaimIsPending(props.collectionId)(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
editCollection: (id, params) => dispatch(doCollectionEdit(id, params)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CollectionSelectItem);
|
||||
@@ -1,59 +0,0 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Icon from 'component/common/icon';
|
||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
|
||||
type Props = {
|
||||
collection: Collection,
|
||||
hasClaim: boolean,
|
||||
category: string,
|
||||
edited: boolean,
|
||||
editCollection: (string, CollectionEditParams) => void,
|
||||
claim: Claim,
|
||||
collectionPending: Collection,
|
||||
};
|
||||
|
||||
function CollectionSelectItem(props: Props) {
|
||||
const { collection, hasClaim, category, editCollection, claim, collectionPending } = props;
|
||||
const { name, id } = collection;
|
||||
const handleChange = (e) => {
|
||||
editCollection(id, { claims: [claim], remove: hasClaim });
|
||||
};
|
||||
|
||||
let icon;
|
||||
switch (category) {
|
||||
case 'builtin':
|
||||
icon = id === COLLECTIONS_CONSTS.WATCH_LATER_ID ? ICONS.TIME : ICONS.STACK;
|
||||
break;
|
||||
case 'published':
|
||||
icon = ICONS.STACK;
|
||||
break;
|
||||
default:
|
||||
// 'unpublished'
|
||||
icon = ICONS.LOCK;
|
||||
break;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={'collection-select__item'}>
|
||||
<FormField
|
||||
checked={hasClaim}
|
||||
disabled={collectionPending}
|
||||
icon={icon}
|
||||
type="checkbox"
|
||||
name={`select-${id}`}
|
||||
onChange={handleChange} // edit the collection
|
||||
label={
|
||||
<span>
|
||||
<Icon icon={icon} className={'icon-collection-select'} />
|
||||
{`${name}`}
|
||||
</span>
|
||||
} // the collection name
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default CollectionSelectItem;
|
||||
@@ -1,17 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectBuiltinCollections,
|
||||
selectMyPublishedPlaylistCollections,
|
||||
selectMyUnpublishedCollections, // should probably distinguish types
|
||||
// selectSavedCollections,
|
||||
} from 'lbry-redux';
|
||||
import CollectionsListMine from './view';
|
||||
|
||||
const select = (state) => ({
|
||||
builtinCollections: selectBuiltinCollections(state),
|
||||
publishedPlaylists: selectMyPublishedPlaylistCollections(state),
|
||||
unpublishedCollections: selectMyUnpublishedCollections(state),
|
||||
// savedCollections: selectSavedCollections(state),
|
||||
});
|
||||
|
||||
export default connect(select)(CollectionsListMine);
|
||||
@@ -1,141 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import CollectionPreviewTile from 'component/collectionPreviewTile';
|
||||
import ClaimList from 'component/claimList';
|
||||
import Button from 'component/button';
|
||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import Yrbl from 'component/yrbl';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import Card from 'component/common/card';
|
||||
import classnames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
builtinCollections: CollectionGroup,
|
||||
publishedCollections: CollectionGroup,
|
||||
publishedPlaylists: CollectionGroup,
|
||||
unpublishedCollections: CollectionGroup,
|
||||
// savedCollections: CollectionGroup,
|
||||
};
|
||||
|
||||
export default function CollectionsListMine(props: Props) {
|
||||
const {
|
||||
builtinCollections,
|
||||
publishedPlaylists,
|
||||
unpublishedCollections,
|
||||
// savedCollections, these are resolved on startup from sync'd claimIds or urls
|
||||
} = props;
|
||||
|
||||
const builtinCollectionsList = (Object.values(builtinCollections || {}): any);
|
||||
const unpublishedCollectionsList = (Object.keys(unpublishedCollections || {}): any);
|
||||
const publishedList = (Object.keys(publishedPlaylists || {}): any);
|
||||
const hasCollections = unpublishedCollectionsList.length || publishedList.length;
|
||||
|
||||
const watchLater = builtinCollectionsList.find((list) => list.id === COLLECTIONS_CONSTS.WATCH_LATER_ID);
|
||||
const favorites = builtinCollectionsList.find((list) => list.id === COLLECTIONS_CONSTS.FAVORITES_ID);
|
||||
const builtin = [watchLater, favorites];
|
||||
const [showHelp, setShowHelp] = usePersistedState('livestream-help-seen', true);
|
||||
|
||||
const helpText = (
|
||||
<div className="section__subtitle">
|
||||
<p>{__(`Everyone starts with 2 private lists - Watch Later and Favorites.`)}</p>
|
||||
<p>{__(`Add content to existing lists or new lists from content pages or content previews.`)}</p>
|
||||
<p>
|
||||
{__(
|
||||
`By default, lists are private. You can edit them and later publish them from the Lists page or the Publish context menu on this page. Similar to uploads, small blockchain fees apply.`
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{builtin.map((list: Collection) => {
|
||||
const { items: itemUrls } = list;
|
||||
return (
|
||||
<div className="claim-grid__wrapper" key={list.name}>
|
||||
<>
|
||||
{Boolean(itemUrls && itemUrls.length) && (
|
||||
<>
|
||||
<h1 className="claim-grid__header">
|
||||
<Button
|
||||
className="claim-grid__title"
|
||||
button="link"
|
||||
navigate={`/$/${PAGES.LIST}/${list.id}`}
|
||||
label={
|
||||
<span className="claim-grid__title-span">
|
||||
{list.name}
|
||||
<div className="claim-grid__title--empty">
|
||||
<Icon className="icon--margin-right" icon={ICONS.STACK} />
|
||||
{itemUrls.length}
|
||||
</div>
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
</h1>
|
||||
<ClaimList tileLayout key={list.name} uris={itemUrls.slice(0, 6)} collectionId={list.id} />
|
||||
</>
|
||||
)}
|
||||
{!(itemUrls && itemUrls.length) && (
|
||||
<h1 className="claim-grid__header claim-grid__title">
|
||||
{__('%collection_name%', { collection_name: list.name })}{' '}
|
||||
<div className="claim-grid__title--empty">(Empty)</div>
|
||||
</h1>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
<div className="claim-grid__wrapper">
|
||||
<div className="claim-grid__header claim-grid__header--between section">
|
||||
<h1 className="claim-grid__title">
|
||||
{__('Playlists')}
|
||||
{!hasCollections && <div className="claim-grid__title--empty">(Empty)</div>}
|
||||
</h1>
|
||||
<Button button="link" onClick={() => setShowHelp(!showHelp)} label={__('How does this work?')} />
|
||||
</div>
|
||||
{showHelp && (
|
||||
<Card
|
||||
titleActions={<Button button="close" icon={ICONS.REMOVE} onClick={() => setShowHelp(false)} />}
|
||||
title={__('Introducing Lists')}
|
||||
actions={helpText}
|
||||
/>
|
||||
)}
|
||||
{Boolean(hasCollections) && (
|
||||
<div
|
||||
className={classnames({
|
||||
section: showHelp,
|
||||
})}
|
||||
>
|
||||
{/* TODO: fix above spacing hack */}
|
||||
<div className="claim-grid">
|
||||
{unpublishedCollectionsList &&
|
||||
unpublishedCollectionsList.length > 0 &&
|
||||
unpublishedCollectionsList.map((key) => (
|
||||
<CollectionPreviewTile tileLayout collectionId={key} key={key} />
|
||||
))}
|
||||
{publishedList &&
|
||||
publishedList.length > 0 &&
|
||||
publishedList.map((key) => <CollectionPreviewTile tileLayout collectionId={key} key={key} />)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{!hasCollections && (
|
||||
<div className="main--empty">
|
||||
<Yrbl
|
||||
type={'sad'}
|
||||
title={__('You have no lists yet. Better start hoarding!')}
|
||||
// actions={
|
||||
// <div className="section__actions">
|
||||
// <Button button="primary" label={__('View Content')} onClick={() => setViewBlockedChannel(true)} />
|
||||
// </div>
|
||||
// }
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,29 +1,25 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectStakedLevelForChannelUri, makeSelectClaimForUri, makeSelectThumbnailForUri, selectMyChannelClaims } from 'lbry-redux';
|
||||
import { makeSelectThumbnailForUri, selectMyChannelClaims } from 'lbry-redux';
|
||||
import { doCommentUpdate } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
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) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state),
|
||||
channelIsBlocked: props.authorUri && makeSelectChannelIsMuted(props.authorUri)(state),
|
||||
channelIsBlocked: props.authorUri && selectChannelIsBlocked(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),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
||||
closeInlinePlayer: () => dispatch(doSetPlayingUri({ uri: null })),
|
||||
updateComment: (commentId, comment) => dispatch(doCommentUpdate(commentId, comment)),
|
||||
doToast: (options) => dispatch(doToast(options)),
|
||||
});
|
||||
|
||||
@@ -21,12 +21,10 @@ import { useHistory } from 'react-router';
|
||||
import CommentCreate from 'component/commentCreate';
|
||||
import CommentMenuList from 'component/commentMenuList';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import CreditAmount from 'component/common/credit-amount';
|
||||
|
||||
type Props = {
|
||||
clearPlayingUri: () => void,
|
||||
closeInlinePlayer: () => void,
|
||||
uri: string,
|
||||
claim: StreamClaim,
|
||||
author: ?string, // LBRY Channel Name, e.g. @channel
|
||||
authorUri: string, // full LBRY Channel URI: lbry://@channel#123...
|
||||
commentId: string, // sha256 digest identifying the comment
|
||||
@@ -50,9 +48,6 @@ type Props = {
|
||||
},
|
||||
commentIdentityChannel: any,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
playingUri: ?PlayingUri,
|
||||
stakedLevel: number,
|
||||
supportAmount: number,
|
||||
};
|
||||
|
||||
const LENGTH_TO_COLLAPSE = 300;
|
||||
@@ -60,8 +55,7 @@ const ESCAPE_KEY = 27;
|
||||
|
||||
function Comment(props: Props) {
|
||||
const {
|
||||
clearPlayingUri,
|
||||
claim,
|
||||
closeInlinePlayer,
|
||||
uri,
|
||||
author,
|
||||
authorUri,
|
||||
@@ -79,9 +73,6 @@ function Comment(props: Props) {
|
||||
threadDepth,
|
||||
isPinned,
|
||||
othersReacts,
|
||||
playingUri,
|
||||
stakedLevel,
|
||||
supportAmount,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -101,7 +92,6 @@ function Comment(props: Props) {
|
||||
const dislikesCount = (othersReacts && othersReacts.dislike) || 0;
|
||||
const totalLikesAndDislikes = likesCount + dislikesCount;
|
||||
const slimedToDeath = totalLikesAndDislikes >= 5 && dislikesCount / totalLikesAndDislikes > 0.8;
|
||||
const commentByOwnerOfContent = claim && claim.signing_channel && claim.signing_channel.permanent_url === authorUri;
|
||||
|
||||
let channelOwnerOfContent;
|
||||
try {
|
||||
@@ -136,9 +126,7 @@ function Comment(props: Props) {
|
||||
}
|
||||
|
||||
function handleEditComment() {
|
||||
if (playingUri && playingUri.source === 'comment') {
|
||||
clearPlayingUri();
|
||||
}
|
||||
closeInlinePlayer();
|
||||
setEditing(true);
|
||||
}
|
||||
|
||||
@@ -168,7 +156,6 @@ function Comment(props: Props) {
|
||||
className={classnames('comment', {
|
||||
'comment--top-level': isTopLevel,
|
||||
'comment--reply': !isTopLevel,
|
||||
'comment--superchat': supportAmount > 0,
|
||||
})}
|
||||
id={commentId}
|
||||
onMouseOver={() => setMouseHover(true)}
|
||||
@@ -188,19 +175,13 @@ function Comment(props: Props) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="comment__body-container">
|
||||
<div className="comment__body_container">
|
||||
<div className="comment__meta">
|
||||
<div className="comment__meta-information">
|
||||
{!author ? (
|
||||
<span className="comment__author">{__('Anonymous')}</span>
|
||||
) : (
|
||||
<UriIndicator
|
||||
className={classnames('comment__author', {
|
||||
'comment__author--creator': commentByOwnerOfContent,
|
||||
})}
|
||||
link
|
||||
uri={authorUri}
|
||||
/>
|
||||
<UriIndicator link uri={authorUri} />
|
||||
)}
|
||||
<Button
|
||||
className="comment__time"
|
||||
@@ -208,8 +189,6 @@ function Comment(props: Props) {
|
||||
label={<DateTime date={timePosted} timeAgo />}
|
||||
/>
|
||||
|
||||
{supportAmount > 0 && <CreditAmount amount={supportAmount} superChatLight size={12} />}
|
||||
|
||||
{isPinned && (
|
||||
<span className="comment__pin">
|
||||
<Icon icon={ICONS.PIN} size={14} />
|
||||
@@ -221,7 +200,7 @@ function Comment(props: Props) {
|
||||
</div>
|
||||
<div className="comment__menu">
|
||||
<Menu>
|
||||
<MenuButton className="menu__button">
|
||||
<MenuButton>
|
||||
<Icon
|
||||
size={18}
|
||||
className={mouseIsHovering ? 'comment__menu-icon--hovering' : 'comment__menu-icon'}
|
||||
@@ -244,7 +223,6 @@ function Comment(props: Props) {
|
||||
{isEditing ? (
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<FormField
|
||||
className="comment__edit-input"
|
||||
type={!SIMPLE_SITE && advancedEditor ? 'markdown' : 'textarea'}
|
||||
name="editing_comment"
|
||||
value={editedMessage}
|
||||
@@ -252,7 +230,7 @@ function Comment(props: Props) {
|
||||
onChange={handleEditMessageChanged}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_COMMENT}
|
||||
/>
|
||||
<div className="section__actions section__actions--no-margin">
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
type="submit"
|
||||
@@ -272,20 +250,10 @@ function Comment(props: Props) {
|
||||
</div>
|
||||
) : editedMessage.length >= LENGTH_TO_COLLAPSE ? (
|
||||
<Expandable>
|
||||
<MarkdownPreview
|
||||
content={message}
|
||||
promptLinks
|
||||
parentCommentId={commentId}
|
||||
stakedLevel={stakedLevel}
|
||||
/>
|
||||
<MarkdownPreview content={message} promptLinks parentCommentId={commentId} />
|
||||
</Expandable>
|
||||
) : (
|
||||
<MarkdownPreview
|
||||
content={message}
|
||||
promptLinks
|
||||
parentCommentId={commentId}
|
||||
stakedLevel={stakedLevel}
|
||||
/>
|
||||
<MarkdownPreview content={message} promptLinks parentCommentId={commentId} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsMine,
|
||||
selectMyChannelClaims,
|
||||
selectFetchingMyChannels,
|
||||
doSendTip,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectClaimForUri, 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) => ({
|
||||
@@ -18,17 +12,14 @@ const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
channels: selectMyChannelClaims(state),
|
||||
isFetchingChannels: selectFetchingMyChannels(state),
|
||||
isPostingComment: selectIsPostingComment(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch, ownProps) => ({
|
||||
createComment: (comment, claimId, parentId, txid) =>
|
||||
dispatch(doCommentCreate(comment, claimId, parentId, ownProps.uri, ownProps.livestream, txid)),
|
||||
createComment: (comment, claimId, parentId) => dispatch(doCommentCreate(comment, claimId, parentId, ownProps.uri)),
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
setActiveChannel: (claimId) => dispatch(doSetActiveChannel(claimId)),
|
||||
toast: (message) => dispatch(doToast({ message, isError: true })),
|
||||
sendTip: (params, callback, errorCallback) => dispatch(doSendTip(params, false, callback, errorCallback, false)),
|
||||
setActiveChannel: claimId => dispatch(doSetActiveChannel(claimId)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(CommentCreate);
|
||||
Loaded 100 of 478 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user