2019-06-11 20:10:58 +02:00
|
|
|
// @flow
|
2019-09-26 18:28:08 +02:00
|
|
|
import type { Node } from 'react';
|
2020-01-30 22:01:23 +01:00
|
|
|
import React, { useEffect, forwardRef } from 'react';
|
2020-02-04 22:59:49 +01:00
|
|
|
import { NavLink, withRouter } from 'react-router-dom';
|
2021-07-22 10:24:25 +02:00
|
|
|
import { isEmpty } from 'util/object';
|
2021-07-07 09:10:28 +02:00
|
|
|
import { lazyImport } from 'util/lazyImport';
|
2019-06-11 20:10:58 +02:00
|
|
|
import classnames from 'classnames';
|
2021-07-15 22:22:44 +02:00
|
|
|
import { parseURI, COLLECTIONS_CONSTS, isURIEqual } from 'lbry-redux';
|
2019-12-02 18:30:08 +01:00
|
|
|
import { formatLbryUrlForWeb } from 'util/url';
|
2021-07-22 10:24:25 +02:00
|
|
|
import { formatClaimPreviewTitle } from 'util/formatAriaLabel';
|
2020-01-06 19:32:35 +01:00
|
|
|
import FileThumbnail from 'component/fileThumbnail';
|
2019-06-11 20:10:58 +02:00
|
|
|
import UriIndicator from 'component/uriIndicator';
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
import PreviewOverlayProperties from 'component/previewOverlayProperties';
|
2019-06-19 07:05:43 +02:00
|
|
|
import ClaimTags from 'component/claimTags';
|
2019-06-11 20:10:58 +02:00
|
|
|
import SubscribeButton from 'component/subscribeButton';
|
|
|
|
import ChannelThumbnail from 'component/channelThumbnail';
|
2020-02-12 19:59:48 +01:00
|
|
|
import ClaimSupportButton from 'component/claimSupportButton';
|
2020-01-07 22:07:12 +01:00
|
|
|
import useGetThumbnail from 'effects/use-get-thumbnail';
|
2020-01-30 23:25:15 +01:00
|
|
|
import ClaimPreviewTitle from 'component/claimPreviewTitle';
|
2020-01-31 17:12:47 +01:00
|
|
|
import ClaimPreviewSubtitle from 'component/claimPreviewSubtitle';
|
2020-01-31 17:43:14 +01:00
|
|
|
import ClaimRepostAuthor from 'component/claimRepostAuthor';
|
2020-02-05 03:54:19 +01:00
|
|
|
import FileDownloadLink from 'component/fileDownloadLink';
|
2021-06-18 17:22:44 +02:00
|
|
|
import FileWatchLaterLink from 'component/fileWatchLaterLink';
|
2020-05-07 14:22:55 +02:00
|
|
|
import PublishPending from 'component/publishPending';
|
2021-03-03 19:50:16 +01:00
|
|
|
import ClaimMenuList from 'component/claimMenuList';
|
2020-12-04 01:10:23 +01:00
|
|
|
import ClaimPreviewLoading from './claim-preview-loading';
|
2020-12-22 16:16:39 +01:00
|
|
|
import ClaimPreviewHidden from './claim-preview-no-mature';
|
2020-12-04 01:10:23 +01:00
|
|
|
import ClaimPreviewNoContent from './claim-preview-no-content';
|
2021-03-25 19:52:18 +01:00
|
|
|
import { ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
import Button from 'component/button';
|
|
|
|
import * as ICONS from 'constants/icons';
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
import { CONTAINER_ID } from 'constants/navigation';
|
2019-06-11 20:10:58 +02:00
|
|
|
|
2021-07-15 01:58:56 +02:00
|
|
|
const AbandonedChannelPreview = lazyImport(() =>
|
|
|
|
import('component/abandonedChannelPreview' /* webpackChunkName: "abandonedChannelPreview" */)
|
|
|
|
);
|
2021-06-11 08:06:29 +02:00
|
|
|
|
2019-06-11 20:10:58 +02:00
|
|
|
type Props = {
|
|
|
|
uri: string,
|
2021-07-06 21:29:12 +02:00
|
|
|
claim: ?Claim,
|
2021-07-13 00:39:23 +02:00
|
|
|
active: boolean,
|
2019-06-11 20:10:58 +02:00
|
|
|
obscureNsfw: boolean,
|
2019-07-08 22:54:58 +02:00
|
|
|
showUserBlocked: boolean,
|
2019-06-11 20:10:58 +02:00
|
|
|
claimIsMine: boolean,
|
|
|
|
pending?: boolean,
|
2020-12-22 16:16:39 +01:00
|
|
|
reflectingProgress?: any, // fxme
|
2021-02-16 22:09:20 +01:00
|
|
|
resolveUri: (string) => void,
|
2019-06-11 20:10:58 +02:00
|
|
|
isResolvingUri: boolean,
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
history: { push: (string | any) => void },
|
2019-06-11 20:10:58 +02:00
|
|
|
title: string,
|
|
|
|
nsfw: boolean,
|
2019-07-21 23:31:22 +02:00
|
|
|
placeholder: string,
|
2019-06-19 07:05:43 +02:00
|
|
|
type: string,
|
2019-07-11 20:06:25 +02:00
|
|
|
hasVisitedUri: boolean,
|
2019-06-28 09:27:55 +02:00
|
|
|
blackListedOutpoints: Array<{
|
|
|
|
txid: string,
|
|
|
|
nout: number,
|
|
|
|
}>,
|
2019-07-17 05:32:29 +02:00
|
|
|
filteredOutpoints: Array<{
|
|
|
|
txid: string,
|
|
|
|
nout: number,
|
|
|
|
}>,
|
2021-03-03 19:50:16 +01:00
|
|
|
mutedUris: Array<string>,
|
|
|
|
blockedUris: Array<string>,
|
2019-07-08 22:54:58 +02:00
|
|
|
channelIsBlocked: boolean,
|
2019-09-26 18:28:08 +02:00
|
|
|
actions: boolean | Node | string | number,
|
2021-02-16 22:09:20 +01:00
|
|
|
properties: boolean | Node | string | number | ((Claim) => Node),
|
2020-12-22 16:16:39 +01:00
|
|
|
empty?: Node,
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
onClick?: (e: any, index?: number) => any,
|
2020-01-07 22:07:12 +01:00
|
|
|
streamingUrl: ?string,
|
2021-02-16 22:09:20 +01:00
|
|
|
getFile: (string) => void,
|
|
|
|
customShouldHide?: (Claim) => boolean,
|
2020-02-05 19:01:07 +01:00
|
|
|
showUnresolvedClaim?: boolean,
|
2020-12-04 01:10:23 +01:00
|
|
|
showNullPlaceholder?: boolean,
|
2020-02-12 19:59:48 +01:00
|
|
|
includeSupportAction?: boolean,
|
2020-10-12 23:12:46 +02:00
|
|
|
hideActions?: boolean,
|
2021-02-16 22:09:20 +01:00
|
|
|
renderActions?: (Claim) => ?Node,
|
2020-10-20 19:10:02 +02:00
|
|
|
wrapperElement?: string,
|
2020-10-28 20:18:58 +01:00
|
|
|
hideRepostLabel?: boolean,
|
2020-12-22 16:16:39 +01:00
|
|
|
repostUrl?: string,
|
2021-03-03 19:50:16 +01:00
|
|
|
hideMenu?: boolean,
|
2021-03-25 19:52:18 +01:00
|
|
|
isLivestream?: boolean,
|
2021-04-29 09:22:56 +02:00
|
|
|
live?: boolean,
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
collectionId?: string,
|
|
|
|
editCollection: (string, CollectionEditParams) => void,
|
|
|
|
isCollectionMine: boolean,
|
|
|
|
collectionUris: Array<Collection>,
|
|
|
|
collectionIndex?: number,
|
2021-06-19 10:28:00 +02:00
|
|
|
disableNavigation?: boolean,
|
2021-07-16 08:53:38 +02:00
|
|
|
mediaDuration?: string,
|
|
|
|
date?: any,
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
containerId?: string, // ID or name of the container (e.g. ClaimList, HOC, etc.) that this is in.
|
|
|
|
indexInContainer?: number, // The index order of this component within 'containerId'.
|
2021-08-19 17:25:45 +02:00
|
|
|
channelSubCount?: number,
|
2019-06-11 20:10:58 +02:00
|
|
|
};
|
|
|
|
|
2019-08-02 08:28:14 +02:00
|
|
|
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
2019-06-11 20:10:58 +02:00
|
|
|
const {
|
2020-12-22 16:16:39 +01:00
|
|
|
// core
|
2019-06-11 20:10:58 +02:00
|
|
|
uri,
|
2020-12-22 16:16:39 +01:00
|
|
|
claim,
|
2019-06-11 20:10:58 +02:00
|
|
|
isResolvingUri,
|
2020-12-22 16:16:39 +01:00
|
|
|
// core actions
|
|
|
|
getFile,
|
2019-06-11 20:10:58 +02:00
|
|
|
resolveUri,
|
2020-12-22 16:16:39 +01:00
|
|
|
// claim properties
|
2021-01-26 17:55:27 +01:00
|
|
|
// is the claim consider nsfw?
|
2020-12-22 16:16:39 +01:00
|
|
|
nsfw,
|
2021-07-16 08:53:38 +02:00
|
|
|
date,
|
|
|
|
title,
|
2020-12-22 16:16:39 +01:00
|
|
|
claimIsMine,
|
|
|
|
streamingUrl,
|
2021-07-16 08:53:38 +02:00
|
|
|
mediaDuration,
|
2020-12-22 16:16:39 +01:00
|
|
|
// user properties
|
|
|
|
channelIsBlocked,
|
2019-07-11 20:06:25 +02:00
|
|
|
hasVisitedUri,
|
2020-12-22 16:16:39 +01:00
|
|
|
// component
|
|
|
|
history,
|
|
|
|
wrapperElement,
|
|
|
|
type,
|
|
|
|
placeholder,
|
|
|
|
// pending
|
|
|
|
reflectingProgress,
|
|
|
|
pending,
|
|
|
|
empty,
|
|
|
|
// modifiers
|
2021-07-13 00:39:23 +02:00
|
|
|
active,
|
2020-12-22 16:16:39 +01:00
|
|
|
customShouldHide,
|
|
|
|
showNullPlaceholder,
|
2021-01-26 17:55:27 +01:00
|
|
|
// value from show mature content user setting
|
|
|
|
// true if the user doesn't wanna see nsfw content
|
2020-12-22 16:16:39 +01:00
|
|
|
obscureNsfw,
|
2019-07-08 22:54:58 +02:00
|
|
|
showUserBlocked,
|
2020-12-22 16:16:39 +01:00
|
|
|
showUnresolvedClaim,
|
|
|
|
hideRepostLabel = false,
|
|
|
|
hideActions = false,
|
2019-09-26 18:28:08 +02:00
|
|
|
properties,
|
|
|
|
onClick,
|
2020-12-22 16:16:39 +01:00
|
|
|
actions,
|
2021-03-03 19:50:16 +01:00
|
|
|
mutedUris,
|
|
|
|
blockedUris,
|
2020-12-22 16:16:39 +01:00
|
|
|
blackListedOutpoints,
|
|
|
|
filteredOutpoints,
|
2020-02-12 19:59:48 +01:00
|
|
|
includeSupportAction,
|
2020-10-12 23:12:46 +02:00
|
|
|
renderActions,
|
2021-03-03 19:50:16 +01:00
|
|
|
hideMenu = false,
|
2020-12-22 16:16:39 +01:00
|
|
|
// repostUrl,
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
isLivestream, // need both? CHECK
|
2021-04-29 09:22:56 +02:00
|
|
|
live,
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
collectionId,
|
|
|
|
collectionIndex,
|
|
|
|
editCollection,
|
|
|
|
isCollectionMine,
|
|
|
|
collectionUris,
|
2021-06-19 10:28:00 +02:00
|
|
|
disableNavigation,
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
containerId,
|
|
|
|
indexInContainer,
|
2021-08-19 17:25:45 +02:00
|
|
|
channelSubCount,
|
2019-06-11 20:10:58 +02:00
|
|
|
} = props;
|
2021-06-24 16:33:11 +02:00
|
|
|
const isCollection = claim && claim.value_type === 'collection';
|
|
|
|
const collectionClaimId = isCollection && claim && claim.claim_id;
|
|
|
|
const listId = collectionId || collectionClaimId;
|
2020-10-20 19:10:02 +02:00
|
|
|
const WrapperElement = wrapperElement || 'li';
|
2019-10-03 23:40:54 +02:00
|
|
|
const shouldFetch =
|
|
|
|
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
2019-07-21 23:31:22 +02:00
|
|
|
const abandoned = !isResolvingUri && !claim;
|
2021-06-24 16:33:11 +02:00
|
|
|
const isMyCollection = listId && (isCollectionMine || listId.includes('-'));
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
const shouldHideActions = hideActions || isMyCollection || type === 'small' || type === 'tooltip';
|
2020-02-05 19:08:37 +01:00
|
|
|
const canonicalUrl = claim && claim.canonical_url;
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
const lastCollectionIndex = collectionUris ? collectionUris.length - 1 : 0;
|
2021-08-19 17:25:45 +02:00
|
|
|
const channelSubscribers = React.useMemo(() => {
|
|
|
|
if (channelSubCount === undefined) {
|
|
|
|
return <span />;
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
<span className="claim-preview__channel-sub-count">
|
|
|
|
{channelSubCount === 1
|
|
|
|
? __('%channelSubCount% Follower', { channelSubCount })
|
|
|
|
: __('%channelSubCount% Followers', { channelSubCount })}
|
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}, [channelSubCount]);
|
2019-08-19 06:49:54 +02:00
|
|
|
let isValid = false;
|
|
|
|
if (uri) {
|
|
|
|
try {
|
2020-01-30 22:01:23 +01:00
|
|
|
parseURI(uri);
|
2019-08-19 06:49:54 +02:00
|
|
|
isValid = true;
|
|
|
|
} catch (e) {
|
|
|
|
isValid = false;
|
|
|
|
}
|
2019-07-11 21:03:31 +02:00
|
|
|
}
|
2021-06-18 17:22:44 +02:00
|
|
|
// $FlowFixMe
|
|
|
|
const isPlayable =
|
|
|
|
claim &&
|
|
|
|
// $FlowFixMe
|
|
|
|
claim.value &&
|
|
|
|
// $FlowFixMe
|
|
|
|
claim.value.stream_type &&
|
|
|
|
// $FlowFixMe
|
|
|
|
(claim.value.stream_type === 'audio' || claim.value.stream_type === 'video');
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
const isChannelUri = isValid ? parseURI(uri).isChannel : false;
|
2019-07-29 16:12:53 +02:00
|
|
|
const signingChannel = claim && claim.signing_channel;
|
2021-07-21 01:49:41 +02:00
|
|
|
|
|
|
|
// Get channel title ( use name as fallback )
|
|
|
|
let channelTitle = null;
|
|
|
|
if (signingChannel) {
|
|
|
|
const { value, name } = signingChannel;
|
|
|
|
if (value && value.title) {
|
|
|
|
channelTitle = value.title;
|
|
|
|
} else {
|
|
|
|
channelTitle = name;
|
|
|
|
}
|
|
|
|
}
|
2021-07-16 08:53:38 +02:00
|
|
|
|
|
|
|
// Aria-label value for claim preview
|
2021-07-22 10:24:25 +02:00
|
|
|
let ariaLabelData = isChannelUri ? title : formatClaimPreviewTitle(title, channelTitle, date, mediaDuration);
|
2021-07-16 08:53:38 +02:00
|
|
|
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
let navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
|
2021-08-10 16:38:53 +02:00
|
|
|
let navigateSearch = new URLSearchParams();
|
2021-06-24 16:33:11 +02:00
|
|
|
if (listId) {
|
2021-08-10 16:38:53 +02:00
|
|
|
navigateSearch.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId);
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
}
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
|
|
|
|
const handleNavLinkClick = (e) => {
|
|
|
|
if (onClick) {
|
|
|
|
onClick(e, indexInContainer);
|
|
|
|
}
|
|
|
|
e.stopPropagation();
|
|
|
|
};
|
|
|
|
|
2020-02-04 22:59:49 +01:00
|
|
|
const navLinkProps = {
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
to: {
|
|
|
|
pathname: navigateUrl,
|
2021-08-10 16:38:53 +02:00
|
|
|
search: navigateSearch.toString() ? '?' + navigateSearch.toString() : '',
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
state: containerId ? { [CONTAINER_ID]: containerId } : undefined,
|
|
|
|
},
|
|
|
|
onClick: (e) => handleNavLinkClick(e),
|
|
|
|
onAuxClick: (e) => handleNavLinkClick(e),
|
2020-02-04 22:59:49 +01:00
|
|
|
};
|
2019-10-24 22:41:27 +02:00
|
|
|
|
|
|
|
// do not block abandoned and nsfw claims if showUserBlocked is passed
|
2019-10-17 18:58:28 +02:00
|
|
|
let shouldHide =
|
2019-10-24 22:41:27 +02:00
|
|
|
placeholder !== 'loading' &&
|
|
|
|
!showUserBlocked &&
|
2020-12-22 16:16:39 +01:00
|
|
|
((abandoned && !showUnresolvedClaim) || (!claimIsMine && obscureNsfw && nsfw));
|
2019-07-05 20:11:55 +02:00
|
|
|
|
|
|
|
// This will be replaced once blocking is done at the wallet server level
|
2019-12-13 19:44:28 +01:00
|
|
|
if (claim && !claimIsMine && !shouldHide && blackListedOutpoints) {
|
2019-08-29 03:39:21 +02:00
|
|
|
shouldHide = blackListedOutpoints.some(
|
2021-02-16 22:09:20 +01:00
|
|
|
(outpoint) =>
|
2019-08-29 03:39:21 +02:00
|
|
|
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
|
|
|
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
|
|
|
);
|
2019-07-17 05:32:29 +02:00
|
|
|
}
|
2019-07-25 22:26:42 +02:00
|
|
|
// We're checking to see if the stream outpoint
|
|
|
|
// or signing channel outpoint is in the filter list
|
2019-12-13 19:44:28 +01:00
|
|
|
if (claim && !claimIsMine && !shouldHide && filteredOutpoints) {
|
2019-07-25 22:26:42 +02:00
|
|
|
shouldHide = filteredOutpoints.some(
|
2021-02-16 22:09:20 +01:00
|
|
|
(outpoint) =>
|
2019-07-25 22:26:42 +02:00
|
|
|
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
|
|
|
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
|
|
|
);
|
2019-07-05 20:11:55 +02:00
|
|
|
}
|
2019-08-02 02:56:25 +02:00
|
|
|
// block stream claims
|
2021-03-03 19:50:16 +01:00
|
|
|
if (claim && !shouldHide && !showUserBlocked && mutedUris.length && signingChannel) {
|
2021-07-15 22:22:44 +02:00
|
|
|
shouldHide = mutedUris.some((blockedUri) => isURIEqual(blockedUri, signingChannel.permanent_url));
|
2019-07-08 22:54:58 +02:00
|
|
|
}
|
2021-03-03 19:50:16 +01:00
|
|
|
if (claim && !shouldHide && !showUserBlocked && blockedUris.length && signingChannel) {
|
2021-07-15 22:22:44 +02:00
|
|
|
shouldHide = blockedUris.some((blockedUri) => isURIEqual(blockedUri, signingChannel.permanent_url));
|
2019-08-02 02:56:25 +02:00
|
|
|
}
|
2019-06-11 20:10:58 +02:00
|
|
|
|
2020-01-08 17:36:49 +01:00
|
|
|
if (!shouldHide && customShouldHide && claim) {
|
|
|
|
if (customShouldHide(claim)) {
|
|
|
|
shouldHide = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-13 20:12:27 +01:00
|
|
|
// Weird placement warning
|
|
|
|
// Make sure this happens after we figure out if this claim needs to be hidden
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide);
|
2020-01-13 20:12:27 +01:00
|
|
|
|
2019-09-26 18:28:08 +02:00
|
|
|
function handleOnClick(e) {
|
|
|
|
if (onClick) {
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
onClick(e, indexInContainer);
|
2020-01-30 22:01:23 +01:00
|
|
|
}
|
|
|
|
|
2021-06-19 10:28:00 +02:00
|
|
|
if (claim && !pending && !disableNavigation) {
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
history.push({
|
|
|
|
pathname: navigateUrl,
|
2021-08-10 16:38:53 +02:00
|
|
|
search: navigateSearch.toString() ? '?' + navigateSearch.toString() : '',
|
Fill in remaining Recsys fields
## Issue
6366 Recsys Evaluation Telemetry
The recommended list from lighthouse is obtained from `makeSelectRecommendedContentForUri`. This list is further tweaked by the GUI (e.g. move autoplay next item to top, remove blocked content, etc.). Recsys wants the final recommendation list and the clicked index (in exact order), so we need pass these info to the videojs recsys plugin somehow. Also, Recsys wants a recommendation list ID as well as the parent (referrer) ID, we so need to track the clicks and navigation.
## General Approach
- It seems easiest to just spew back the final (displayed) list and all the required info to Redux, and the recsys plugin (or anyone else in the future) can grab it.
- Try to touch few files as possible. The dirty work should all reside in `<RecommendedContent>` only.
## Changes
- `ClaimPreview`: add optional parameters to store an ID of the container that it is in (for this case, it is `ClaimList`) as well as the index within the container.
- When clicked, we store the container ID in the navigation history `state` object.
- For general cases, anyone can check this state from `history.location.state` to know which container referred/navigated to the current page. For the recsys use case, we can use this as the `parentUUID`.
- `ClaimList`: just relay `onClick` and set IDs.
- `RecommendedContent`: now handles the uuid generation (for both parent and child) and stores the data in Redux.
2021-07-28 14:07:49 +02:00
|
|
|
state: containerId ? { [CONTAINER_ID]: containerId } : undefined,
|
|
|
|
});
|
2019-06-11 20:10:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
useEffect(() => {
|
2020-12-28 20:26:55 +01:00
|
|
|
if (isValid && !isResolvingUri && shouldFetch && uri) {
|
2019-06-11 20:10:58 +02:00
|
|
|
resolveUri(uri);
|
|
|
|
}
|
2021-02-16 22:09:20 +01:00
|
|
|
}, [isValid, uri, isResolvingUri, shouldFetch, resolveUri]);
|
2019-06-11 20:10:58 +02:00
|
|
|
|
2021-03-25 19:52:18 +01:00
|
|
|
if ((shouldHide && !showNullPlaceholder) || (isLivestream && !ENABLE_NO_SOURCE_CLAIMS)) {
|
2019-06-11 20:10:58 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2020-12-22 16:16:39 +01:00
|
|
|
if (placeholder === 'loading' || (uri && !claim && isResolvingUri)) {
|
2021-01-13 16:44:44 +01:00
|
|
|
return <ClaimPreviewLoading isChannel={isChannelUri} type={type} />;
|
2020-12-04 01:10:23 +01:00
|
|
|
}
|
|
|
|
|
2021-01-26 17:55:27 +01:00
|
|
|
if (claim && showNullPlaceholder && shouldHide && nsfw && obscureNsfw) {
|
2020-12-22 16:16:39 +01:00
|
|
|
return (
|
2021-01-13 16:44:44 +01:00
|
|
|
<ClaimPreviewHidden
|
|
|
|
message={__('Mature content hidden by your preferences')}
|
|
|
|
isChannel={isChannelUri}
|
|
|
|
type={type}
|
|
|
|
/>
|
2020-12-22 16:16:39 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (claim && showNullPlaceholder && shouldHide) {
|
2021-01-13 16:44:44 +01:00
|
|
|
return <ClaimPreviewHidden message={__('This content is hidden')} isChannel={isChannelUri} type={type} />;
|
2019-06-11 20:10:58 +02:00
|
|
|
}
|
2020-12-04 01:10:23 +01:00
|
|
|
|
2020-12-22 16:16:39 +01:00
|
|
|
if (!claim && (showNullPlaceholder || empty)) {
|
2021-01-13 16:44:44 +01:00
|
|
|
return empty || <ClaimPreviewNoContent isChannel={isChannelUri} type={type} />;
|
2020-12-04 01:10:23 +01:00
|
|
|
}
|
|
|
|
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && isChannelUri && claim === null) {
|
2021-06-11 08:06:29 +02:00
|
|
|
return (
|
|
|
|
<React.Suspense fallback={null}>
|
|
|
|
<AbandonedChannelPreview uri={uri} type />
|
|
|
|
</React.Suspense>
|
|
|
|
);
|
2020-02-05 07:14:37 +01:00
|
|
|
}
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) {
|
2019-12-20 16:13:50 +01:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2021-04-29 09:22:56 +02:00
|
|
|
let liveProperty = null;
|
|
|
|
if (live === true) {
|
|
|
|
liveProperty = (claim) => <>LIVE</>;
|
|
|
|
}
|
|
|
|
|
2019-06-11 20:10:58 +02:00
|
|
|
return (
|
2020-10-20 19:10:02 +02:00
|
|
|
<WrapperElement
|
2019-08-02 08:28:14 +02:00
|
|
|
ref={ref}
|
2019-06-11 20:10:58 +02:00
|
|
|
role="link"
|
2019-09-26 18:28:08 +02:00
|
|
|
onClick={pending || type === 'inline' ? undefined : handleOnClick}
|
2020-01-31 17:43:14 +01:00
|
|
|
className={classnames('claim-preview__wrapper', {
|
2021-01-13 16:44:44 +01:00
|
|
|
'claim-preview__wrapper--channel': isChannelUri && type !== 'inline',
|
2020-01-31 17:43:14 +01:00
|
|
|
'claim-preview__wrapper--inline': type === 'inline',
|
|
|
|
'claim-preview__wrapper--small': type === 'small',
|
2021-04-29 09:22:56 +02:00
|
|
|
'claim-preview__live': live,
|
2021-07-13 00:39:23 +02:00
|
|
|
'claim-preview__active': active,
|
2019-06-11 20:10:58 +02:00
|
|
|
})}
|
|
|
|
>
|
2021-03-30 01:05:18 +02:00
|
|
|
<>
|
|
|
|
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
|
2019-06-11 20:10:58 +02:00
|
|
|
|
2021-03-30 01:05:18 +02:00
|
|
|
<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 ? (
|
2021-07-16 08:53:38 +02:00
|
|
|
<UriIndicator focusable={false} uri={uri} link>
|
ChannelThumbnail improvements
- [x] (6332) The IntersectionObserver method of lazy-loading loads cached images visibly late on slower devices. Previously, it was also showing the "broken image" icon briefly, which we mended by placing a dummy transparent image as the initial src.
- Reverted that ugly transparent image fix.
- Use the browser's built-in `loading="lazy"` instead. Sorry, Safari.
- [x] Size-optimization did not take "device pixel ratio" into account.
- When resizing an image through the CDN, we can't just take the dimensions of the tag in pixels directly -- we need to take zooming into account, otherwise the image ends up blurry.
- Previously, we quickly disabled optimization for the channel avatar in the Channel Page because of this. Now that we know the root-cause, the change was reverted and we now go through the CDN with appropriate sizes. This also improves our Web Vital scores.
- [x] Size-optimization wasn't really implemented for all ChannelThumbnail instances.
- The CDN-optimized size was hardcoded to the largest instance, so small images like sidebar thumbnails are still loading images that are unnecessarily larger.
- There's a little-bit of hardcoding of values from CSS here, but I think it's a ok compromise (not something we change often). It also doesn't need to be exact -- the "device pixel ratio" calculate will ensure it's slightly larger than what we need.
- [x] Set `width` and `height` of `<img>` to improve CLS.
- Addresses Ligthhouse complaints, although technically the shifting was addressed at the `ClaimPreviewTile` level (sub-container dimensions are well defined).
- Notes: the values don't need to be the final CSS-adjusted sizes. It just needs to be in the right aspect ratio to help the browser pre-allocate space to avoid shifts.
- [x] Add option to disable lazy-load Channel Thumbnails
- The guidelines mentioned that items that are already in the viewport should not enable `loading="lazy"`.
- We have a few areas where it doesn't make sense to lazy-load (e.g. thumbnail in Header, channel selector dropdown, publish preview, etc.).
2021-07-05 07:20:40 +02:00
|
|
|
<ChannelThumbnail uri={uri} small={type === 'inline'} />
|
2021-03-30 01:05:18 +02:00
|
|
|
</UriIndicator>
|
|
|
|
) : (
|
|
|
|
<>
|
|
|
|
{!pending ? (
|
2021-07-15 05:12:40 +02:00
|
|
|
<NavLink aria-hidden tabIndex={-1} {...navLinkProps}>
|
2021-03-30 01:05:18 +02:00
|
|
|
<FileThumbnail thumbnail={thumbnailUrl}>
|
2021-08-02 17:03:55 +02:00
|
|
|
<div className="claim-preview__hover-actions">
|
2021-08-10 16:38:53 +02:00
|
|
|
{isPlayable && <FileWatchLaterLink focusable={false} uri={uri} />}
|
2021-08-04 15:45:24 +02:00
|
|
|
</div>
|
|
|
|
<div className="claim-preview__hover-actions">
|
2021-08-02 17:03:55 +02:00
|
|
|
{/* @if TARGET='app' */}
|
|
|
|
{claim && !isCollection && (
|
2021-07-15 22:14:21 +02:00
|
|
|
<FileDownloadLink focusable={false} uri={canonicalUrl} hideOpenButton hideDownloadStatus />
|
2021-08-02 17:03:55 +02:00
|
|
|
)}
|
|
|
|
{/* @endif */}
|
|
|
|
</div>
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
{!isLivestream && (
|
2021-03-30 01:05:18 +02:00
|
|
|
<div className="claim-preview__file-property-overlay">
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
<PreviewOverlayProperties uri={uri} small={type === 'small'} properties={liveProperty} />
|
2021-03-30 01:05:18 +02:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</FileThumbnail>
|
2020-05-07 14:22:55 +02:00
|
|
|
</NavLink>
|
2021-03-30 01:05:18 +02:00
|
|
|
) : (
|
|
|
|
<FileThumbnail thumbnail={thumbnailUrl} />
|
2020-05-07 14:22:55 +02:00
|
|
|
)}
|
2021-03-30 01:05:18 +02:00
|
|
|
</>
|
|
|
|
)}
|
|
|
|
|
|
|
|
<div className="claim-preview__text">
|
|
|
|
<div className="claim-preview-metadata">
|
|
|
|
<div className="claim-preview-info">
|
|
|
|
{pending ? (
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
<ClaimPreviewTitle uri={uri} />
|
2021-03-30 01:05:18 +02:00
|
|
|
) : (
|
2021-07-21 01:49:41 +02:00
|
|
|
<NavLink aria-label={ariaLabelData} aria-current={active ? 'page' : null} {...navLinkProps}>
|
2021-03-30 01:05:18 +02:00
|
|
|
<ClaimPreviewTitle uri={uri} />
|
|
|
|
</NavLink>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
<ClaimPreviewSubtitle uri={uri} type={type} />
|
|
|
|
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
|
2021-08-19 17:25:45 +02:00
|
|
|
{channelSubscribers}
|
2020-01-31 17:43:14 +01:00
|
|
|
</div>
|
2021-03-30 01:05:18 +02:00
|
|
|
{type !== 'small' && (
|
|
|
|
<div className="claim-preview__actions">
|
|
|
|
{!pending && (
|
|
|
|
<>
|
|
|
|
{renderActions && claim && renderActions(claim)}
|
2021-06-24 16:33:11 +02:00
|
|
|
{Boolean(isMyCollection && listId) && (
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
<>
|
|
|
|
<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
|
2021-06-24 16:33:11 +02:00
|
|
|
editCollection(listId, {
|
2021-06-10 20:48:35 +02:00
|
|
|
order: { from: collectionIndex, to: Number(collectionIndex) - 1 },
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Button
|
|
|
|
button="alt"
|
|
|
|
className={'button-collection-order'}
|
|
|
|
icon={ICONS.DOWN}
|
|
|
|
disabled={collectionIndex === lastCollectionIndex}
|
|
|
|
onClick={(e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
if (editCollection) {
|
|
|
|
// $FlowFixMe
|
2021-06-24 16:33:11 +02:00
|
|
|
editCollection(listId, {
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
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
|
2021-06-24 16:33:11 +02:00
|
|
|
if (editCollection) editCollection(listId, { claims: [claim], remove: true });
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)}
|
2021-03-30 01:05:18 +02:00
|
|
|
{shouldHideActions || renderActions ? null : actions !== undefined ? (
|
|
|
|
actions
|
|
|
|
) : (
|
|
|
|
<div className="claim-preview__primary-actions">
|
|
|
|
{!isChannelUri && signingChannel && (
|
|
|
|
<div className="claim-preview__channel-staked">
|
ChannelThumbnail improvements
- [x] (6332) The IntersectionObserver method of lazy-loading loads cached images visibly late on slower devices. Previously, it was also showing the "broken image" icon briefly, which we mended by placing a dummy transparent image as the initial src.
- Reverted that ugly transparent image fix.
- Use the browser's built-in `loading="lazy"` instead. Sorry, Safari.
- [x] Size-optimization did not take "device pixel ratio" into account.
- When resizing an image through the CDN, we can't just take the dimensions of the tag in pixels directly -- we need to take zooming into account, otherwise the image ends up blurry.
- Previously, we quickly disabled optimization for the channel avatar in the Channel Page because of this. Now that we know the root-cause, the change was reverted and we now go through the CDN with appropriate sizes. This also improves our Web Vital scores.
- [x] Size-optimization wasn't really implemented for all ChannelThumbnail instances.
- The CDN-optimized size was hardcoded to the largest instance, so small images like sidebar thumbnails are still loading images that are unnecessarily larger.
- There's a little-bit of hardcoding of values from CSS here, but I think it's a ok compromise (not something we change often). It also doesn't need to be exact -- the "device pixel ratio" calculate will ensure it's slightly larger than what we need.
- [x] Set `width` and `height` of `<img>` to improve CLS.
- Addresses Ligthhouse complaints, although technically the shifting was addressed at the `ClaimPreviewTile` level (sub-container dimensions are well defined).
- Notes: the values don't need to be the final CSS-adjusted sizes. It just needs to be in the right aspect ratio to help the browser pre-allocate space to avoid shifts.
- [x] Add option to disable lazy-load Channel Thumbnails
- The guidelines mentioned that items that are already in the viewport should not enable `loading="lazy"`.
- We have a few areas where it doesn't make sense to lazy-load (e.g. thumbnail in Header, channel selector dropdown, publish preview, etc.).
2021-07-05 07:20:40 +02:00
|
|
|
<ChannelThumbnail uri={signingChannel.permanent_url} xsmall />
|
2021-03-30 01:05:18 +02:00
|
|
|
</div>
|
|
|
|
)}
|
2021-03-03 19:50:16 +01:00
|
|
|
|
2021-03-30 01:05:18 +02:00
|
|
|
{isChannelUri && !channelIsBlocked && !claimIsMine && (
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
<SubscribeButton uri={uri.startsWith('lbry://') ? uri : `lbry://${uri}`} />
|
2021-03-30 01:05:18 +02:00
|
|
|
)}
|
2021-03-03 19:50:16 +01:00
|
|
|
|
2021-03-30 01:05:18 +02:00
|
|
|
{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>
|
2019-06-11 20:10:58 +02:00
|
|
|
</div>
|
2021-07-22 09:37:57 +02:00
|
|
|
{!hideMenu && <ClaimMenuList uri={uri} collectionId={listId} />}
|
2021-03-30 01:05:18 +02:00
|
|
|
</>
|
2020-10-20 19:10:02 +02:00
|
|
|
</WrapperElement>
|
2019-06-11 20:10:58 +02:00
|
|
|
);
|
2019-08-02 08:28:14 +02:00
|
|
|
});
|
2019-06-11 20:10:58 +02:00
|
|
|
|
2019-06-28 09:27:55 +02:00
|
|
|
export default withRouter(ClaimPreview);
|