2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
2020-02-12 20:10:35 +01:00
|
|
|
import * as ICONS from 'constants/icons';
|
2020-09-03 22:05:38 +02:00
|
|
|
import * as PAGES from 'constants/pages';
|
2020-06-30 07:51:15 +02:00
|
|
|
import React from 'react';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { parseURI } from 'util/lbryURI';
|
2020-09-03 22:05:38 +02:00
|
|
|
import { YOUTUBE_STATUSES } from 'lbryinc';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Page from 'component/page';
|
2019-05-07 04:35:04 +02:00
|
|
|
import SubscribeButton from 'component/subscribeButton';
|
|
|
|
import ShareButton from 'component/shareButton';
|
|
|
|
import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'component/common/tabs';
|
2020-06-30 07:51:15 +02:00
|
|
|
import { useHistory } from 'react-router';
|
2019-06-28 19:00:29 +02:00
|
|
|
import Button from 'component/button';
|
2019-12-02 18:30:08 +01:00
|
|
|
import { formatLbryUrlForWeb } from 'util/url';
|
2019-05-07 04:35:04 +02:00
|
|
|
import ChannelContent from 'component/channelContent';
|
|
|
|
import ChannelAbout from 'component/channelAbout';
|
2019-10-15 00:21:40 +02:00
|
|
|
import ChannelDiscussion from 'component/channelDiscussion';
|
2019-05-07 04:35:04 +02:00
|
|
|
import ChannelThumbnail from 'component/channelThumbnail';
|
2019-07-02 19:54:42 +02:00
|
|
|
import ChannelEdit from 'component/channelEdit';
|
2019-08-02 02:56:25 +02:00
|
|
|
import classnames from 'classnames';
|
2019-10-03 23:40:54 +02:00
|
|
|
import HelpLink from 'component/common/help-link';
|
2020-06-08 20:42:29 +02:00
|
|
|
import ClaimSupportButton from 'component/claimSupportButton';
|
2021-02-16 22:09:20 +01:00
|
|
|
import ChannelStakedIndicator from 'component/channelStakedIndicator';
|
2021-03-03 19:50:16 +01:00
|
|
|
import ClaimMenuList from 'component/claimMenuList';
|
2021-07-14 18:18:34 +02:00
|
|
|
import OptimizedImage from 'component/optimizedImage';
|
2021-03-03 19:50:16 +01:00
|
|
|
import Yrbl from 'component/yrbl';
|
2021-07-04 17:01:15 +02:00
|
|
|
import I18nMessage from 'component/i18nMessage';
|
2021-07-22 19:32:35 +02:00
|
|
|
import TruncatedText from 'component/common/truncated-text';
|
2021-07-19 03:42:04 +02:00
|
|
|
// $FlowFixMe cannot resolve ...
|
|
|
|
import PlaceholderTx from 'static/img/placeholderTx.gif';
|
2019-05-07 04:35:04 +02:00
|
|
|
|
2020-08-31 19:12:34 +02:00
|
|
|
export const PAGE_VIEW_QUERY = `view`;
|
|
|
|
export const DISCUSSION_PAGE = `discussion`;
|
2021-07-23 08:36:39 +02:00
|
|
|
|
|
|
|
const PAGE = {
|
|
|
|
CONTENT: 'content',
|
|
|
|
LISTS: 'lists',
|
|
|
|
ABOUT: 'about',
|
|
|
|
DISCUSSION: DISCUSSION_PAGE,
|
|
|
|
EDIT: 'edit',
|
|
|
|
};
|
2017-05-04 05:44:08 +02:00
|
|
|
|
2018-03-26 23:32:43 +02:00
|
|
|
type Props = {
|
|
|
|
uri: string,
|
2019-07-17 22:49:06 +02:00
|
|
|
claim: ChannelClaim,
|
2019-05-07 04:35:04 +02:00
|
|
|
title: ?string,
|
|
|
|
cover: ?string,
|
|
|
|
thumbnail: ?string,
|
2019-05-14 07:12:24 +02:00
|
|
|
page: number,
|
2019-05-07 04:35:04 +02:00
|
|
|
match: { params: { attribute: ?string } },
|
2019-06-28 19:00:29 +02:00
|
|
|
channelIsMine: boolean,
|
2019-07-08 22:54:58 +02:00
|
|
|
isSubscribed: boolean,
|
|
|
|
channelIsBlocked: boolean,
|
2019-08-29 03:39:21 +02:00
|
|
|
blackListedOutpoints: Array<{
|
|
|
|
txid: string,
|
|
|
|
nout: number,
|
|
|
|
}>,
|
2021-02-16 22:09:20 +01:00
|
|
|
fetchSubCount: (string) => void,
|
2019-09-25 05:42:51 +02:00
|
|
|
subCount: number,
|
2020-06-21 18:51:06 +02:00
|
|
|
pending: boolean,
|
2020-09-03 22:05:38 +02:00
|
|
|
youtubeChannels: ?Array<{ channel_claim_id: string, sync_status: string, transfer_state: string }>,
|
2021-03-03 19:50:16 +01:00
|
|
|
blockedChannels: Array<string>,
|
2021-03-04 18:55:16 +01:00
|
|
|
mutedChannels: Array<string>,
|
2021-07-04 05:19:13 +02:00
|
|
|
unpublishedCollections: CollectionGroup,
|
2018-03-26 23:32:43 +02:00
|
|
|
};
|
|
|
|
|
2019-03-28 17:53:13 +01:00
|
|
|
function ChannelPage(props: Props) {
|
2019-07-08 22:54:58 +02:00
|
|
|
const {
|
|
|
|
uri,
|
2020-06-29 21:54:07 +02:00
|
|
|
claim,
|
2019-07-08 22:54:58 +02:00
|
|
|
title,
|
|
|
|
cover,
|
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
|
|
|
// page, ?page= may come back some day?
|
2019-07-08 22:54:58 +02:00
|
|
|
channelIsMine,
|
|
|
|
isSubscribed,
|
2019-08-29 03:39:21 +02:00
|
|
|
blackListedOutpoints,
|
2019-09-25 05:42:51 +02:00
|
|
|
fetchSubCount,
|
|
|
|
subCount,
|
2020-06-21 18:51:06 +02:00
|
|
|
pending,
|
2020-09-03 22:05:38 +02:00
|
|
|
youtubeChannels,
|
2021-03-03 19:50:16 +01:00
|
|
|
blockedChannels,
|
2021-03-04 18:55:16 +01:00
|
|
|
mutedChannels,
|
2021-07-04 05:19:13 +02:00
|
|
|
unpublishedCollections,
|
2019-07-08 22:54:58 +02:00
|
|
|
} = props;
|
2020-06-30 07:51:15 +02:00
|
|
|
const {
|
|
|
|
push,
|
|
|
|
goBack,
|
|
|
|
location: { search },
|
|
|
|
} = useHistory();
|
2021-03-03 19:50:16 +01:00
|
|
|
const [viewBlockedChannel, setViewBlockedChannel] = React.useState(false);
|
2019-03-28 17:53:13 +01:00
|
|
|
const urlParams = new URLSearchParams(search);
|
2021-07-23 08:47:28 +02:00
|
|
|
const currentView = urlParams.get(PAGE_VIEW_QUERY) || PAGE.CONTENT;
|
2020-07-24 13:35:22 +02:00
|
|
|
const [discussionWasMounted, setDiscussionWasMounted] = React.useState(false);
|
2021-07-23 08:36:39 +02:00
|
|
|
const editing = urlParams.get(PAGE_VIEW_QUERY) === PAGE.EDIT;
|
2020-06-30 07:51:15 +02:00
|
|
|
const { channelName } = parseURI(uri);
|
2019-07-17 22:49:06 +02:00
|
|
|
const { permanent_url: permanentUrl } = claim;
|
2019-09-27 05:52:04 +02:00
|
|
|
const claimId = claim.claim_id;
|
2020-05-25 18:19:15 +02:00
|
|
|
const formattedSubCount = Number(subCount).toLocaleString();
|
2021-03-03 19:50:16 +01:00
|
|
|
const isBlocked = claim && blockedChannels.includes(claim.permanent_url);
|
2021-03-04 18:55:16 +01:00
|
|
|
const isMuted = claim && mutedChannels.includes(claim.permanent_url);
|
2020-09-03 22:05:38 +02:00
|
|
|
const isMyYouTubeChannel =
|
|
|
|
claim &&
|
|
|
|
youtubeChannels &&
|
|
|
|
youtubeChannels.some(({ channel_claim_id, sync_status, transfer_state }) => {
|
|
|
|
if (
|
|
|
|
channel_claim_id === claim.claim_id &&
|
|
|
|
sync_status !== YOUTUBE_STATUSES.YOUTUBE_SYNC_ABANDONDED &&
|
|
|
|
transfer_state !== YOUTUBE_STATUSES.YOUTUBE_SYNC_COMPLETED_TRANSFER
|
|
|
|
) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
});
|
2021-06-15 22:06:57 +02:00
|
|
|
|
2021-07-04 05:19:13 +02:00
|
|
|
const hasUnpublishedCollections = unpublishedCollections && Object.keys(unpublishedCollections).length;
|
|
|
|
|
|
|
|
let collectionEmpty;
|
|
|
|
if (channelIsMine) {
|
|
|
|
collectionEmpty = hasUnpublishedCollections ? (
|
|
|
|
<section className="main--empty">
|
|
|
|
{
|
|
|
|
<p>
|
|
|
|
<I18nMessage
|
|
|
|
tokens={{
|
|
|
|
pick: <Button button="link" navigate={`/$/${PAGES.LISTS}`} label={__('Pick')} />,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
You have unpublished lists! %pick% one and publish it!
|
|
|
|
</I18nMessage>
|
|
|
|
</p>
|
|
|
|
}
|
|
|
|
</section>
|
|
|
|
) : (
|
|
|
|
<section className="main--empty">{__('You have no lists! Create one from any playable content.')}</section>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
collectionEmpty = <section className="main--empty">{__('No Lists Found')}</section>;
|
|
|
|
}
|
|
|
|
|
2020-06-30 07:51:15 +02:00
|
|
|
let channelIsBlackListed = false;
|
|
|
|
|
|
|
|
if (claim && blackListedOutpoints) {
|
|
|
|
channelIsBlackListed = blackListedOutpoints.some(
|
2021-02-16 22:09:20 +01:00
|
|
|
(outpoint) => outpoint.txid === claim.txid && outpoint.nout === claim.nout
|
2020-06-30 07:51:15 +02:00
|
|
|
);
|
|
|
|
}
|
2019-06-28 19:00:29 +02:00
|
|
|
|
2019-05-07 04:35:04 +02:00
|
|
|
// If a user changes tabs, update the url so it stays on the same page if they refresh.
|
|
|
|
// We don't want to use links here because we can't animate the tab change and using links
|
|
|
|
// would alter the Tab label's role attribute, which should stay role="tab" to work with keyboards/screen readers.
|
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 tabIndex;
|
|
|
|
switch (currentView) {
|
2021-07-23 08:36:39 +02:00
|
|
|
case PAGE.CONTENT:
|
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
|
|
|
tabIndex = 0;
|
|
|
|
break;
|
2021-07-23 08:36:39 +02:00
|
|
|
case PAGE.LISTS:
|
2021-07-01 18:52:08 +02:00
|
|
|
tabIndex = 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
|
|
|
break;
|
2021-07-23 08:36:39 +02:00
|
|
|
case PAGE.ABOUT:
|
2021-07-01 19:34:29 +02:00
|
|
|
tabIndex = 2;
|
2021-06-10 22:24:48 +02:00
|
|
|
break;
|
2021-07-23 08:36:39 +02:00
|
|
|
case PAGE.DISCUSSION:
|
2021-07-04 05:19:13 +02:00
|
|
|
tabIndex = 3;
|
|
|
|
break;
|
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
|
|
|
default:
|
|
|
|
tabIndex = 0;
|
|
|
|
break;
|
|
|
|
}
|
2019-10-15 00:21:40 +02:00
|
|
|
|
2019-09-16 07:32:02 +02:00
|
|
|
function onTabChange(newTabIndex) {
|
2019-12-02 18:30:08 +01:00
|
|
|
let url = formatLbryUrlForWeb(uri);
|
2019-05-14 07:12:24 +02:00
|
|
|
let search = '?';
|
2019-10-15 00:21:40 +02:00
|
|
|
|
|
|
|
if (newTabIndex === 0) {
|
2021-07-23 08:36:39 +02:00
|
|
|
search += `${PAGE_VIEW_QUERY}=${PAGE.CONTENT}`;
|
2019-10-15 00:21:40 +02:00
|
|
|
} else if (newTabIndex === 1) {
|
2021-07-23 08:36:39 +02:00
|
|
|
search += `${PAGE_VIEW_QUERY}=${PAGE.LISTS}`;
|
2021-07-04 05:19:13 +02:00
|
|
|
} else if (newTabIndex === 2) {
|
2021-07-23 08:36:39 +02:00
|
|
|
search += `${PAGE_VIEW_QUERY}=${PAGE.ABOUT}`;
|
2019-10-15 00:21:40 +02:00
|
|
|
} else {
|
2021-07-23 08:36:39 +02:00
|
|
|
search += `${PAGE_VIEW_QUERY}=${PAGE.DISCUSSION}`;
|
2017-08-24 23:12:23 +02:00
|
|
|
}
|
2020-06-30 07:51:15 +02:00
|
|
|
|
|
|
|
push(`${url}${search}`);
|
2019-09-16 07:32:02 +02:00
|
|
|
}
|
|
|
|
|
2020-07-24 13:35:22 +02:00
|
|
|
React.useEffect(() => {
|
2021-07-23 08:36:39 +02:00
|
|
|
if (currentView === PAGE.DISCUSSION) {
|
2020-07-24 13:35:22 +02:00
|
|
|
setDiscussionWasMounted(true);
|
|
|
|
}
|
|
|
|
}, [currentView]);
|
|
|
|
|
2019-09-23 15:57:03 +02:00
|
|
|
React.useEffect(() => {
|
2019-09-27 05:52:04 +02:00
|
|
|
fetchSubCount(claimId);
|
|
|
|
}, [uri, fetchSubCount, claimId]);
|
2019-09-23 15:57:03 +02:00
|
|
|
|
2020-06-29 21:54:07 +02:00
|
|
|
if (editing) {
|
|
|
|
return (
|
|
|
|
<Page
|
|
|
|
noFooter
|
|
|
|
noSideNavigation={editing}
|
2020-06-30 07:51:15 +02:00
|
|
|
backout={{
|
|
|
|
title: __('Editing @%channel%', { channel: channelName }),
|
|
|
|
simpleTitle: __('Editing'),
|
|
|
|
}}
|
2020-06-29 21:54:07 +02:00
|
|
|
>
|
2020-07-10 23:04:36 +02:00
|
|
|
<ChannelEdit uri={uri} onDone={() => goBack()} />
|
2020-06-29 21:54:07 +02:00
|
|
|
</Page>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-03-28 17:53:13 +01:00
|
|
|
return (
|
2020-05-15 16:19:37 +02:00
|
|
|
<Page noFooter>
|
2020-01-03 17:36:15 +01:00
|
|
|
<header className="channel-cover">
|
|
|
|
<div className="channel__quick-actions">
|
2020-09-03 22:05:38 +02:00
|
|
|
{isMyYouTubeChannel && (
|
|
|
|
<Button
|
|
|
|
button="alt"
|
|
|
|
label={__('Claim Your Channel')}
|
|
|
|
icon={ICONS.YOUTUBE}
|
|
|
|
navigate={`/$/${PAGES.CHANNELS}`}
|
|
|
|
/>
|
|
|
|
)}
|
2021-03-04 18:55:16 +01:00
|
|
|
{!channelIsBlackListed && <ShareButton uri={uri} />}
|
|
|
|
{!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />}
|
|
|
|
{!(isBlocked || isMuted) && (!channelIsBlackListed || isSubscribed) && <SubscribeButton uri={permanentUrl} />}
|
2021-06-09 13:21:05 +02:00
|
|
|
{/* TODO: add channel collections <ClaimCollectionAddButton uri={uri} fileAction /> */}
|
2021-06-24 16:33:11 +02:00
|
|
|
<ClaimMenuList uri={claim.permanent_url} inline isChannelPage />
|
2020-01-03 17:36:15 +01:00
|
|
|
</div>
|
2021-07-19 03:42:04 +02:00
|
|
|
{cover && <img className={classnames('channel-cover__custom')} src={PlaceholderTx} />}
|
2021-07-14 18:18:34 +02:00
|
|
|
{cover && <OptimizedImage className={classnames('channel-cover__custom')} src={cover} objectFit="cover" />}
|
2020-01-03 17:36:15 +01:00
|
|
|
<div className="channel__primary-info">
|
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 className="channel__thumbnail--channel-page" uri={uri} allowGifs hideStakedIndicator />
|
2021-02-16 22:09:20 +01:00
|
|
|
<h1 className="channel__title">
|
2021-07-22 19:32:35 +02:00
|
|
|
<TruncatedText lines={2} showTooltip>
|
2021-10-14 22:46:36 +02:00
|
|
|
{title || (channelName && '@' + channelName)}
|
2021-07-22 19:32:35 +02:00
|
|
|
</TruncatedText>
|
2021-02-16 22:09:20 +01:00
|
|
|
<ChannelStakedIndicator uri={uri} large />
|
|
|
|
</h1>
|
2020-01-03 17:36:15 +01:00
|
|
|
<div className="channel__meta">
|
|
|
|
<span>
|
2020-05-25 18:19:15 +02:00
|
|
|
{formattedSubCount} {subCount !== 1 ? __('Followers') : __('Follower')}
|
2020-01-03 17:36:15 +01:00
|
|
|
<HelpLink href="https://lbry.com/faq/views" />
|
|
|
|
</span>
|
2020-06-29 21:54:07 +02:00
|
|
|
{channelIsMine && (
|
2020-06-21 18:51:06 +02:00
|
|
|
<>
|
|
|
|
{pending ? (
|
|
|
|
<span>{__('Your changes will be live in a few minutes')}</span>
|
|
|
|
) : (
|
|
|
|
<Button
|
|
|
|
button="alt"
|
|
|
|
title={__('Edit')}
|
2021-07-23 08:36:39 +02:00
|
|
|
onClick={() => push(`?${PAGE_VIEW_QUERY}=${PAGE.EDIT}`)}
|
2020-06-21 18:51:06 +02:00
|
|
|
icon={ICONS.EDIT}
|
|
|
|
iconSize={18}
|
|
|
|
disabled={pending}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)}
|
2020-01-03 17:36:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-06-18 17:28:30 +02:00
|
|
|
<div className="channel-cover__gradient" />
|
2020-01-03 17:36:15 +01:00
|
|
|
</header>
|
2021-02-16 22:09:20 +01:00
|
|
|
|
2021-03-04 18:55:16 +01:00
|
|
|
{(isBlocked || isMuted) && !viewBlockedChannel ? (
|
2021-03-03 19:50:16 +01:00
|
|
|
<div className="main--empty">
|
|
|
|
<Yrbl
|
2021-03-04 18:55:16 +01:00
|
|
|
title={isBlocked ? __('This channel is blocked') : __('This channel is muted')}
|
|
|
|
subtitle={
|
|
|
|
isBlocked
|
|
|
|
? __('Are you sure you want to view this content? Viewing will not unblock @%channel%', {
|
|
|
|
channel: channelName,
|
|
|
|
})
|
|
|
|
: __('Are you sure you want to view this content? Viewing will not unmute @%channel%', {
|
|
|
|
channel: channelName,
|
|
|
|
})
|
|
|
|
}
|
2021-03-03 19:50:16 +01:00
|
|
|
actions={
|
|
|
|
<div className="section__actions">
|
|
|
|
<Button button="primary" label={__('View Content')} onClick={() => setViewBlockedChannel(true)} />
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
) : (
|
|
|
|
<Tabs onChange={onTabChange} index={tabIndex}>
|
|
|
|
<TabList className="tabs__list--channel-page">
|
2021-07-01 18:38:13 +02:00
|
|
|
<Tab disabled={editing}>{__('Content')}</Tab>
|
2021-07-04 05:19:13 +02:00
|
|
|
<Tab disabled={editing}>{__('Playlists')}</Tab>
|
2021-03-03 19:50:16 +01:00
|
|
|
<Tab>{editing ? __('Editing Your Channel') : __('About --[tab title in Channel Page]--')}</Tab>
|
|
|
|
<Tab disabled={editing}>{__('Community')}</Tab>
|
|
|
|
</TabList>
|
|
|
|
<TabPanels>
|
|
|
|
<TabPanel>
|
2021-07-23 08:47:28 +02:00
|
|
|
{currentView === PAGE.CONTENT && (
|
|
|
|
<ChannelContent
|
|
|
|
uri={uri}
|
|
|
|
channelIsBlackListed={channelIsBlackListed}
|
|
|
|
viewHiddenChannels
|
2021-08-23 22:24:39 +02:00
|
|
|
claimType={['stream', 'repost']}
|
2021-07-23 08:47:28 +02:00
|
|
|
empty={<section className="main--empty">{__('No Content Found')}</section>}
|
|
|
|
/>
|
|
|
|
)}
|
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
|
|
|
</TabPanel>
|
2021-07-04 05:19:13 +02:00
|
|
|
<TabPanel>
|
2021-07-23 08:47:28 +02:00
|
|
|
{currentView === PAGE.LISTS && (
|
|
|
|
<ChannelContent
|
|
|
|
claimType={'collection'}
|
|
|
|
uri={uri}
|
|
|
|
channelIsBlackListed={channelIsBlackListed}
|
|
|
|
viewHiddenChannels
|
|
|
|
empty={collectionEmpty}
|
|
|
|
/>
|
|
|
|
)}
|
2021-07-04 05:19:13 +02:00
|
|
|
</TabPanel>
|
2021-03-03 19:50:16 +01:00
|
|
|
<TabPanel>
|
|
|
|
<ChannelAbout uri={uri} />
|
|
|
|
</TabPanel>
|
|
|
|
<TabPanel>
|
2021-07-23 08:36:39 +02:00
|
|
|
{(discussionWasMounted || currentView === PAGE.DISCUSSION) && <ChannelDiscussion uri={uri} />}
|
2021-03-03 19:50:16 +01:00
|
|
|
</TabPanel>
|
|
|
|
</TabPanels>
|
|
|
|
</Tabs>
|
|
|
|
)}
|
2019-03-28 17:53:13 +01:00
|
|
|
</Page>
|
|
|
|
);
|
2017-05-04 05:44:08 +02:00
|
|
|
}
|
|
|
|
|
2020-06-30 07:51:15 +02:00
|
|
|
export default ChannelPage;
|