Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52800e8fd6 |
No files matched your search
Vendored
+3
-2
@@ -4,12 +4,12 @@ declare type HomepageObject = {
|
||||
options: any,
|
||||
route: string,
|
||||
title: string,
|
||||
}
|
||||
};
|
||||
|
||||
declare type HomepageData = {
|
||||
[string]: HomepageObject,
|
||||
default: any => any,
|
||||
}
|
||||
};
|
||||
|
||||
declare type RowDataItem = {
|
||||
title: any,
|
||||
@@ -19,6 +19,7 @@ declare type RowDataItem = {
|
||||
extra?: any,
|
||||
options?: {
|
||||
channelIds?: Array<string>,
|
||||
limitClaimsPerChannel?: number,
|
||||
pageSize: number,
|
||||
},
|
||||
route?: string,
|
||||
|
||||
+1245
-186
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -143,7 +143,7 @@
|
||||
"imagesloaded": "^4.1.4",
|
||||
"json-loader": "^0.5.4",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#5cd9e7601cdc1c81b8d0e2d2f02e9b9d2fb86575",
|
||||
"lbry-redux": "lbryio/lbry-redux#508e8d36fd91106beb7d6b4edb9f726dae0e6264",
|
||||
"lbryinc": "lbryio/lbryinc#8f9a58bfc8312a65614fd7327661cdcc502c4e59",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
|
||||
+11
-6
@@ -48,7 +48,6 @@
|
||||
"Description of your content": "Description of your content",
|
||||
"Price": "Price",
|
||||
"Free": "Free",
|
||||
"The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).": "The LBRY URL is the exact address where people find your content (ex. lbry://myvideo).",
|
||||
"Learn more": "Learn more",
|
||||
"Name": "Name",
|
||||
"Deposit": "Deposit",
|
||||
@@ -174,7 +173,6 @@
|
||||
"Yes": "Yes",
|
||||
"No": "No",
|
||||
"These search results are provided by LBRY, Inc.": "These search results are provided by LBRY, Inc.",
|
||||
"FILTER": "FILTER",
|
||||
"View file": "View file",
|
||||
"Files": "Files",
|
||||
"Channels": "Channels",
|
||||
@@ -386,8 +384,11 @@
|
||||
"Email Us": "Email Us",
|
||||
"Today": "Today",
|
||||
"All time": "All time",
|
||||
"Share on Reddit": "Share on Reddit",
|
||||
"Share on Facebook": "Share on Facebook",
|
||||
"Share On Twitter": "Share On Twitter",
|
||||
"Share on Telegram": "Share on Telegram",
|
||||
"Share via...": "Share via...",
|
||||
"View on lbry.tv": "View on lbry.tv",
|
||||
"You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.": "You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.",
|
||||
"Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?": "Standard messaging rates apply. LBRY will not text or call you otherwise. Having trouble?",
|
||||
@@ -450,6 +451,7 @@
|
||||
"Trending": "Trending",
|
||||
"Top": "Top",
|
||||
"New": "New",
|
||||
"New --[clears Publish Form]--": "New",
|
||||
"Loading": "Loading",
|
||||
"This file is in your library.": "This file is in your library.",
|
||||
"'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.": "'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.",
|
||||
@@ -546,7 +548,6 @@
|
||||
"Extra Verification Needed": "Extra Verification Needed",
|
||||
"We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.": "We weren't able to auto-approve you for rewards. Please complete one of the steps below to unlock them.",
|
||||
"Verify phone number": "Verify phone number",
|
||||
"Verify Phone Number": "Verify Phone Number",
|
||||
"OR": "OR",
|
||||
"Proof via Credit": "Proof via Credit",
|
||||
"If you have a valid credit or debit card, you can use it to instantly prove your humanity. LBRY does not store your credit card information. There is no charge at all for this, now or in the future.": "If you have a valid credit or debit card, you can use it to instantly prove your humanity. LBRY does not store your credit card information. There is no charge at all for this, now or in the future.",
|
||||
@@ -878,7 +879,6 @@
|
||||
"Tag selection": "Tag selection",
|
||||
"Select some tags to help us show you interesting things.": "Select some tags to help us show you interesting things.",
|
||||
"You are currently following %followingCount% tags": "You are currently following %followingCount% tags",
|
||||
"You are currently following %followingCount% tag": "You are currently following %followingCount% tag",
|
||||
"Back": "Back",
|
||||
"Experimental Transcoding": "Experimental Transcoding",
|
||||
"A Folder containing FFmpeg": "A Folder containing FFmpeg",
|
||||
@@ -1064,6 +1064,7 @@
|
||||
"download the app": "download the app",
|
||||
"lbry.tv collects usage information for itself only (%more_information%).": "lbry.tv collects usage information for itself only (%more_information%).",
|
||||
"lbry.tv collects usage information for itself only (%more_information%). Want control over this and more?": "lbry.tv collects usage information for itself only (%more_information%). Want control over this and more?",
|
||||
"more --[value for \"more_information\"]--": "more",
|
||||
"%DOMAIN% performance may be degraded. You can try to use it, or wait 5 minutes and refresh. Please no crush us.": "%DOMAIN% performance may be degraded. You can try to use it, or wait 5 minutes and refresh. Please no crush us.",
|
||||
"Please %sign_in_link% to comment.": "Please %sign_in_link% to comment.",
|
||||
"Replying as %reply_channel%": "Replying as %reply_channel%",
|
||||
@@ -1398,7 +1399,7 @@
|
||||
"Skip preview and confirmation": "Skip preview and confirmation",
|
||||
"Upload settings": "Upload settings",
|
||||
"Currently uploading": "Currently uploading",
|
||||
"You files are currently uploading.": "You files are currently uploading.",
|
||||
"Your files are currently uploading.": "Your files are currently uploading.",
|
||||
"Your file is currently uploading.": "Your file is currently uploading.",
|
||||
"Enable Sync": "Enable Sync",
|
||||
"Disable Sync": "Disable Sync",
|
||||
@@ -1450,6 +1451,7 @@
|
||||
"Never fear though, there are tons of ways to earn %lbc%. You can earn or purchase %lbc%, or you can have your friends send you some.": "Never fear though, there are tons of ways to earn %lbc%. You can earn or purchase %lbc%, or you can have your friends send you some.",
|
||||
"gaming, comedy, educational": "gaming, comedy, educational",
|
||||
"A channel is required to comment on %SITE_NAME%": "A channel is required to comment on %SITE_NAME%",
|
||||
"A channel is required to comment on lbry.tv": "A channel is required to comment on lbry.tv",
|
||||
"A welcome bonus and thank you for your contribution to content freedom.": "A welcome bonus and thank you for your contribution to content freedom.",
|
||||
"You earned %lbc% new user reward.": "You earned %lbc% new user reward.",
|
||||
"Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.": "Just press play on something. Anything at all. Yep, even that one. Everybody's doing it.",
|
||||
@@ -1581,6 +1583,8 @@
|
||||
"Search only in this language by default": "Search only in this language by default",
|
||||
"This link leads to an external website.": "This link leads to an external website.",
|
||||
"No Content Found": "No Content Found",
|
||||
"No Lists Found": "No Lists Found",
|
||||
"No Reposts Found": "No Reposts Found",
|
||||
"Publish Something": "Publish Something",
|
||||
"Repost Something": "Repost Something",
|
||||
"Watch on lbry.tv": "Watch on lbry.tv",
|
||||
@@ -1667,7 +1671,7 @@
|
||||
"%balance% available.": "%balance% available.",
|
||||
"Unlock all tips": "Unlock all tips",
|
||||
"Unlock All": "Unlock All",
|
||||
"there's so much room for activities": "there's so much room for activities",
|
||||
"just like the simulations": "just like the simulations",
|
||||
"Moon cheese is an acquired taste": "Moon cheese is an acquired taste",
|
||||
"Nothing found here. Like big tech ethics.": "Nothing found here. Like big tech ethics.",
|
||||
"Level %current_level%": "Level %current_level%",
|
||||
@@ -1912,6 +1916,7 @@
|
||||
"Latest": "Latest",
|
||||
"Channel Not Found": "Channel Not Found",
|
||||
"Probably because you didn't make it.": "Probably because you didn't make it.",
|
||||
"Release date": "Release date",
|
||||
"Set custom release date": "Set custom release date",
|
||||
"Now": "Now",
|
||||
"Set to current date and time": "Set to current date and time",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
+3
-4
@@ -37,8 +37,10 @@ type Analytics = {
|
||||
tagFollowEvent: (string, boolean, ?string) => void,
|
||||
playerLoadedEvent: (?boolean) => void,
|
||||
playerStartedEvent: (?boolean) => void,
|
||||
videoFetchDuration: (string, number) => void,
|
||||
videoStartEvent: (string, number) => void,
|
||||
adsFetchedEvent: () => void,
|
||||
adsReceivedEvent: (any) => void,
|
||||
adsErrorEvent: (any) => void,
|
||||
videoBufferEvent: (
|
||||
StreamClaim,
|
||||
{
|
||||
@@ -51,9 +53,6 @@ type Analytics = {
|
||||
readyState: number,
|
||||
}
|
||||
) => void,
|
||||
adsFetchedEvent: () => void,
|
||||
adsReceivedEvent: (any) => void,
|
||||
adsErrorEvent: (any) => void,
|
||||
emailProvidedEvent: () => void,
|
||||
emailVerifiedEvent: () => void,
|
||||
rewardEligibleEvent: () => void,
|
||||
|
||||
@@ -26,13 +26,14 @@ type Props = {
|
||||
channelIsBlackListed: boolean,
|
||||
defaultPageSize?: number,
|
||||
defaultInfiniteScroll?: Boolean,
|
||||
claim: ?Claim,
|
||||
claim: Claim,
|
||||
isAuthenticated: boolean,
|
||||
showMature: boolean,
|
||||
tileLayout: boolean,
|
||||
viewHiddenChannels: boolean,
|
||||
doResolveUris: (Array<string>, boolean) => void,
|
||||
claimType: string,
|
||||
empty?: string,
|
||||
};
|
||||
|
||||
function ChannelContent(props: Props) {
|
||||
@@ -51,6 +52,7 @@ function ChannelContent(props: Props) {
|
||||
viewHiddenChannels,
|
||||
doResolveUris,
|
||||
claimType,
|
||||
empty,
|
||||
} = props;
|
||||
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
||||
const [searchQuery, setSearchQuery] = React.useState('');
|
||||
@@ -133,41 +135,40 @@ function ChannelContent(props: Props) {
|
||||
|
||||
{!channelIsMine && claimsInChannel > 0 && <HiddenNsfwClaims uri={uri} />}
|
||||
|
||||
{claim && claimsInChannel > 0 ? (
|
||||
<ClaimListDiscover
|
||||
showHiddenByUser={viewHiddenChannels}
|
||||
forceShowReposts
|
||||
hideFilters={!showFilters}
|
||||
hideAdvancedFilter={!showFilters}
|
||||
tileLayout={tileLayout}
|
||||
uris={searchResults}
|
||||
channelIds={[claim.claim_id]}
|
||||
claimType={claimType}
|
||||
feeAmount={CS.FEE_AMOUNT_ANY}
|
||||
defaultOrderBy={CS.ORDER_BY_NEW}
|
||||
pageSize={defaultPageSize}
|
||||
infiniteScroll={defaultInfiniteScroll}
|
||||
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||
meta={
|
||||
showFilters && (
|
||||
<Form onSubmit={() => {}} className="wunderbar--inline">
|
||||
<Icon icon={ICONS.SEARCH} />
|
||||
<FormField
|
||||
className="wunderbar__input--inline"
|
||||
value={searchQuery}
|
||||
onChange={handleInputChange}
|
||||
type="text"
|
||||
placeholder={__('Search')}
|
||||
/>
|
||||
</Form>
|
||||
)
|
||||
}
|
||||
isChannel
|
||||
channelIsMine={channelIsMine}
|
||||
/>
|
||||
) : (
|
||||
<section className="main--empty">{__("This channel hasn't published anything yet")}</section>
|
||||
)}
|
||||
<ClaimListDiscover
|
||||
hideLivestreamClaims
|
||||
showHiddenByUser={viewHiddenChannels}
|
||||
forceShowReposts
|
||||
hideFilters={!showFilters}
|
||||
hideAdvancedFilter={!showFilters}
|
||||
tileLayout={tileLayout}
|
||||
uris={searchResults}
|
||||
streamType={CS.CONTENT_ALL}
|
||||
channelIds={[claim.claim_id]}
|
||||
claimType={claimType}
|
||||
feeAmount={CS.FEE_AMOUNT_ANY}
|
||||
defaultOrderBy={CS.ORDER_BY_NEW}
|
||||
pageSize={defaultPageSize}
|
||||
infiniteScroll={defaultInfiniteScroll}
|
||||
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||
meta={
|
||||
showFilters && (
|
||||
<Form onSubmit={() => {}} className="wunderbar--inline">
|
||||
<Icon icon={ICONS.SEARCH} />
|
||||
<FormField
|
||||
className="wunderbar__input--inline"
|
||||
value={searchQuery}
|
||||
onChange={handleInputChange}
|
||||
type="text"
|
||||
placeholder={__('Search')}
|
||||
/>
|
||||
</Form>
|
||||
)
|
||||
}
|
||||
isChannel
|
||||
channelIsMine={channelIsMine}
|
||||
empty={empty}
|
||||
/>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import classnames from 'classnames';
|
||||
import Gerbil from './gerbil.png';
|
||||
import Spaceman from './spaceman.png';
|
||||
import Transparent from './transparent_1x1.png';
|
||||
import FreezeframeWrapper from 'component/fileThumbnail/FreezeframeWrapper';
|
||||
import ChannelStakedIndicator from 'component/channelStakedIndicator';
|
||||
@@ -100,7 +100,7 @@ function ChannelThumbnail(props: Props) {
|
||||
ref={thumbnailRef}
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__default"
|
||||
data-src={!thumbError && url ? url : Gerbil}
|
||||
data-src={!thumbError && url ? url : Spaceman}
|
||||
src={Transparent}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
@@ -114,7 +114,7 @@ function ChannelThumbnail(props: Props) {
|
||||
ref={thumbnailRef}
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__custom"
|
||||
data-src={!thumbError && url ? url : Gerbil}
|
||||
data-src={!thumbError && url ? url : Spaceman}
|
||||
src={Transparent}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
|
||||
@@ -42,6 +42,7 @@ const ClaimCollectionAdd = (props: Props) => {
|
||||
function handleAddCollection() {
|
||||
addCollection(newCollectionName, [permanentUrl], isChannel ? 'collection' : 'playlist');
|
||||
setNewCollectionName('');
|
||||
setAddNewCollection(false);
|
||||
}
|
||||
|
||||
function altEnterListener(e: SyntheticKeyboardEvent<*>) {
|
||||
@@ -60,6 +61,11 @@ const ClaimCollectionAdd = (props: Props) => {
|
||||
window.removeEventListener('keydown', altEnterListener);
|
||||
}
|
||||
|
||||
function handleClearNew() {
|
||||
setNewCollectionName('');
|
||||
setAddNewCollection(false);
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={__('Add To...')}
|
||||
@@ -73,7 +79,7 @@ const ClaimCollectionAdd = (props: Props) => {
|
||||
.filter((list) => (isChannel ? list.type === 'collection' : list.type === 'playlist'))
|
||||
.map((l) => {
|
||||
const { id } = l;
|
||||
return <CollectionSelectItem collectionId={id} uri={permanentUrl} key={id} category={'builtin'} />;
|
||||
return <CollectionSelectItem claim={claim} collectionId={id} uri={permanentUrl} key={id} category={'builtin'} />;
|
||||
})}
|
||||
{unpublished &&
|
||||
(Object.values(unpublished): any)
|
||||
@@ -82,7 +88,7 @@ const ClaimCollectionAdd = (props: Props) => {
|
||||
.map((l) => {
|
||||
const { id } = l;
|
||||
return (
|
||||
<CollectionSelectItem collectionId={id} uri={permanentUrl} key={id} category={'unpublished'} />
|
||||
<CollectionSelectItem claim={claim} collectionId={id} uri={permanentUrl} key={id} category={'unpublished'} />
|
||||
);
|
||||
})}
|
||||
{published &&
|
||||
@@ -90,7 +96,7 @@ const ClaimCollectionAdd = (props: Props) => {
|
||||
// $FlowFixMe
|
||||
const { id } = l;
|
||||
return (
|
||||
<CollectionSelectItem collectionId={id} uri={permanentUrl} key={id} category={'published'} />
|
||||
<CollectionSelectItem claim={claim} collectionId={id} uri={permanentUrl} key={id} category={'published'} />
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
@@ -107,13 +113,22 @@ const ClaimCollectionAdd = (props: Props) => {
|
||||
onFocus={onTextareaFocus}
|
||||
onBlur={onTextareaBlur}
|
||||
inputButton={
|
||||
<Button
|
||||
button={'secondary'}
|
||||
icon={ICONS.ADD}
|
||||
disabled={!newCollectionName.length}
|
||||
onClick={() => handleAddCollection()}
|
||||
ref={buttonref}
|
||||
/>
|
||||
<>
|
||||
<Button
|
||||
button={'alt'}
|
||||
icon={ICONS.ADD}
|
||||
className={'button-toggle'}
|
||||
disabled={!newCollectionName.length}
|
||||
onClick={() => handleAddCollection()}
|
||||
ref={buttonref}
|
||||
/>
|
||||
<Button
|
||||
button={'alt'}
|
||||
className={'button-toggle'}
|
||||
icon={ICONS.REMOVE}
|
||||
onClick={() => handleClearNew()}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
onChange={handleNameInput}
|
||||
/>
|
||||
@@ -123,7 +138,7 @@ const ClaimCollectionAdd = (props: Props) => {
|
||||
)}
|
||||
</fieldset-section>
|
||||
<div className="card__actions">
|
||||
<Button button="secondary" label={__('Done')} onClick={closeModal} />
|
||||
<Button button="secondary" label={__('Done')} disabled={addNewCollection} onClick={closeModal} />
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ type Props = {
|
||||
livestreamMap?: { [string]: any },
|
||||
searchOptions?: any,
|
||||
collectionId?: string,
|
||||
hideLivestreamClaims?: boolean,
|
||||
};
|
||||
|
||||
export default function ClaimList(props: Props) {
|
||||
@@ -76,6 +77,7 @@ export default function ClaimList(props: Props) {
|
||||
livestreamMap,
|
||||
searchOptions,
|
||||
collectionId,
|
||||
hideLivestreamClaims,
|
||||
} = props;
|
||||
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||
@@ -135,6 +137,7 @@ export default function ClaimList(props: Props) {
|
||||
properties={renderProperties}
|
||||
live={resolveLive(index)}
|
||||
collectionId={collectionId}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
/>
|
||||
))}
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
|
||||
@@ -195,6 +198,7 @@ export default function ClaimList(props: Props) {
|
||||
showUserBlocked={showHiddenByUser}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
collectionId={collectionId}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
customShouldHide={(claim: StreamClaim) => {
|
||||
// Hack to hide spee.ch thumbnail publishes
|
||||
// If it meets these requirements, it was probably uploaded here:
|
||||
|
||||
@@ -72,7 +72,11 @@ type Props = {
|
||||
liveLivestreamsFirst?: boolean,
|
||||
livestreamMap?: { [string]: any },
|
||||
hasSource?: boolean,
|
||||
limitClaimsPerChannel?: number,
|
||||
releaseTime?: string,
|
||||
hideLivestreamClaims?: boolean,
|
||||
isChannel?: boolean,
|
||||
empty?: string,
|
||||
};
|
||||
|
||||
function ClaimListDiscover(props: Props) {
|
||||
@@ -102,8 +106,8 @@ function ClaimListDiscover(props: Props) {
|
||||
claimType,
|
||||
pageSize,
|
||||
defaultClaimType,
|
||||
streamType,
|
||||
defaultStreamType,
|
||||
streamType = CS.FILE_VIDEO,
|
||||
defaultStreamType = CS.FILE_VIDEO,
|
||||
freshness,
|
||||
defaultFreshness = CS.FRESH_WEEK,
|
||||
renderProperties,
|
||||
@@ -122,12 +126,16 @@ function ClaimListDiscover(props: Props) {
|
||||
forceShowReposts = false,
|
||||
languageSetting,
|
||||
searchInLanguage,
|
||||
limitClaimsPerChannel,
|
||||
releaseTime,
|
||||
scrollAnchor,
|
||||
showHiddenByUser = false,
|
||||
liveLivestreamsFirst,
|
||||
livestreamMap,
|
||||
hasSource,
|
||||
isChannel = false,
|
||||
hideLivestreamClaims,
|
||||
empty,
|
||||
} = props;
|
||||
const didNavigateForward = history.action === 'PUSH';
|
||||
const { search } = location;
|
||||
@@ -166,12 +174,12 @@ function ClaimListDiscover(props: Props) {
|
||||
const durationParam = urlParams.get(CS.DURATION_KEY) || null;
|
||||
const channelIdsInUrl = urlParams.get(CS.CHANNEL_IDS_KEY);
|
||||
const channelIdsParam = channelIdsInUrl ? channelIdsInUrl.split(',') : channelIds;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount || CS.FEE_AMOUNT_ONLY_FREE;
|
||||
const originalPageSize = pageSize || CS.PAGE_SIZE;
|
||||
const dynamicPageSize = isLargeScreen ? Math.ceil(originalPageSize * (3 / 2)) : originalPageSize;
|
||||
const historyAction = history.action;
|
||||
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy || orderParamEntry;
|
||||
|
||||
if (!orderParam) {
|
||||
if (historyAction === 'POP') {
|
||||
@@ -215,6 +223,7 @@ function ClaimListDiscover(props: Props) {
|
||||
fee_amount?: string,
|
||||
has_source?: boolean,
|
||||
has_no_source?: boolean,
|
||||
limit_claims_per_channel?: number,
|
||||
} = {
|
||||
page_size: dynamicPageSize,
|
||||
page,
|
||||
@@ -237,6 +246,10 @@ function ClaimListDiscover(props: Props) {
|
||||
options.has_source = true;
|
||||
}
|
||||
|
||||
if (limitClaimsPerChannel) {
|
||||
options.limit_claims_per_channel = limitClaimsPerChannel;
|
||||
}
|
||||
|
||||
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
||||
options.fee_amount = feeAmountParam;
|
||||
}
|
||||
@@ -266,7 +279,10 @@ function ClaimListDiscover(props: Props) {
|
||||
options.reposted_claim_id = repostedClaimId;
|
||||
}
|
||||
|
||||
if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
// IF release time, set it, else set fallback release times using the hack below.
|
||||
if (releaseTime) {
|
||||
options.release_time = releaseTime;
|
||||
} else if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
|
||||
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
||||
@@ -344,9 +360,25 @@ function ClaimListDiscover(props: Props) {
|
||||
|
||||
const hasMatureTags = tagsParam && tagsParam.split(',').some((t) => MATURE_TAGS.includes(t));
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
const claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
let claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
const claimSearchResultLastPageReached = claimSearchByQueryLastPageReached[claimSearchCacheQuery];
|
||||
|
||||
// uncomment to fix an item on a page
|
||||
// const fixUri = 'lbry://@corbettreport#0/lbryodysee#5';
|
||||
// if (
|
||||
// orderParam === CS.ORDER_BY_NEW &&
|
||||
// claimSearchResult &&
|
||||
// claimSearchResult.length > 2 &&
|
||||
// window.location.pathname === '/$/rabbithole'
|
||||
// ) {
|
||||
// if (claimSearchResult.indexOf(fixUri) !== -1) {
|
||||
// claimSearchResult.splice(claimSearchResult.indexOf(fixUri), 1);
|
||||
// } else {
|
||||
// claimSearchResult.pop();
|
||||
// }
|
||||
// claimSearchResult.splice(2, 0, fixUri);
|
||||
// }
|
||||
|
||||
const [prevOptions, setPrevOptions] = React.useState(null);
|
||||
|
||||
if (!isJustScrollingToNewPage(prevOptions, options)) {
|
||||
@@ -470,7 +502,7 @@ function ClaimListDiscover(props: Props) {
|
||||
claimType={claimType}
|
||||
streamType={streamType}
|
||||
defaultStreamType={defaultStreamType}
|
||||
feeAmount={feeAmount}
|
||||
// feeAmount={feeAmount}
|
||||
orderBy={orderBy}
|
||||
defaultOrderBy={defaultOrderBy}
|
||||
hideAdvancedFilter={hideAdvancedFilter}
|
||||
@@ -510,6 +542,8 @@ function ClaimListDiscover(props: Props) {
|
||||
liveLivestreamsFirst={liveLivestreamsFirst}
|
||||
livestreamMap={livestreamMap}
|
||||
searchOptions={options}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
empty={empty}
|
||||
/>
|
||||
{loading && (
|
||||
<div className="claim-grid">
|
||||
@@ -543,6 +577,8 @@ function ClaimListDiscover(props: Props) {
|
||||
liveLivestreamsFirst={liveLivestreamsFirst}
|
||||
livestreamMap={livestreamMap}
|
||||
searchOptions={options}
|
||||
hideLivestreamClaims={hideLivestreamClaims}
|
||||
empty={empty}
|
||||
/>
|
||||
{loading &&
|
||||
new Array(dynamicPageSize)
|
||||
|
||||
@@ -2,13 +2,13 @@ import { connect } from 'react-redux';
|
||||
import {
|
||||
doCollectionEdit,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectFileInfoForUri,
|
||||
doPrepareEdit,
|
||||
makeSelectCollectionForIdHasClaimUrl,
|
||||
makeSelectNameForCollectionId,
|
||||
makeSelectCollectionIsMine,
|
||||
COLLECTIONS_CONSTS,
|
||||
makeSelectFileInfoForUri,
|
||||
doPrepareEdit,
|
||||
makeSelectEditedCollectionForId,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked';
|
||||
@@ -16,34 +16,27 @@ import { doSetActiveChannel, doSetIncognito, doOpenModal } from 'redux/actions/a
|
||||
import { doCommentModBlock, doCommentModUnBlock } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsBlocked } from 'redux/selectors/comments';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { makeSelectUserPropForProp } from 'redux/selectors/user';
|
||||
|
||||
import { makeSelectSigningIsMine } from 'redux/selectors/content';
|
||||
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
||||
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
||||
import ClaimPreview from './view';
|
||||
import * as USER from 'constants/user';
|
||||
import fs from 'fs';
|
||||
|
||||
const select = (state, props) => {
|
||||
const claim = makeSelectClaimForUri(props.uri)(state);
|
||||
const claim = makeSelectClaimForUri(props.uri, false)(state);
|
||||
const permanentUri = claim && claim.permanent_url;
|
||||
return {
|
||||
claim,
|
||||
claimIsMine: props.channelIsMine
|
||||
? props.isRepost
|
||||
? makeSelectClaimIsMine(props.uri)(state)
|
||||
: true
|
||||
: makeSelectClaimIsMine(props.uri)(state),
|
||||
claimIsMine: makeSelectSigningIsMine(props.uri)(state),
|
||||
hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl(COLLECTIONS_CONSTS.WATCH_LATER_ID, permanentUri)(state),
|
||||
channelIsMuted: makeSelectChannelIsMuted(props.uri)(state),
|
||||
channelIsBlocked: makeSelectChannelIsBlocked(props.uri)(state),
|
||||
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||
isSubscribed: makeSelectIsSubscribed(props.channelUri, true)(state),
|
||||
claimInCollection: makeSelectCollectionForIdHasClaimUrl(props.collectionId, permanentUri)(state),
|
||||
collectionName: makeSelectNameForCollectionId(props.collectionId)(state),
|
||||
isMyCollection: makeSelectCollectionIsMine(props.collectionId)(state),
|
||||
hasExperimentalUi: makeSelectUserPropForProp(USER.EXPERIMENTAL_UI)(state),
|
||||
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||
isSubscribed: makeSelectIsSubscribed(props.channelUri, true)(state),
|
||||
editedCollection: makeSelectEditedCollectionForId(props.collectionId)(state),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -58,6 +51,7 @@ const perform = (dispatch) => ({
|
||||
|
||||
dispatch(doPrepareEdit(publishData, uri, fileInfo, fs));
|
||||
},
|
||||
doToast: (props) => dispatch(doToast(props)),
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
doChannelMute: (channelUri) => dispatch(doChannelMute(channelUri)),
|
||||
doChannelUnmute: (channelUri) => dispatch(doChannelUnmute(channelUri)),
|
||||
@@ -65,8 +59,7 @@ const perform = (dispatch) => ({
|
||||
doCommentModUnBlock: (channelUri) => dispatch(doCommentModUnBlock(channelUri)),
|
||||
doChannelSubscribe: (subscription) => dispatch(doChannelSubscribe(subscription)),
|
||||
doChannelUnsubscribe: (subscription) => dispatch(doChannelUnsubscribe(subscription)),
|
||||
doCollectionEdit: (id, params) => dispatch(doCollectionEdit(id, params)),
|
||||
doToast: (params) => dispatch(doToast(params)),
|
||||
doCollectionEdit: (collection, props) => dispatch(doCollectionEdit(collection, props)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimPreview);
|
||||
+112
-100
@@ -9,8 +9,7 @@ import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import { generateShareUrl } from 'util/url';
|
||||
import { useHistory } from 'react-router';
|
||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import { buildURI, parseURI } from 'lbry-redux';
|
||||
import { buildURI, parseURI, COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
|
||||
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
|
||||
const PAGE_VIEW_QUERY = `view`;
|
||||
@@ -42,13 +41,14 @@ type Props = {
|
||||
collectionId: string,
|
||||
isMyCollection: boolean,
|
||||
doToast: ({ message: string }) => void,
|
||||
hasExperimentalUi: boolean,
|
||||
claimIsMine: boolean,
|
||||
fileInfo: FileListItem,
|
||||
prepareEdit: ({}, string, {}) => void,
|
||||
isSubscribed: boolean,
|
||||
doChannelSubscribe: (SubscriptionArgs) => void,
|
||||
doChannelUnsubscribe: (SubscriptionArgs) => void,
|
||||
isChannelPage: boolean,
|
||||
editedCollection: Collection,
|
||||
};
|
||||
|
||||
function ClaimMenuList(props: Props) {
|
||||
@@ -64,23 +64,28 @@ function ClaimMenuList(props: Props) {
|
||||
channelIsBlocked,
|
||||
doCommentModBlock,
|
||||
doCommentModUnBlock,
|
||||
isRepost,
|
||||
doCollectionEdit,
|
||||
hasClaimInWatchLater,
|
||||
collectionId,
|
||||
collectionName,
|
||||
isMyCollection,
|
||||
doToast,
|
||||
hasExperimentalUi,
|
||||
claimIsMine,
|
||||
fileInfo,
|
||||
prepareEdit,
|
||||
isSubscribed,
|
||||
doChannelSubscribe,
|
||||
doChannelUnsubscribe,
|
||||
isChannelPage = false,
|
||||
editedCollection,
|
||||
} = props;
|
||||
const incognito = channelUri && !(channelUri.includes('@'));
|
||||
const repostedContent = claim && claim.reposted_claim;
|
||||
const contentClaim = repostedContent || claim;
|
||||
const incognitoClaim = channelUri && !channelUri.includes('@');
|
||||
const signingChannel = claim && (claim.signing_channel || claim);
|
||||
const isChannel = !incognito && signingChannel === claim;
|
||||
const permanentUrl = String(channelUri);
|
||||
const isChannel = !incognitoClaim && signingChannel === claim;
|
||||
const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
|
||||
const subscriptionLabel = isSubscribed ? __('Unfollow') : __('Follow');
|
||||
|
||||
@@ -88,25 +93,20 @@ function ClaimMenuList(props: Props) {
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
const channelUri = claim
|
||||
? claim.value_type === 'channel'
|
||||
? claim.permanent_url
|
||||
: (claim.signing_channel && claim.signing_channel.permanent_url) || ''
|
||||
: '';
|
||||
|
||||
const shareUrl: string = generateShareUrl(SHARE_DOMAIN, uri);
|
||||
const isCollectionClaim = claim && claim.value_type === 'collection';
|
||||
// $FlowFixMe
|
||||
const isPlayable =
|
||||
claim &&
|
||||
!claim.repost_url &&
|
||||
contentClaim &&
|
||||
// $FlowFixMe
|
||||
claim.value.stream_type &&
|
||||
contentClaim.value &&
|
||||
// $FlowFixMe
|
||||
(claim.value.stream_type === 'audio' || claim.value.stream_type === 'video');
|
||||
contentClaim.value.stream_type &&
|
||||
// $FlowFixMe
|
||||
(contentClaim.value.stream_type === 'audio' || contentClaim.value.stream_type === 'video');
|
||||
|
||||
function handleFollow() {
|
||||
const permanentUrl = signingChannel && signingChannel.permanent_url;
|
||||
const { channelName } = parseURI(permanentUrl);
|
||||
const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe;
|
||||
|
||||
@@ -117,10 +117,6 @@ function ClaimMenuList(props: Props) {
|
||||
});
|
||||
}
|
||||
|
||||
function handleAnalytics() {
|
||||
push(`/$/${PAGES.CREATOR_DASHBOARD}?channel=${encodeURIComponent(signingChannel.canonical_url)}`);
|
||||
}
|
||||
|
||||
function handleToggleMute() {
|
||||
if (channelIsMuted) {
|
||||
doChannelUnmute(channelUri);
|
||||
@@ -141,7 +137,6 @@ function ClaimMenuList(props: Props) {
|
||||
if (!isChannel) {
|
||||
const signingChannelName = signingChannel && signingChannel.name;
|
||||
|
||||
let editUri;
|
||||
const uriObject: { streamName: string, streamClaimId: string, channelName?: string } = {
|
||||
streamName: claim.name,
|
||||
streamClaimId: claim.claim_id,
|
||||
@@ -149,7 +144,7 @@ function ClaimMenuList(props: Props) {
|
||||
if (signingChannelName) {
|
||||
uriObject.channelName = signingChannelName;
|
||||
}
|
||||
editUri = buildURI(uriObject);
|
||||
const editUri = buildURI(uriObject);
|
||||
|
||||
push(`/$/${PAGES.UPLOAD}`);
|
||||
prepareEdit(claim, editUri, fileInfo);
|
||||
@@ -160,10 +155,10 @@ function ClaimMenuList(props: Props) {
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
if (!isChannel) {
|
||||
if (!isRepost && !isChannel) {
|
||||
openModal(MODALS.CONFIRM_FILE_REMOVE, { uri });
|
||||
} else {
|
||||
openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim: claim, cb: () => replace(`/$/${PAGES.CHANNELS}`) });
|
||||
openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim, cb: !isRepost && (() => replace(`/$/${PAGES.CHANNELS}`)) });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +171,8 @@ function ClaimMenuList(props: Props) {
|
||||
}
|
||||
|
||||
function handleReportContent() {
|
||||
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${claim.claim_id}`);
|
||||
// $FlowFixMe
|
||||
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${(repostedContent && repostedContent.claim_id) || claim.claim_id}`);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -191,36 +187,44 @@ function ClaimMenuList(props: Props) {
|
||||
<Icon size={20} icon={ICONS.MORE_VERTICAL} />
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list">
|
||||
{hasExperimentalUi && (
|
||||
{/* WATCH LATER */}
|
||||
<>
|
||||
{/* WATCH LATER */}
|
||||
{isPlayable && !collectionId && (
|
||||
<>
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => {
|
||||
doToast({
|
||||
message: __('Item %action% Watch Later', {
|
||||
action: hasClaimInWatchLater ? __('removed from') : __('added to'),
|
||||
}),
|
||||
});
|
||||
doCollectionEdit(COLLECTIONS_CONSTS.WATCH_LATER_ID, {
|
||||
claims: [claim],
|
||||
remove: hasClaimInWatchLater,
|
||||
type: 'playlist',
|
||||
});
|
||||
}}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} />
|
||||
{hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
)}
|
||||
{isPlayable && !collectionId && (
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => {
|
||||
doToast({
|
||||
message: __('Item %action% Watch Later', {
|
||||
action: hasClaimInWatchLater ? __('removed from') : __('added to'),
|
||||
}),
|
||||
});
|
||||
doCollectionEdit(COLLECTIONS_CONSTS.WATCH_LATER_ID, {
|
||||
claims: [contentClaim],
|
||||
remove: hasClaimInWatchLater,
|
||||
type: 'playlist',
|
||||
});
|
||||
}}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={hasClaimInWatchLater ? ICONS.DELETE : ICONS.TIME} />
|
||||
{hasClaimInWatchLater ? __('In Watch Later') : __('Watch Later')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
{/* COLLECTION OPERATIONS */}
|
||||
{collectionId && collectionName && isCollectionClaim && (
|
||||
<>
|
||||
{Boolean(editedCollection) && (
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden iconColor={'red'} icon={ICONS.PUBLISH} />
|
||||
{__('Publish')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
<MenuItem className="comment__menu-option" onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}`)}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.VIEW} />
|
||||
@@ -229,7 +233,7 @@ function ClaimMenuList(props: Props) {
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => doOpenModal(MODALS.COLLECTION_DELETE, { collectionId })}
|
||||
onSelect={() => openModal(MODALS.COLLECTION_DELETE, { collectionId })}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
@@ -242,7 +246,7 @@ function ClaimMenuList(props: Props) {
|
||||
{isPlayable && (
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => doOpenModal(MODALS.COLLECTION_ADD, { uri, type: 'playlist' })}
|
||||
onSelect={() => openModal(MODALS.COLLECTION_ADD, { uri, type: 'playlist' })}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.STACK} />
|
||||
@@ -251,67 +255,75 @@ function ClaimMenuList(props: Props) {
|
||||
</MenuItem>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<hr className="menu__separator" />
|
||||
{!incognito && (!claimIsMine ? (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleFollow}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.SUBSCRIBE} />
|
||||
{subscriptionLabel}
|
||||
</div>
|
||||
</MenuItem>
|
||||
) : (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleAnalytics}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.ANALYTICS} />
|
||||
{__('Channel Analytics')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
))}
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleSupport}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.LBC} />
|
||||
{__('Support')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
{channelUri && !claimIsMine && !isMyCollection && !incognito ? (
|
||||
{!isChannelPage && (
|
||||
<>
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleBlock}>
|
||||
<hr className="menu__separator" />
|
||||
<MenuItem className="comment__menu-option" onSelect={handleSupport}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.BLOCK} />
|
||||
{channelIsBlocked ? __('Unblock Channel') : __('Block Channel')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleMute}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.MUTE} />
|
||||
{channelIsMuted ? __('Unmute Channel') : __('Mute Channel')}
|
||||
<Icon aria-hidden icon={ICONS.LBC} />
|
||||
{__('Support')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
) : (
|
||||
)}
|
||||
|
||||
{!incognitoClaim && !isRepost && !claimIsMine && !isChannelPage && (
|
||||
<>
|
||||
<MenuItem className="comment__menu-option" onSelect={handleEdit}>
|
||||
<hr className="menu__separator" />
|
||||
<MenuItem className="comment__menu-option" onSelect={handleFollow}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.EDIT} />
|
||||
{__('Edit')}
|
||||
<Icon aria-hidden icon={ICONS.SUBSCRIBE} />
|
||||
{subscriptionLabel}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
)}
|
||||
{!isMyCollection && (
|
||||
<>
|
||||
{(!claimIsMine || channelIsBlocked) && channelUri ? (
|
||||
!incognitoClaim &&
|
||||
!isRepost && (
|
||||
<>
|
||||
<hr className="menu__separator" />
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleBlock}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.BLOCK} />
|
||||
{channelIsBlocked ? __('Unblock Channel') : __('Block Channel')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
{showDelete && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleDelete}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
{__('Delete')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleMute}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.MUTE} />
|
||||
{channelIsMuted ? __('Unmute Channel') : __('Mute Channel')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
</>
|
||||
)
|
||||
) : (
|
||||
<>
|
||||
{!isChannelPage && !isRepost && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleEdit}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.EDIT} />
|
||||
{__('Edit')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
{showDelete && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleDelete}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DELETE} />
|
||||
{__('Delete')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<hr className="menu__separator" />
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleCopyLink}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.SHARE} />
|
||||
|
||||
@@ -135,6 +135,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
isCollectionMine,
|
||||
collectionUris,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
const WrapperElement = wrapperElement || 'li';
|
||||
const shouldFetch =
|
||||
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
||||
@@ -155,14 +156,13 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
const isCollection = claim && claim.value_type === 'collection';
|
||||
const isChannelUri = isValid ? parseURI(uri).isChannel : false;
|
||||
const signingChannel = claim && claim.signing_channel;
|
||||
const channelUri = claim && (signingChannel ? signingChannel.permanent_url : claim.permanent_url);
|
||||
|
||||
let navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
|
||||
if (collectionId) {
|
||||
const collectionParams = new URLSearchParams();
|
||||
collectionParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, collectionId);
|
||||
navigateUrl = navigateUrl + `?` + collectionParams.toString();
|
||||
}
|
||||
const channelUri = claim && (signingChannel ? signingChannel.permanent_url : claim.permanent_url);
|
||||
const navLinkProps = {
|
||||
to: navigateUrl,
|
||||
onClick: (e) => e.stopPropagation(),
|
||||
@@ -352,7 +352,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
if (editCollection) {
|
||||
// $FlowFixMe
|
||||
editCollection(collectionId, {
|
||||
order: { from: collectionIndex, to: Number(collectionIndex || 0) + 1 },
|
||||
order: { from: collectionIndex, to: Number(collectionIndex) - 1 },
|
||||
});
|
||||
}
|
||||
}}
|
||||
@@ -423,7 +423,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{!hideMenu && <ClaimMenuList uri={uri} collectionId={collectionId} channelUri={channelUri} />}
|
||||
{!hideMenu && <ClaimMenuList uri={uri} collectionId={collectionId} channelUri={channelUri} isRepost={isRepost} />}
|
||||
</>
|
||||
</WrapperElement>
|
||||
);
|
||||
|
||||
@@ -44,6 +44,8 @@ type Props = {
|
||||
properties?: (Claim) => void,
|
||||
live?: boolean,
|
||||
collectionId?: string,
|
||||
hideLivestreamClaims?: boolean,
|
||||
isLivestream: boolean,
|
||||
};
|
||||
|
||||
function ClaimPreviewTile(props: Props) {
|
||||
@@ -66,6 +68,8 @@ function ClaimPreviewTile(props: Props) {
|
||||
showHiddenByUser,
|
||||
properties,
|
||||
live,
|
||||
hideLivestreamClaims,
|
||||
isLivestream,
|
||||
collectionId,
|
||||
} = props;
|
||||
const isRepost = claim && claim.repost_channel_url;
|
||||
@@ -149,7 +153,7 @@ function ClaimPreviewTile(props: Props) {
|
||||
shouldHide = blockedChannelUris.some((blockedUri) => blockedUri === claim.permanent_url);
|
||||
}
|
||||
|
||||
if (shouldHide) {
|
||||
if (shouldHide || (isLivestream && hideLivestreamClaims)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -213,7 +217,6 @@ function ClaimPreviewTile(props: Props) {
|
||||
<UriIndicator uri={uri} />
|
||||
</div>
|
||||
)}
|
||||
{/* CHECK CLAIM MENU LIST PARAMS (IS REPOST?) */}
|
||||
<ClaimMenuList uri={uri} collectionId={listId} channelUri={channelUri} isRepost={isRepost} />
|
||||
</h2>
|
||||
</NavLink>
|
||||
|
||||
@@ -37,7 +37,7 @@ export function prioritizeActiveLivestreams(
|
||||
// for that channel actually point to the same source).
|
||||
// 2. 'liveChannelIds' needs to be pruned after being accounted for,
|
||||
// otherwise all livestream-claims will be "live" (we'll only take the
|
||||
// latest one as "live").
|
||||
// latest one as "live" ).
|
||||
return (
|
||||
claim &&
|
||||
claim.value_type === 'stream' &&
|
||||
@@ -145,14 +145,14 @@ function ClaimTilesDiscover(props: Props) {
|
||||
mutedUris,
|
||||
liveLivestreamsFirst,
|
||||
livestreamMap,
|
||||
// pin,
|
||||
pin,
|
||||
prefixUris,
|
||||
} = props;
|
||||
|
||||
const { location } = useHistory();
|
||||
const urlParams = new URLSearchParams(location.search);
|
||||
const feeAmountInUrl = urlParams.get('fee_amount');
|
||||
const feeAmountParam = feeAmountInUrl || feeAmount;
|
||||
const feeAmountParam = feeAmountInUrl || feeAmount || CS.FEE_AMOUNT_ONLY_FREE;
|
||||
const mutedAndBlockedChannelIds = Array.from(new Set(mutedUris.concat(blockedUris).map((uri) => uri.split('#')[1])));
|
||||
const liveUris = [];
|
||||
|
||||
@@ -239,8 +239,8 @@ function ClaimTilesDiscover(props: Props) {
|
||||
let uris = (prefixUris || []).concat(claimSearchByQuery[mainSearchKey] || []);
|
||||
|
||||
const isLoading = fetchingClaimSearchByQuery[mainSearchKey];
|
||||
|
||||
if (liveLivestreamsFirst && livestreamMap) {
|
||||
// && !isLoading isn't on master, doesn't seem to affect the functionality, don't recall why it was added.
|
||||
if (liveLivestreamsFirst && livestreamMap && !isLoading) {
|
||||
prioritizeActiveLivestreams(uris, liveUris, livestreamMap, claimsByUri, claimSearchByQuery, options);
|
||||
}
|
||||
|
||||
@@ -284,10 +284,26 @@ function ClaimTilesDiscover(props: Props) {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const modifiedUris = uris ? uris.slice() : [];
|
||||
const fixUris = [
|
||||
'lbry://@AdrianLogan#5/why-i-talk-to-myself#3',
|
||||
];
|
||||
|
||||
if (pin && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {
|
||||
fixUris.forEach((fixUri) => {
|
||||
if (modifiedUris.indexOf(fixUri) !== -1) {
|
||||
modifiedUris.splice(modifiedUris.indexOf(fixUri), 1);
|
||||
} else {
|
||||
modifiedUris.pop();
|
||||
}
|
||||
});
|
||||
modifiedUris.splice(2, 0, ...fixUris);
|
||||
}
|
||||
|
||||
return (
|
||||
<ul className="claim-grid">
|
||||
{uris && uris.length
|
||||
? uris.map((uri, index) => (
|
||||
{modifiedUris && modifiedUris.length
|
||||
? modifiedUris.map((uri, index) => (
|
||||
<ClaimPreviewTile key={uri} uri={uri} properties={renderProperties} live={resolveLive(index)} />
|
||||
))
|
||||
: new Array(pageSize).fill(1).map((x, i) => <ClaimPreviewTile key={i} placeholder />)}
|
||||
|
||||
@@ -235,7 +235,7 @@ function CollectionForm(props: Props) {
|
||||
<>
|
||||
<div className={classnames('main--contained', { 'card--disabled': disabled })}>
|
||||
<Tabs>
|
||||
<TabList className="tabs__list--channel-page">
|
||||
<TabList className="tabs__list--collection-edit-page">
|
||||
<Tab>{__('General')}</Tab>
|
||||
<Tab>{__('Items')}</Tab>
|
||||
<Tab>{__('Credits')}</Tab>
|
||||
|
||||
@@ -37,7 +37,16 @@ function ClaimMenuList(props: Props) {
|
||||
<MenuItem className="comment__menu-option" onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}`)}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.VIEW} />
|
||||
{__('Edit List')}
|
||||
{__('View List')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
onSelect={() => push(`/$/${PAGES.LIST}/${collectionId}?view=edit`)}
|
||||
>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.PUBLISH} />
|
||||
{__('Publish List')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
|
||||
@@ -3,13 +3,13 @@ import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { NavLink, useHistory } from 'react-router-dom';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
import CollectionPreviewOverlay from 'component/collectionPreviewOverlay';
|
||||
import TruncatedText from 'component/common/truncated-text';
|
||||
import CollectionCount from './collectionCount';
|
||||
import CollectionPrivate from './collectionPrivate';
|
||||
import CollectionMenuList from 'component/collectionMenuList';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import FileThumbnail from 'component/fileThumbnail';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -141,16 +141,13 @@ function CollectionPreviewTile(props: Props) {
|
||||
return (
|
||||
<li role="link" onClick={handleClick} className={'card claim-preview--tile'}>
|
||||
<NavLink {...navLinkProps}>
|
||||
<div className={classnames('media__thumb')}>
|
||||
<FileThumbnail uri={collectionItemUrls && collectionItemUrls.length && collectionItemUrls[0]}>
|
||||
<React.Fragment>
|
||||
<div className="claim-preview__collection-wrapper">
|
||||
<CollectionPreviewOverlay collectionId={collectionId} />
|
||||
</div>
|
||||
<div className="claim-preview__claim-property-overlay">
|
||||
<CollectionCount count={collectionCount} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
<NavLink {...navLinkProps}>
|
||||
<h2 className="claim-tile__title">
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doCollectionEdit,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectCollectionForId,
|
||||
makeSelectClaimIsPending,
|
||||
makeSelectCollectionForIdHasClaimUrl,
|
||||
@@ -12,7 +11,6 @@ const select = (state, props) => {
|
||||
return {
|
||||
collection: makeSelectCollectionForId(props.collectionId)(state),
|
||||
hasClaim: makeSelectCollectionForIdHasClaimUrl(props.collectionId, props.uri)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
collectionPending: makeSelectClaimIsPending(props.collectionId)(state),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -4,7 +4,13 @@ import CollectionPreviewTile from 'component/collectionPreviewTile';
|
||||
import ClaimList from 'component/claimList';
|
||||
import Button from 'component/button';
|
||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import Yrbl from 'component/yrbl';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import Card from 'component/common/card';
|
||||
import classnames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
builtinCollections: CollectionGroup,
|
||||
@@ -30,6 +36,20 @@ export default function CollectionsListMine(props: Props) {
|
||||
const watchLater = builtinCollectionsList.find((list) => list.id === COLLECTIONS_CONSTS.WATCH_LATER_ID);
|
||||
const favorites = builtinCollectionsList.find((list) => list.id === COLLECTIONS_CONSTS.FAVORITES_ID);
|
||||
const builtin = [watchLater, favorites];
|
||||
const [showHelp, setShowHelp] = usePersistedState('livestream-help-seen', true);
|
||||
|
||||
const helpText = (
|
||||
<div className="section__subtitle">
|
||||
<p>{__(`Everyone starts with 2 private lists - Watch Later and Favorites.`)}</p>
|
||||
<p>{__(`Add content to existing lists or new lists from content pages or content previews.`)}</p>
|
||||
<p>
|
||||
{__(
|
||||
`By default, lists are private. You can edit them and later publish them from the Lists page or the Publish context menu on this page. Similar to uploads, small blockchain fees apply.`
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{builtin.map((list: Collection) => {
|
||||
@@ -44,16 +64,18 @@ export default function CollectionsListMine(props: Props) {
|
||||
className="claim-grid__title"
|
||||
button="link"
|
||||
navigate={`/$/${PAGES.LIST}/${list.id}`}
|
||||
label={list.name}
|
||||
label={
|
||||
<span className="claim-grid__title-span">
|
||||
{list.name}
|
||||
<div className="claim-grid__title--empty">
|
||||
<Icon className="icon--margin-right" icon={ICONS.STACK} />
|
||||
{itemUrls.length}
|
||||
</div>
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
</h1>
|
||||
<ClaimList
|
||||
tileLayout
|
||||
key={list.name}
|
||||
uris={itemUrls}
|
||||
collectionId={list.id}
|
||||
empty={__('Nothing in %collection_name%', { collection_name: list.name })}
|
||||
/>
|
||||
<ClaimList tileLayout key={list.name} uris={itemUrls.slice(0, 6)} collectionId={list.id} />
|
||||
</>
|
||||
)}
|
||||
{!(itemUrls && itemUrls.length) && (
|
||||
@@ -66,13 +88,28 @@ export default function CollectionsListMine(props: Props) {
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
{Boolean(hasCollections) && (
|
||||
<div className="claim-grid__wrapper">
|
||||
<h1 className="claim-grid__header">
|
||||
<span className="claim-grid__title">{__('Playlists')}</span>
|
||||
<div className="claim-grid__wrapper">
|
||||
<div className="claim-grid__header claim-grid__header--between section">
|
||||
<h1 className="claim-grid__title">
|
||||
{__('Playlists')}
|
||||
{!hasCollections && <div className="claim-grid__title--empty">(Empty)</div>}
|
||||
</h1>
|
||||
|
||||
<>
|
||||
<Button button="link" onClick={() => setShowHelp(!showHelp)} label={__('How does this work?')} />
|
||||
</div>
|
||||
{showHelp && (
|
||||
<Card
|
||||
titleActions={<Button button="close" icon={ICONS.REMOVE} onClick={() => setShowHelp(false)} />}
|
||||
title={__('Introducing Lists')}
|
||||
actions={helpText}
|
||||
/>
|
||||
)}
|
||||
{Boolean(hasCollections) && (
|
||||
<div
|
||||
className={classnames({
|
||||
section: showHelp,
|
||||
})}
|
||||
>
|
||||
{/* TODO: fix above spacing hack */}
|
||||
<div className="claim-grid">
|
||||
{unpublishedCollectionsList &&
|
||||
unpublishedCollectionsList.length > 0 &&
|
||||
@@ -83,9 +120,22 @@ export default function CollectionsListMine(props: Props) {
|
||||
publishedList.length > 0 &&
|
||||
publishedList.map((key) => <CollectionPreviewTile tileLayout collectionId={key} key={key} />)}
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{!hasCollections && (
|
||||
<div className="main--empty">
|
||||
<Yrbl
|
||||
type={'sad'}
|
||||
title={__('You have no lists yet. Better start hoarding!')}
|
||||
// actions={
|
||||
// <div className="section__actions">
|
||||
// <Button button="primary" label={__('View Content')} onClick={() => setViewBlockedChannel(true)} />
|
||||
// </div>
|
||||
// }
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -31,11 +31,15 @@ type Props = {
|
||||
isReply: boolean,
|
||||
activeChannel: string,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
livestream?: boolean,
|
||||
bottom: boolean,
|
||||
onSubmit: (string, string) => void,
|
||||
livestream: boolean,
|
||||
embed?: boolean,
|
||||
toast: (string) => void,
|
||||
claimIsMine: boolean,
|
||||
sendTip: ({}, (any) => void, (any) => void) => void,
|
||||
justCommented: Array<string>,
|
||||
commentingEnabled: boolean,
|
||||
};
|
||||
|
||||
export function CommentCreate(props: Props) {
|
||||
@@ -50,10 +54,14 @@ export function CommentCreate(props: Props) {
|
||||
isReply,
|
||||
parentId,
|
||||
activeChannelClaim,
|
||||
onSubmit,
|
||||
bottom,
|
||||
livestream,
|
||||
embed,
|
||||
toast,
|
||||
claimIsMine,
|
||||
sendTip,
|
||||
commentingEnabled,
|
||||
justCommented,
|
||||
} = props;
|
||||
const buttonref: ElementRef<any> = React.useRef();
|
||||
@@ -62,6 +70,8 @@ export function CommentCreate(props: Props) {
|
||||
location: { pathname },
|
||||
} = useHistory();
|
||||
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
||||
const [commentFailure, setCommentFailure] = React.useState(false);
|
||||
const [successTip, setSuccessTip] = React.useState({ txid: undefined, tipAmount: undefined });
|
||||
const { claim_id: claimId } = claim;
|
||||
const [isSupportComment, setIsSupportComment] = React.useState();
|
||||
const [isReviewingSupportComment, setIsReviewingSupportComment] = React.useState();
|
||||
@@ -86,7 +96,7 @@ export function CommentCreate(props: Props) {
|
||||
|
||||
function altEnterListener(e: SyntheticKeyboardEvent<*>) {
|
||||
const KEYCODE_ENTER = 13;
|
||||
if ((e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) {
|
||||
if ((livestream || e.ctrlKey || e.metaKey) && e.keyCode === KEYCODE_ENTER) {
|
||||
e.preventDefault();
|
||||
buttonref.current.click();
|
||||
}
|
||||
@@ -120,6 +130,13 @@ export function CommentCreate(props: Props) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (commentFailure && tipAmount === successTip.tipAmount) {
|
||||
handleCreateComment(successTip.txid);
|
||||
return;
|
||||
} else {
|
||||
setSuccessTip({ txid: undefined, tipAmount: undefined });
|
||||
}
|
||||
|
||||
const params = {
|
||||
amount: tipAmount,
|
||||
claim_id: claimId,
|
||||
@@ -135,6 +152,7 @@ export function CommentCreate(props: Props) {
|
||||
setTimeout(() => {
|
||||
handleCreateComment(txid);
|
||||
}, 1500);
|
||||
setSuccessTip({ txid, tipAmount });
|
||||
},
|
||||
() => {
|
||||
setIsSubmitting(false);
|
||||
@@ -153,8 +171,13 @@ export function CommentCreate(props: Props) {
|
||||
setLastCommentTime(Date.now());
|
||||
setIsReviewingSupportComment(false);
|
||||
setIsSupportComment(false);
|
||||
setCommentFailure(false);
|
||||
justCommented.push(res.comment_id);
|
||||
|
||||
if (onSubmit) {
|
||||
onSubmit(commentValue, activeChannelClaim.name);
|
||||
}
|
||||
|
||||
if (onDoneReplying) {
|
||||
onDoneReplying();
|
||||
}
|
||||
@@ -162,6 +185,7 @@ export function CommentCreate(props: Props) {
|
||||
})
|
||||
.catch(() => {
|
||||
setIsSubmitting(false);
|
||||
setCommentFailure(true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -169,11 +193,16 @@ export function CommentCreate(props: Props) {
|
||||
setAdvancedEditor(!advancedEditor);
|
||||
}
|
||||
|
||||
if (!hasChannels) {
|
||||
if (!commentingEnabled || !hasChannels) {
|
||||
return (
|
||||
<div
|
||||
role="button"
|
||||
onClick={() => {
|
||||
if (embed) {
|
||||
window.open(`https://odysee.com/$/${PAGES.AUTH}?redirect=/$/${PAGES.LIVESTREAM}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const pathPlusRedirect = `/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`;
|
||||
if (livestream) {
|
||||
window.open(pathPlusRedirect);
|
||||
@@ -212,7 +241,7 @@ export function CommentCreate(props: Props) {
|
||||
autoFocus
|
||||
button="primary"
|
||||
disabled={disabled}
|
||||
label={isSubmitting ? __('Sending...') : __('Send')}
|
||||
label={isSubmitting ? __('Sending...') : (commentFailure && tipAmount === successTip.tipAmount) ? __('Re-submit') : __('Send')}
|
||||
onClick={handleSupportComment}
|
||||
/>
|
||||
<Button button="link" label={__('Cancel')} onClick={() => setIsReviewingSupportComment(false)} />
|
||||
@@ -227,6 +256,7 @@ export function CommentCreate(props: Props) {
|
||||
className={classnames('comment__create', {
|
||||
'comment__create--reply': isReply,
|
||||
'comment__create--nested-reply': isNested,
|
||||
'comment__create--bottom': bottom,
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function CommentReactions(props: Props) {
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
title={__('Upvote')}
|
||||
icon={ICONS.UPVOTE}
|
||||
icon={myReacts.includes(REACTION_TYPES.LIKE) ? ICONS.FIRE_ACTIVE : ICONS.FIRE}
|
||||
className={classnames('comment__action', {
|
||||
'comment__action--active': myReacts && myReacts.includes(REACTION_TYPES.LIKE),
|
||||
})}
|
||||
@@ -87,7 +87,7 @@ export default function CommentReactions(props: Props) {
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
title={__('Downvote')}
|
||||
icon={ICONS.DOWNVOTE}
|
||||
icon={myReacts.includes(REACTION_TYPES.DISLIKE) ? ICONS.SLIME_ACTIVE : ICONS.SLIME}
|
||||
className={classnames('comment__action', {
|
||||
'comment__action--active': myReacts && myReacts.includes(REACTION_TYPES.DISLIKE),
|
||||
})}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
import React from 'react';
|
||||
import debounce from 'util/debounce';
|
||||
|
||||
const DEBOUNCE_SCROLL_HANDLER_MS = 300;
|
||||
const DEBOUNCE_SCROLL_HANDLER_MS = 25;
|
||||
|
||||
type Props = {
|
||||
children: any,
|
||||
lastUpdateDate?: any,
|
||||
skipWait?: boolean,
|
||||
placeholder?: any,
|
||||
};
|
||||
|
||||
export default function WaitUntilOnPage(props: Props) {
|
||||
@@ -15,21 +15,17 @@ export default function WaitUntilOnPage(props: Props) {
|
||||
const [shouldRender, setShouldRender] = React.useState(false);
|
||||
|
||||
React.useEffect(() => {
|
||||
setShouldRender(false);
|
||||
}, [props.lastUpdateDate]);
|
||||
|
||||
React.useEffect(() => {
|
||||
const handleDisplayingRef = debounce(e => {
|
||||
const handleDisplayingRef = debounce((e) => {
|
||||
const element = ref && ref.current;
|
||||
if (element) {
|
||||
const bounding = element.getBoundingClientRect();
|
||||
if (
|
||||
bounding.top >= 0 &&
|
||||
bounding.left >= 0 &&
|
||||
bounding.bottom >= 0 &&
|
||||
bounding.right >= 0 &&
|
||||
// $FlowFixMe
|
||||
bounding.right <= (window.innerWidth || document.documentElement.clientWidth) &&
|
||||
bounding.top <= (window.innerHeight || document.documentElement.clientHeight) &&
|
||||
// $FlowFixMe
|
||||
bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight)
|
||||
bounding.left <= (window.innerWidth || document.documentElement.clientWidth)
|
||||
) {
|
||||
setShouldRender(true);
|
||||
}
|
||||
@@ -46,5 +42,12 @@ export default function WaitUntilOnPage(props: Props) {
|
||||
}
|
||||
}, [ref, setShouldRender, shouldRender]);
|
||||
|
||||
return <div ref={ref}>{(props.skipWait || shouldRender) && props.children}</div>;
|
||||
const render = props.skipWait || shouldRender;
|
||||
|
||||
return (
|
||||
<div ref={ref}>
|
||||
{render && props.children}
|
||||
{!render && props.placeholder !== undefined && props.placeholder}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -9,14 +9,12 @@ import {
|
||||
makeSelectTagInClaimOrChannelForUri,
|
||||
} from 'lbry-redux';
|
||||
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
||||
import { makeSelectUserPropForProp } from 'redux/selectors/user';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { doOpenModal, doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
|
||||
import fs from 'fs';
|
||||
import FileActions from './view';
|
||||
import * as USER from 'constants/user';
|
||||
import { makeSelectFileRenderModeForUri } from 'redux/selectors/content';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -28,7 +26,6 @@ const select = (state, props) => ({
|
||||
myChannels: selectMyChannelClaims(state),
|
||||
isLivestreamClaim: makeSelectClaimIsStreamPlaceholder(props.uri)(state),
|
||||
reactionsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
|
||||
hasExperimentalUi: makeSelectUserPropForProp(USER.EXPERIMENTAL_UI)(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// @flow
|
||||
import { SITE_NAME, ENABLE_FILE_REACTIONS } from 'config';
|
||||
import { SIMPLE_SITE, SITE_NAME, ENABLE_FILE_REACTIONS } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import FileDownloadLink from 'component/fileDownloadLink';
|
||||
import { buildURI } from 'lbry-redux';
|
||||
import { buildURI, COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
import * as RENDER_MODES from 'constants/file_render_modes';
|
||||
import { useIsMobile } from 'effects/use-screensize';
|
||||
import ClaimSupportButton from 'component/claimSupportButton';
|
||||
@@ -26,9 +26,9 @@ type Props = {
|
||||
myChannels: ?Array<ChannelClaim>,
|
||||
doToast: ({ message: string }) => void,
|
||||
clearPlayingUri: () => void,
|
||||
hideRepost?: boolean,
|
||||
isLivestreamClaim: boolean,
|
||||
reactionsDisabled: boolean,
|
||||
hasExperimentalUi: boolean,
|
||||
};
|
||||
|
||||
function FileActions(props: Props) {
|
||||
@@ -44,13 +44,13 @@ function FileActions(props: Props) {
|
||||
myChannels,
|
||||
clearPlayingUri,
|
||||
doToast,
|
||||
hideRepost,
|
||||
isLivestreamClaim,
|
||||
reactionsDisabled,
|
||||
hasExperimentalUi,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
location: { pathname },
|
||||
location: { pathname, search },
|
||||
} = useHistory();
|
||||
const isMobile = useIsMobile();
|
||||
const webShareable = costInfo && costInfo.cost === 0 && RENDER_MODES.WEB_SHAREABLE_MODES.includes(renderMode);
|
||||
@@ -75,6 +75,9 @@ function FileActions(props: Props) {
|
||||
editUri = buildURI(uriObject);
|
||||
}
|
||||
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const collectionId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID);
|
||||
|
||||
function handleRepostClick() {
|
||||
if (!hasChannels) {
|
||||
clearPlayingUri();
|
||||
@@ -87,33 +90,35 @@ function FileActions(props: Props) {
|
||||
|
||||
const lhsSection = (
|
||||
<>
|
||||
{ENABLE_FILE_REACTIONS && !reactionsDisabled && <FileReactions uri={uri} />}
|
||||
{ENABLE_FILE_REACTIONS && !reactionsDisabled && <FileReactions uri={uri} livestream={isLivestreamClaim} />}
|
||||
<ClaimSupportButton uri={uri} fileAction />
|
||||
{hasExperimentalUi && <ClaimCollectionAddButton uri={uri} fileAction />}
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={handleRepostClick}
|
||||
/>
|
||||
<ClaimCollectionAddButton uri={uri} fileAction />
|
||||
{!hideRepost && (
|
||||
<Button
|
||||
button="alt"
|
||||
className="button--file-action"
|
||||
icon={ICONS.REPOST}
|
||||
label={
|
||||
claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost')
|
||||
}
|
||||
description={__('Repost')}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={handleRepostClick}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
className="button--file-action"
|
||||
icon={ICONS.SHARE}
|
||||
label={__('Share')}
|
||||
label={isMobile ? undefined : __('Share')}
|
||||
title={__('Share')}
|
||||
onClick={() => openModal(MODALS.SOCIAL_SHARE, { uri, webShareable })}
|
||||
onClick={() => openModal(MODALS.SOCIAL_SHARE, { uri, webShareable, collectionId })}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
const rhsSection = (
|
||||
<>
|
||||
<FileDownloadLink uri={uri} />
|
||||
{!SIMPLE_SITE && <FileDownloadLink uri={uri} />}
|
||||
|
||||
{claimIsMine && (
|
||||
<Button
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import * as REACTION_TYPES from 'constants/reactions';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
@@ -15,18 +16,44 @@ type Props = {
|
||||
likeCount: number,
|
||||
dislikeCount: number,
|
||||
myReaction: ?string,
|
||||
livestream?: boolean,
|
||||
};
|
||||
|
||||
function FileReactions(props: Props) {
|
||||
const { claim, uri, doFetchReactions, doReactionLike, doReactionDislike, likeCount, dislikeCount } = props;
|
||||
const {
|
||||
claim,
|
||||
uri,
|
||||
doFetchReactions,
|
||||
doReactionLike,
|
||||
doReactionDislike,
|
||||
myReaction,
|
||||
likeCount,
|
||||
dislikeCount,
|
||||
livestream,
|
||||
} = props;
|
||||
const claimId = claim && claim.claim_id;
|
||||
const channel = claim && claim.signing_channel && claim.signing_channel.name;
|
||||
const isCollection = claim && claim.value_type === 'collection'; // hack because nudge gets cut off by card on cols.
|
||||
React.useEffect(() => {
|
||||
if (claimId) {
|
||||
function fetchReactions() {
|
||||
doFetchReactions(claimId);
|
||||
}
|
||||
}, [claimId, doFetchReactions]);
|
||||
|
||||
let fetchInterval;
|
||||
if (claimId) {
|
||||
fetchReactions();
|
||||
|
||||
if (livestream) {
|
||||
fetchInterval = setInterval(fetchReactions, 45000);
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (fetchInterval) {
|
||||
clearInterval(fetchInterval);
|
||||
}
|
||||
};
|
||||
}, [claimId, doFetchReactions, livestream]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -41,20 +68,46 @@ function FileReactions(props: Props) {
|
||||
title={__('I like this')}
|
||||
requiresAuth={IS_WEB}
|
||||
authSrc="filereaction_like"
|
||||
className={classnames('button--file-action')}
|
||||
label={formatNumberWithCommas(likeCount, 0)}
|
||||
className={classnames('button--file-action', { 'button--fire': myReaction === REACTION_TYPES.LIKE })}
|
||||
label={
|
||||
<>
|
||||
{myReaction === REACTION_TYPES.LIKE && (
|
||||
<>
|
||||
<div className="button__fire-glow" />
|
||||
<div className="button__fire-particle1" />
|
||||
<div className="button__fire-particle2" />
|
||||
<div className="button__fire-particle3" />
|
||||
<div className="button__fire-particle4" />
|
||||
<div className="button__fire-particle5" />
|
||||
<div className="button__fire-particle6" />
|
||||
</>
|
||||
)}
|
||||
{formatNumberWithCommas(likeCount, 0)}
|
||||
</>
|
||||
}
|
||||
iconSize={18}
|
||||
icon={ICONS.UPVOTE}
|
||||
icon={myReaction === REACTION_TYPES.LIKE ? ICONS.FIRE_ACTIVE : ICONS.FIRE}
|
||||
onClick={() => doReactionLike(uri)}
|
||||
/>
|
||||
<Button
|
||||
requiresAuth={IS_WEB}
|
||||
authSrc={'filereaction_dislike'}
|
||||
title={__('I dislike this')}
|
||||
className={classnames('button--file-action')}
|
||||
label={formatNumberWithCommas(dislikeCount, 0)}
|
||||
className={classnames('button--file-action', { 'button--slime': myReaction === REACTION_TYPES.DISLIKE })}
|
||||
label={
|
||||
<>
|
||||
{myReaction === REACTION_TYPES.DISLIKE && (
|
||||
<>
|
||||
<div className="button__slime-stain" />
|
||||
<div className="button__slime-drop1" />
|
||||
<div className="button__slime-drop2" />
|
||||
</>
|
||||
)}
|
||||
{formatNumberWithCommas(dislikeCount, 0)}
|
||||
</>
|
||||
}
|
||||
iconSize={18}
|
||||
icon={ICONS.DOWNVOTE}
|
||||
icon={myReaction === REACTION_TYPES.DISLIKE ? ICONS.SLIME_ACTIVE : ICONS.SLIME}
|
||||
onClick={() => doReactionDislike(uri)}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -21,8 +21,8 @@ function FileSubtitle(props: Props) {
|
||||
|
||||
<FileViewCount uri={uri} livestream={livestream} activeViewers={activeViewers} isLive={isLive} />
|
||||
</div>
|
||||
|
||||
<FileActions uri={uri} />
|
||||
{/* did I need these params? */}
|
||||
<FileActions uri={uri} hideRepost={livestream} livestream={livestream} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import type { Node } from 'react';
|
||||
import useLazyLoading from 'effects/use-lazy-loading';
|
||||
|
||||
type Props = {
|
||||
thumb: string,
|
||||
children?: Node,
|
||||
};
|
||||
|
||||
const Thumb = (props: Props) => {
|
||||
const { thumb, children } = props;
|
||||
const thumbnailRef = React.useRef(null);
|
||||
useLazyLoading(thumbnailRef);
|
||||
|
||||
return (
|
||||
<div ref={thumbnailRef} data-background-image={thumb} className={classnames('media__thumb')}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Thumb;
|
||||
@@ -5,7 +5,7 @@ import React from 'react';
|
||||
import FreezeframeWrapper from './FreezeframeWrapper';
|
||||
import Placeholder from './placeholder.png';
|
||||
import classnames from 'classnames';
|
||||
import useLazyLoading from 'effects/use-lazy-loading';
|
||||
import Thumb from './thumb';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -24,7 +24,6 @@ function FileThumbnail(props: Props) {
|
||||
uri && claim && claim.value && claim.value.thumbnail ? claim.value.thumbnail.url : undefined;
|
||||
const thumbnail = passedThumbnail || thumbnailFromClaim;
|
||||
const hasResolvedClaim = claim !== undefined;
|
||||
const thumbnailRef = React.useRef(null);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!hasResolvedClaim && uri) {
|
||||
@@ -32,8 +31,6 @@ function FileThumbnail(props: Props) {
|
||||
}
|
||||
}, [hasResolvedClaim, uri, doResolveUri]);
|
||||
|
||||
useLazyLoading(thumbnailRef);
|
||||
|
||||
if (!allowGifs && thumbnail && thumbnail.endsWith('gif')) {
|
||||
return (
|
||||
<FreezeframeWrapper src={thumbnail} className={classnames('media__thumb', className)}>
|
||||
@@ -52,23 +49,11 @@ function FileThumbnail(props: Props) {
|
||||
|
||||
const thumnailUrl = url ? url.replace(/'/g, "\\'") : '';
|
||||
|
||||
if (!hasResolvedClaim) {
|
||||
return (
|
||||
<div
|
||||
ref={thumbnailRef}
|
||||
data-background-image={thumnailUrl}
|
||||
className={classnames('media__thumb', className, {
|
||||
'media__thumb--resolving': !hasResolvedClaim,
|
||||
})}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
if (hasResolvedClaim || thumnailUrl) {
|
||||
return <Thumb thumb={thumnailUrl}>{children}</Thumb>;
|
||||
}
|
||||
return (
|
||||
<div
|
||||
ref={thumbnailRef}
|
||||
data-background-image={thumnailUrl}
|
||||
className={classnames('media__thumb', className, {
|
||||
'media__thumb--resolving': !hasResolvedClaim,
|
||||
})}
|
||||
|
||||
@@ -10,7 +10,6 @@ import * as ICONS from 'constants/icons';
|
||||
import Icon from 'component/common/icon';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import Button from 'component/button';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import FileDescription from 'component/fileDescription';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
|
||||
@@ -65,17 +64,16 @@ function FileTitleSection(props: Props) {
|
||||
<div className="main--empty">
|
||||
<h2>
|
||||
<Icon className="icon--hidden" icon={ICONS.EYE_OFF} />
|
||||
{__('Mature content blocked.')}
|
||||
{__('Mature content is not supported on Odysee.')}
|
||||
</h2>
|
||||
<div>
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
content_settings: (
|
||||
<Button button="link" label={__('content settings')} navigate={`/$/${PAGES.SETTINGS}`} />
|
||||
),
|
||||
download_url: <Button label={__('lbry.com')} button="link" href="https://lbry.com/get" />,
|
||||
}}
|
||||
>
|
||||
Change this in your %content_settings%.
|
||||
You can download the LBRY Desktop or Android app on %download_url% and enable mature content in
|
||||
Settings.
|
||||
</I18nMessage>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,8 @@ import FilePrice from 'component/filePrice';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { withRouter } from 'react-router';
|
||||
import { URL } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import OdyseeLogo from 'component/header/odysee_logo.png';
|
||||
import OdyseeLogoWithText from 'component/header/odysee_white.png';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -36,7 +37,10 @@ function FileViewerEmbeddedTitle(props: Props) {
|
||||
{...contentLinkProps}
|
||||
/>
|
||||
<div className="file-viewer__embedded-info">
|
||||
<Button className="file-viewer__overlay-logo" icon={ICONS.LBRY} aria-label={__('Home')} {...lbryLinkProps} />
|
||||
<Button className="file-viewer__overlay-logo" aria-label={__('Home')} {...lbryLinkProps}>
|
||||
<img src={OdyseeLogo} className=" mobile-only" />
|
||||
<img src={OdyseeLogoWithText} className=" mobile-hidden" />
|
||||
</Button>
|
||||
{isInApp && <FilePrice uri={uri} />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
import { LOGO_TITLE, ENABLE_NO_SOURCE_CLAIMS, CHANNEL_STAKED_LEVEL_LIVESTREAM } from 'config';
|
||||
import { ENABLE_NO_SOURCE_CLAIMS, CHANNEL_STAKED_LEVEL_LIVESTREAM } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
import * as PAGES from 'constants/pages';
|
||||
@@ -19,6 +19,8 @@ import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import { remote } from 'electron';
|
||||
import { IS_MAC } from 'component/app/view';
|
||||
// @endif
|
||||
import OdyseeLogoWithWhiteText from './odysee_white.png';
|
||||
import OdyseeLogoWithText from './odysee.png';
|
||||
|
||||
type Props = {
|
||||
user: ?User,
|
||||
@@ -87,8 +89,8 @@ const Header = (props: Props) => {
|
||||
sidebarOpen,
|
||||
setSidebarOpen,
|
||||
isAbsoluteSideNavHidden,
|
||||
user,
|
||||
hideCancel,
|
||||
user,
|
||||
activeChannelClaim,
|
||||
activeChannelStakedLevel,
|
||||
} = props;
|
||||
@@ -100,7 +102,7 @@ const Header = (props: Props) => {
|
||||
const isPwdResetPage = history.location.pathname.includes(PAGES.AUTH_PASSWORD_RESET);
|
||||
const hasBackout = Boolean(backout);
|
||||
const { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
|
||||
const notificationsEnabled = (user && user.experimental_ui) || false;
|
||||
// const notificationsEnabled = (user && user.experimental_ui) || false;
|
||||
const livestreamEnabled = Boolean(
|
||||
ENABLE_NO_SOURCE_CLAIMS &&
|
||||
user &&
|
||||
@@ -240,19 +242,12 @@ const Header = (props: Props) => {
|
||||
icon={ICONS.MENU}
|
||||
onClick={() => setSidebarOpen(!sidebarOpen)}
|
||||
>
|
||||
{isAbsoluteSideNavHidden && isMobile && notificationsEnabled && <NotificationBubble />}
|
||||
{isAbsoluteSideNavHidden && isMobile && <NotificationBubble />}
|
||||
</Button>
|
||||
</span>
|
||||
)}
|
||||
<Button
|
||||
className="header__navigation-item header__navigation-item--lbry"
|
||||
// @if TARGET='app'
|
||||
label={'LBRY'}
|
||||
// @endif
|
||||
// @if TARGET='web'
|
||||
label={LOGO_TITLE} // eslint-disable-line
|
||||
// @endif
|
||||
icon={ICONS.LBRY}
|
||||
className="header__navigation-item header__navigation-item--lbry header__navigation-item--button-mobile"
|
||||
onClick={() => {
|
||||
if (history.location.pathname === '/') window.location.reload();
|
||||
}}
|
||||
@@ -262,7 +257,12 @@ const Header = (props: Props) => {
|
||||
}}
|
||||
// @endif
|
||||
{...homeButtonNavigationProps}
|
||||
/>
|
||||
>
|
||||
<img
|
||||
src={currentTheme === 'light' ? OdyseeLogoWithText : OdyseeLogoWithWhiteText}
|
||||
className="header__odysee"
|
||||
/>
|
||||
</Button>
|
||||
|
||||
{!authHeader && (
|
||||
<div className="header__center">
|
||||
@@ -279,7 +279,7 @@ const Header = (props: Props) => {
|
||||
|
||||
<HeaderMenuButtons
|
||||
authenticated={authenticated}
|
||||
notificationsEnabled={notificationsEnabled}
|
||||
notificationsEnabled
|
||||
history={history}
|
||||
handleThemeToggle={handleThemeToggle}
|
||||
currentTheme={currentTheme}
|
||||
@@ -432,6 +432,10 @@ function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
||||
<Icon aria-hidden icon={ICONS.CHANNEL} />
|
||||
{__('New Channel')}
|
||||
</MenuItem>
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.YOUTUBE_SYNC}`)}>
|
||||
<Icon aria-hidden icon={ICONS.YOUTUBE} />
|
||||
{__('Sync YouTube Channel')}
|
||||
</MenuItem>
|
||||
|
||||
{livestreamEnabled && (
|
||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.LIVESTREAM}`)}>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import LivestreamFeed from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(LivestreamFeed);
|
||||
@@ -0,0 +1,38 @@
|
||||
// @flow
|
||||
import { BITWAVE_USERNAME, BITWAVE_EMBED_URL } from 'constants/livestream';
|
||||
import React from 'react';
|
||||
import FileTitleSection from 'component/fileTitleSection';
|
||||
import LivestreamComments from 'component/livestreamComments';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?StreamClaim,
|
||||
activeViewers: number,
|
||||
};
|
||||
|
||||
export default function LivestreamFeed(props: Props) {
|
||||
const { claim, uri, activeViewers } = props;
|
||||
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="section card-stack">
|
||||
<div className="file-render file-render--video livestream">
|
||||
<div className="file-viewer">
|
||||
<iframe
|
||||
src={`${BITWAVE_EMBED_URL}/${BITWAVE_USERNAME}?skin=odysee&autoplay=1`}
|
||||
scrolling="no"
|
||||
allowFullScreen
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FileTitleSection uri={uri} livestream activeViewers={activeViewers} />
|
||||
</div>
|
||||
<LivestreamComments uri={uri} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -17,7 +17,7 @@ export default function LivestreamLink(props: Props) {
|
||||
const { push } = useHistory();
|
||||
const [livestreamClaim, setLivestreamClaim] = React.useState(false);
|
||||
const [isLivestreaming, setIsLivestreaming] = React.useState(false);
|
||||
const livestreamChannelId = channelClaim.claim_id || ''; // TODO: fail in a safer way, probably
|
||||
const livestreamChannelId = (channelClaim && channelClaim.claim_id) || ''; // TODO: fail in a safer way, probably
|
||||
|
||||
React.useEffect(() => {
|
||||
if (livestreamChannelId) {
|
||||
@@ -29,7 +29,7 @@ export default function LivestreamLink(props: Props) {
|
||||
})
|
||||
.then((res) => {
|
||||
if (res && res.items && res.items.length > 0) {
|
||||
const claim = res.items[res.items.length - 1];
|
||||
const claim = res.items[0];
|
||||
setLivestreamClaim(claim);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,14 +5,12 @@ import classnames from 'classnames';
|
||||
type Props = {
|
||||
unseenCount: number,
|
||||
inline: boolean,
|
||||
user: ?User,
|
||||
};
|
||||
|
||||
export default function NotificationHeaderButton(props: Props) {
|
||||
const { unseenCount, inline = false, user } = props;
|
||||
const notificationsEnabled = user && user.experimental_ui;
|
||||
const { unseenCount, inline = false } = props;
|
||||
|
||||
if (unseenCount === 0 || !notificationsEnabled) {
|
||||
if (unseenCount === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,8 @@ export default function NotificationHeaderButton(props: Props) {
|
||||
// notifications,
|
||||
// fetching,
|
||||
doSeeAllNotifications,
|
||||
user,
|
||||
// user,
|
||||
} = props;
|
||||
const notificationsEnabled = user && user.experimental_ui;
|
||||
const { push } = useHistory();
|
||||
|
||||
function handleMenuClick() {
|
||||
@@ -32,10 +31,6 @@ export default function NotificationHeaderButton(props: Props) {
|
||||
push(`/$/${PAGES.NOTIFICATIONS}`);
|
||||
}
|
||||
|
||||
if (!notificationsEnabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
onClick={handleMenuClick}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React, { Fragment } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import SideNavigation from 'component/sideNavigation';
|
||||
@@ -21,7 +22,6 @@ type Props = {
|
||||
isUpgradeAvailable: boolean,
|
||||
authPage: boolean,
|
||||
filePage: boolean,
|
||||
homePage: boolean,
|
||||
noHeader: boolean,
|
||||
noFooter: boolean,
|
||||
noSideNavigation: boolean,
|
||||
|
||||
@@ -65,7 +65,7 @@ export default function PreviewOverlayProperties(props: Props) {
|
||||
{isCollection && claim && !iconOnly && <div>{claimCount}</div>}
|
||||
{!iconOnly && isStream && <VideoDuration uri={uri} />}
|
||||
{isStream && <FileType uri={uri} small={small} />}
|
||||
{isSubscribed && <Icon tooltip size={size} icon={ICONS.SUBSCRIBE} />}
|
||||
{isSubscribed && !isCollection && <Icon tooltip size={size} icon={ICONS.SUBSCRIBE} />}
|
||||
{!claimIsMine && downloaded && <Icon size={size} tooltip icon={ICONS.LIBRARY} />}
|
||||
<FilePrice hideFree uri={uri} />
|
||||
</>
|
||||
|
||||
@@ -161,7 +161,7 @@ function PublishAdditionalOptions(props: Props) {
|
||||
type="select"
|
||||
name="content_language"
|
||||
value={language}
|
||||
onChange={(event) => updatePublishForm({ language: event.target.value })}
|
||||
onChange={(event) => updatePublishForm({ languages: [event.target.value] })}
|
||||
>
|
||||
{sortLanguageMap(SUPPORTED_LANGUAGES).map(([langKey, langName]) => (
|
||||
<option key={langKey} value={langKey}>
|
||||
|
||||
@@ -612,7 +612,7 @@ function PublishFile(props: Props) {
|
||||
{/* @if TARGET='app' */}
|
||||
{showFileUpload && (
|
||||
<FileSelector
|
||||
label={__('File')}
|
||||
label={__('Video file')}
|
||||
disabled={disabled}
|
||||
currentPath={currentFile}
|
||||
onFileChosen={handleFileChange}
|
||||
|
||||
@@ -182,9 +182,9 @@ function PublishForm(props: Props) {
|
||||
}
|
||||
} else {
|
||||
if (editingURI) {
|
||||
customSubtitle = __('Update your video');
|
||||
customSubtitle = __('Update your video/audio');
|
||||
} else {
|
||||
customSubtitle = __('Upload that unlabeled video you found behind the TV in 1991');
|
||||
customSubtitle = __('Upload that unlabeled video or cassette you found behind the TV in 1991');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,6 +566,7 @@ function PublishForm(props: Props) {
|
||||
<Button
|
||||
key={String(modeName)}
|
||||
icon={modeName}
|
||||
iconSize={18}
|
||||
label={__(MODE_TO_I18N_STR[String(modeName)] || '---')}
|
||||
button="alt"
|
||||
onClick={() => {
|
||||
@@ -629,7 +630,7 @@ function PublishForm(props: Props) {
|
||||
previewing
|
||||
}
|
||||
/>
|
||||
<Button button="link" onClick={clearPublish} label={__('New')} />
|
||||
<Button button="link" onClick={clearPublish} label={__('New --[clears Publish Form]--')} />
|
||||
</div>
|
||||
<p className="help">
|
||||
{!formDisabled && !formValid ? (
|
||||
|
||||
@@ -13,7 +13,6 @@ type Props = {
|
||||
|
||||
function NameHelpText(props: Props) {
|
||||
const { uri, myClaimForUri, onEditMyClaim, isStillEditing } = props;
|
||||
|
||||
let nameHelpText;
|
||||
|
||||
if (isStillEditing) {
|
||||
|
||||
@@ -78,7 +78,7 @@ const PublishReleaseDate = (props: Props) => {
|
||||
|
||||
return (
|
||||
<div className="form-field-date-picker">
|
||||
<label>Release date</label>
|
||||
<label>{__('Release date')}</label>
|
||||
<div className="controls">
|
||||
{showDatePicker && (
|
||||
<DateTimePicker
|
||||
|
||||
@@ -20,20 +20,20 @@ import Spinner from 'component/spinner';
|
||||
type Props = {
|
||||
doToast: ({ message: string }) => void,
|
||||
doClearRepostError: () => void,
|
||||
doRepost: StreamRepostOptions => Promise<*>,
|
||||
doRepost: (StreamRepostOptions) => Promise<*>,
|
||||
title: string,
|
||||
claim?: StreamClaim,
|
||||
enteredContentClaim?: StreamClaim,
|
||||
balance: number,
|
||||
channels: ?Array<ChannelClaim>,
|
||||
doCheckPublishNameAvailability: string => Promise<*>,
|
||||
doCheckPublishNameAvailability: (string) => Promise<*>,
|
||||
error: ?string,
|
||||
reposting: boolean,
|
||||
uri: string,
|
||||
name: string,
|
||||
contentUri: string,
|
||||
setRepostUri: string => void,
|
||||
setContentUri: string => void,
|
||||
setRepostUri: (string) => void,
|
||||
setContentUri: (string) => void,
|
||||
doCheckPendingClaims: () => void,
|
||||
redirectUri?: string,
|
||||
passedRepostAmount: number,
|
||||
@@ -88,7 +88,7 @@ function RepostCreate(props: Props) {
|
||||
const repostUrlName = `lbry://${incognito || !activeChannelClaim ? '' : `${activeChannelClaim.name}/`}`;
|
||||
|
||||
const contentFirstRender = React.useRef(true);
|
||||
const setAutoRepostBid = amount => {
|
||||
const setAutoRepostBid = (amount) => {
|
||||
if (balance && balance > 0.02) {
|
||||
if (uri) {
|
||||
setRepostBid(0.01);
|
||||
@@ -113,7 +113,7 @@ function RepostCreate(props: Props) {
|
||||
const isLbryUrl = value.startsWith('lbry://') && value !== 'lbry://';
|
||||
const error = '';
|
||||
|
||||
const addLbryIfNot = term => {
|
||||
const addLbryIfNot = (term) => {
|
||||
return term.startsWith('lbry://') ? term : `lbry://${term}`;
|
||||
};
|
||||
if (wasCopiedFromWeb) {
|
||||
@@ -178,7 +178,7 @@ function RepostCreate(props: Props) {
|
||||
|
||||
React.useEffect(() => {
|
||||
if (enteredRepostName && isNameValid(enteredRepostName, false)) {
|
||||
doCheckPublishNameAvailability(enteredRepostName).then(r => setAvailable(r));
|
||||
doCheckPublishNameAvailability(enteredRepostName).then((r) => setAvailable(r));
|
||||
}
|
||||
}, [enteredRepostName, doCheckPublishNameAvailability]);
|
||||
|
||||
@@ -316,7 +316,7 @@ function RepostCreate(props: Props) {
|
||||
<div>
|
||||
{uri && (
|
||||
<fieldset-section>
|
||||
<ClaimPreview key={uri} uri={uri} actions={''} type={'inline'} showNullPlaceholder />
|
||||
<ClaimPreview key={uri} uri={uri} actions={''} showNullPlaceholder />
|
||||
</fieldset-section>
|
||||
)}
|
||||
{!uri && name && (
|
||||
@@ -327,7 +327,7 @@ function RepostCreate(props: Props) {
|
||||
name="content_url"
|
||||
value={enteredContent}
|
||||
error={contentError}
|
||||
onChange={event => setEnteredContentUri(event.target.value)}
|
||||
onChange={(event) => setEnteredContentUri(event.target.value)}
|
||||
placeholder={__('Enter a name or %domain% URL', { domain: SITE_URL })}
|
||||
/>
|
||||
</>
|
||||
@@ -359,7 +359,7 @@ function RepostCreate(props: Props) {
|
||||
type="text"
|
||||
name="repost_name"
|
||||
value={enteredRepostName}
|
||||
onChange={event => setEnteredRepostName(event.target.value)}
|
||||
onChange={(event) => setEnteredRepostName(event.target.value)}
|
||||
placeholder={__('MyFunName')}
|
||||
/>
|
||||
</fieldset-group>
|
||||
@@ -384,8 +384,8 @@ function RepostCreate(props: Props) {
|
||||
</>
|
||||
}
|
||||
disabled={!enteredRepostName || resolvingRepost}
|
||||
onChange={event => setRepostBid(event.target.value)}
|
||||
onWheel={e => e.stopPropagation()}
|
||||
onChange={(event) => setRepostBid(event.target.value)}
|
||||
onWheel={(e) => e.stopPropagation()}
|
||||
/>
|
||||
</React.Fragment>
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ class SelectThumbnail extends React.PureComponent<Props> {
|
||||
<FileSelector
|
||||
currentPath={thumbnailPath}
|
||||
label={__('Thumbnail')}
|
||||
placeholder={__('Choose a thumbnail')}
|
||||
placeholder={__('Thumbnails that entice a viewer to watch a video work best')}
|
||||
accept={accept}
|
||||
onFileChosen={(file) => openModal(MODALS.CONFIRM_THUMBNAIL_UPLOAD, { file })}
|
||||
/>
|
||||
|
||||
@@ -2,11 +2,10 @@ import { connect } from 'react-redux';
|
||||
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
||||
import { selectPurchaseUriSuccess, doClearPurchasedUriSuccess } from 'lbry-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { selectUserVerifiedEmail, selectUser, makeSelectUserPropForProp } from 'redux/selectors/user';
|
||||
import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user';
|
||||
import { selectHomepageData, selectLanguage } from 'redux/selectors/settings';
|
||||
import { doSignOut } from 'redux/actions/app';
|
||||
import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
|
||||
import * as USER from 'constants/user';
|
||||
|
||||
import SideNavigation from './view';
|
||||
|
||||
@@ -19,7 +18,6 @@ const select = (state) => ({
|
||||
unseenCount: selectUnseenNotificationCount(state),
|
||||
user: selectUser(state),
|
||||
homepageData: selectHomepageData(state),
|
||||
hasExperimentalUi: makeSelectUserPropForProp(USER.EXPERIMENTAL_UI)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
|
||||
@@ -46,7 +46,6 @@ type Props = {
|
||||
doClearPurchasedUriSuccess: () => void,
|
||||
user: ?User,
|
||||
homepageData: any,
|
||||
hasExperimentalUi: boolean,
|
||||
};
|
||||
|
||||
type SideNavLink = {
|
||||
@@ -74,7 +73,6 @@ function SideNavigation(props: Props) {
|
||||
homepageData,
|
||||
user,
|
||||
followedTags,
|
||||
hasExperimentalUi,
|
||||
} = props;
|
||||
|
||||
const { EXTRA_SIDEBAR_LINKS } = homepageData;
|
||||
@@ -214,14 +212,14 @@ function SideNavigation(props: Props) {
|
||||
});
|
||||
}
|
||||
|
||||
const notificationsEnabled = user && user.experimental_ui;
|
||||
const notificationsEnabled = SIMPLE_SITE || (user && user.experimental_ui);
|
||||
const isAuthenticated = Boolean(email);
|
||||
// SIDE LINKS: FOLLOWING, HOME, [FULL,] [EXTRA]
|
||||
let SIDE_LINKS: Array<SideNavLink> = [];
|
||||
|
||||
SIDE_LINKS.push(HOME);
|
||||
SIDE_LINKS.push(RECENT_FROM_FOLLOWING);
|
||||
if (!SIMPLE_SITE && hasExperimentalUi) {
|
||||
if (!SIMPLE_SITE) {
|
||||
FULL_LINKS.push({
|
||||
title: 'Lists',
|
||||
link: `/$/${PAGES.LISTS}`,
|
||||
@@ -231,7 +229,7 @@ function SideNavigation(props: Props) {
|
||||
}
|
||||
if (!SIMPLE_SITE) {
|
||||
SIDE_LINKS.push(...FULL_LINKS);
|
||||
} else if (SIMPLE_SITE && hasExperimentalUi) {
|
||||
} else if (SIMPLE_SITE) {
|
||||
SIDE_LINKS.push({
|
||||
title: 'Lists',
|
||||
link: `/$/${PAGES.LISTS}`,
|
||||
@@ -308,6 +306,11 @@ function SideNavigation(props: Props) {
|
||||
<li className="navigation-link">
|
||||
<Button label={__('FAQ')} href="https://odysee.com/@OdyseeHelp:b" />
|
||||
</li>
|
||||
|
||||
<li className="navigation-link">
|
||||
<Button label={__('Community Guidelines')} href="https://odysee.com/@OdyseeHelp:b/Community-Guidelines:c" />
|
||||
</li>
|
||||
|
||||
<li className="navigation-link">
|
||||
<Button label={__('Support --[used in footer; general help/support]--')} href="https://lbry.com/support" />
|
||||
</li>
|
||||
|
||||
@@ -22,11 +22,13 @@ type Props = {
|
||||
referralCode: string,
|
||||
user: any,
|
||||
position: number,
|
||||
collectionId?: number,
|
||||
};
|
||||
|
||||
function SocialShare(props: Props) {
|
||||
const { claim, title, referralCode, user, webShareable, position } = props;
|
||||
const { claim, title, referralCode, user, webShareable, position, collectionId } = props;
|
||||
const [showEmbed, setShowEmbed] = React.useState(false);
|
||||
const [includeCollectionId, setIncludeCollectionId] = React.useState(Boolean(collectionId)); // unless it *is* a collection?
|
||||
const [showClaimLinks, setShowClaimLinks] = React.useState(false);
|
||||
const [includeStartTime, setincludeStartTime]: [boolean, any] = React.useState(false);
|
||||
const [startTime, setStartTime]: [string, any] = React.useState(secondsToHms(position));
|
||||
@@ -46,14 +48,22 @@ function SocialShare(props: Props) {
|
||||
const rewardsApproved = user && user.is_reward_approved;
|
||||
const lbryUrl: string = generateLbryContentUrl(canonicalUrl, permanentUrl);
|
||||
const lbryWebUrl: string = generateLbryWebUrl(lbryUrl);
|
||||
const encodedLbryURL: string = generateEncodedLbryURL(SHARE_DOMAIN, lbryWebUrl, includeStartTime, startTimeSeconds);
|
||||
const includedCollectionId = collectionId && includeCollectionId ? collectionId : null;
|
||||
const encodedLbryURL: string = generateEncodedLbryURL(
|
||||
SHARE_DOMAIN,
|
||||
lbryWebUrl,
|
||||
includeStartTime,
|
||||
startTimeSeconds,
|
||||
includedCollectionId
|
||||
);
|
||||
const shareUrl: string = generateShareUrl(
|
||||
SHARE_DOMAIN,
|
||||
lbryUrl,
|
||||
referralCode,
|
||||
rewardsApproved,
|
||||
includeStartTime,
|
||||
startTimeSeconds
|
||||
startTimeSeconds,
|
||||
includedCollectionId
|
||||
);
|
||||
const downloadUrl = `${generateDownloadUrl(name, claimId)}`;
|
||||
|
||||
@@ -70,7 +80,7 @@ function SocialShare(props: Props) {
|
||||
<React.Fragment>
|
||||
<CopyableText copyable={shareUrl} />
|
||||
{showStartAt && (
|
||||
<div className="section__start-at">
|
||||
<div className="section__checkbox">
|
||||
<FormField
|
||||
type="checkbox"
|
||||
name="share_start_at_checkbox"
|
||||
@@ -87,18 +97,30 @@ function SocialShare(props: Props) {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{Boolean(collectionId) && (
|
||||
<div className="section__checkbox">
|
||||
<FormField
|
||||
type="checkbox"
|
||||
name="share_collection_id_checkbox"
|
||||
onChange={() => setIncludeCollectionId(!includeCollectionId)}
|
||||
checked={includeCollectionId}
|
||||
label={__('Include List ID')}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
className="share"
|
||||
iconSize={24}
|
||||
icon={ICONS.TWITTER}
|
||||
title={__('Share on Twitter')}
|
||||
href={`https://twitter.com/intent/tweet?text=${encodedLbryURL}`}
|
||||
/>
|
||||
<Button
|
||||
className="share"
|
||||
iconSize={24}
|
||||
icon={ICONS.REDDIT}
|
||||
title={__('Share on Facebook')}
|
||||
title={__('Share on Reddit')}
|
||||
href={`https://reddit.com/submit?url=${encodedLbryURL}`}
|
||||
/>
|
||||
{IOS && (
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
} from 'redux/selectors/subscriptions';
|
||||
import { makeSelectPermanentUrlForUri } from 'lbry-redux';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import SubscribeButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -15,7 +14,6 @@ const select = (state, props) => ({
|
||||
firstRunCompleted: selectFirstRunCompleted(state),
|
||||
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
||||
notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
|
||||
@@ -43,7 +43,6 @@ export default function SubscribeButton(props: Props) {
|
||||
const isMobile = useIsMobile();
|
||||
let isHovering = useHover(buttonRef);
|
||||
isHovering = isMobile ? true : isHovering;
|
||||
const uiNotificationsEnabled = user && user.experimental_ui;
|
||||
|
||||
const { channelName: rawChannelName } = parseURI(uri);
|
||||
const { channelName } = parseURI(permanentUrl);
|
||||
@@ -109,7 +108,7 @@ export default function SubscribeButton(props: Props) {
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{isSubscribed && uiNotificationsEnabled && (
|
||||
{isSubscribed && (
|
||||
<Button
|
||||
button="alt"
|
||||
icon={notificationsDisabled ? ICONS.BELL : ICONS.BELL_ON}
|
||||
|
||||
@@ -11,7 +11,6 @@ import { AUTO_FOLLOW_CHANNELS, SIMPLE_SITE } from 'config';
|
||||
type Props = {
|
||||
subscribedChannels: Array<Subscription>,
|
||||
onContinue: () => void,
|
||||
onBack: () => void,
|
||||
channelSubscribe: (sub: Subscription) => void,
|
||||
homepageData: any,
|
||||
prefsReady: boolean,
|
||||
@@ -45,25 +44,25 @@ function UserChannelFollowIntro(props: Props) {
|
||||
<Card
|
||||
title={__('Find channels to follow')}
|
||||
subtitle={__(
|
||||
'LBRY works better if you find and follow a couple creators you like. You can also block channels you never want to see.'
|
||||
'Odysee works better if you find and follow a couple creators you like. You can also block channels you never want to see.'
|
||||
)}
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<div className="section__actions--between">
|
||||
<Button button="secondary" onClick={onBack} label={__('Back')} />
|
||||
<Button
|
||||
button={subscribedChannels.length < 1 ? 'alt' : 'primary'}
|
||||
onClick={onContinue}
|
||||
label={subscribedChannels.length < 1 ? __('Skip') : __('Continue')}
|
||||
/>
|
||||
</div>
|
||||
<div className="section__body">
|
||||
<ClaimListDiscover
|
||||
defaultOrderBy={CS.ORDER_BY_TOP}
|
||||
hideFilters
|
||||
meta={
|
||||
<Button
|
||||
button={subscribedChannels.length < 1 ? 'alt' : 'primary'}
|
||||
onClick={onContinue}
|
||||
label={subscribedChannels.length < 1 ? __('Skip') : __('Continue')}
|
||||
/>
|
||||
}
|
||||
defaultOrderBy={CS.ORDER_BY_TRENDING}
|
||||
defaultFreshness={CS.FRESH_ALL}
|
||||
claimType="channel"
|
||||
claimIds={SIMPLE_SITE ? undefined : PRIMARY_CONTENT_CHANNEL_IDS}
|
||||
defaultTags={followingCount > 3 ? CS.TAGS_FOLLOWED : undefined}
|
||||
claimIds={SIMPLE_SITE ? PRIMARY_CONTENT_CHANNEL_IDS : undefined}
|
||||
claimType={CS.CLAIM_CHANNEL}
|
||||
maxPages={3}
|
||||
/>
|
||||
{followingCount > 0 && (
|
||||
<Nag
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { useHistory } from 'react-router';
|
||||
@@ -7,7 +6,6 @@ import UserEmailNew from 'component/userEmailNew';
|
||||
import UserEmailVerify from 'component/userEmailVerify';
|
||||
import UserFirstChannel from 'component/userFirstChannel';
|
||||
import UserChannelFollowIntro from 'component/userChannelFollowIntro';
|
||||
import UserTagFollowIntro from 'component/userTagFollowIntro';
|
||||
import YoutubeSync from 'page/youtubeSync';
|
||||
import { DEFAULT_BID_FOR_FIRST_CHANNEL } from 'component/userFirstChannel/view';
|
||||
import { YOUTUBE_STATUSES } from 'lbryinc';
|
||||
@@ -42,7 +40,6 @@ type Props = {
|
||||
creatingChannel: boolean,
|
||||
setClientSetting: (string, boolean, ?boolean) => void,
|
||||
followingAcknowledged: boolean,
|
||||
tagsAcknowledged: boolean,
|
||||
rewardsAcknowledged: boolean,
|
||||
interestedInYoutubeSync: boolean,
|
||||
doToggleInterestedInYoutubeSync: () => void,
|
||||
@@ -67,7 +64,6 @@ function UserSignUp(props: Props) {
|
||||
fetchingChannels,
|
||||
creatingChannel,
|
||||
followingAcknowledged,
|
||||
tagsAcknowledged,
|
||||
rewardsAcknowledged,
|
||||
setClientSetting,
|
||||
interestedInYoutubeSync,
|
||||
@@ -118,8 +114,7 @@ function UserSignUp(props: Props) {
|
||||
interestedInYoutubeSync);
|
||||
const showYoutubeTransfer = hasVerifiedEmail && hasYoutubeChannels && !isYoutubeTransferComplete;
|
||||
const showFollowIntro = step === 'channels' || (hasVerifiedEmail && !followingAcknowledged);
|
||||
const showTagsIntro = step === 'tags' || (hasVerifiedEmail && !tagsAcknowledged);
|
||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !showTagsIntro && !rewardsAcknowledged;
|
||||
const canHijackSignInFlowWithSpinner = hasVerifiedEmail && !showFollowIntro && !rewardsAcknowledged;
|
||||
const isCurrentlyFetchingSomething = fetchingChannels || claimingReward || syncingWallet || creatingChannel;
|
||||
const isWaitingForSomethingToFinish =
|
||||
// If the user has claimed the email award, we need to wait until the balance updates sometime in the future
|
||||
@@ -206,22 +201,6 @@ function UserSignUp(props: Props) {
|
||||
}}
|
||||
/>
|
||||
),
|
||||
showTagsIntro && (
|
||||
<UserTagFollowIntro
|
||||
onContinue={() => {
|
||||
let url = `/$/${PAGES.AUTH}?reset_scroll=1&${STEP_PARAM}=channels`;
|
||||
if (redirect) {
|
||||
url += `&${REDIRECT_PARAM}=${redirect}`;
|
||||
}
|
||||
if (shouldRedirectImmediately) {
|
||||
url += `&${REDIRECT_IMMEDIATELY_PARAM}=true`;
|
||||
}
|
||||
|
||||
replace(url);
|
||||
setSettingAndSync(SETTINGS.TAGS_ACKNOWLEDGED, true);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
showYoutubeTransfer && (
|
||||
<div>
|
||||
<YoutubeTransferStatus /> <Confetti recycle={false} style={{ position: 'fixed' }} />
|
||||
|
||||
@@ -12,7 +12,7 @@ import LbcSymbol from 'component/common/lbc-symbol';
|
||||
type Props = {
|
||||
errorMessage: ?string,
|
||||
isPending: boolean,
|
||||
verifyUserIdentity: string => void,
|
||||
verifyUserIdentity: (string) => void,
|
||||
verifyPhone: () => void,
|
||||
fetchUser: () => void,
|
||||
skipLink?: string,
|
||||
@@ -60,7 +60,7 @@ class UserVerify extends React.PureComponent<Props> {
|
||||
SITE_NAME,
|
||||
}}
|
||||
>
|
||||
Verified accounts are eligible to earn LBRY Credits for views, watching and reposting content, sharing
|
||||
Verified accounts are eligible to earn LBRY Credits for views, watching and reposting videos, sharing
|
||||
invite links etc. Verifying also helps us keep the %SITE_NAME% community safe too! %Refresh% or %Skip%.
|
||||
</I18nMessage>
|
||||
</p>
|
||||
@@ -73,9 +73,7 @@ class UserVerify extends React.PureComponent<Props> {
|
||||
<Card
|
||||
icon={ICONS.PHONE}
|
||||
title={__('Verify phone number')}
|
||||
subtitle={__(
|
||||
'You will receive an SMS text message confirming your phone number is valid. Does not work for Canada and possibly other regions.'
|
||||
)}
|
||||
subtitle={__('You will receive an SMS text message confirming your phone number is valid.')}
|
||||
actions={
|
||||
<Fragment>
|
||||
<Button
|
||||
|
||||
@@ -11,7 +11,6 @@ import './plugins/videojs-mobile-ui/plugin';
|
||||
import hlsQualitySelector from './plugins/videojs-hls-quality-selector/plugin';
|
||||
import qualityLevels from 'videojs-contrib-quality-levels';
|
||||
import isUserTyping from 'util/detect-typing';
|
||||
import analytics from 'analytics';
|
||||
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
|
||||
@@ -53,14 +52,14 @@ type Props = {
|
||||
adUrl: ?string,
|
||||
};
|
||||
|
||||
type VideoJSOptions = {
|
||||
controls: boolean,
|
||||
preload: string,
|
||||
playbackRates: Array<number>,
|
||||
responsive: boolean,
|
||||
poster?: string,
|
||||
muted?: boolean,
|
||||
};
|
||||
// type VideoJSOptions = {
|
||||
// controls: boolean,
|
||||
// preload: string,
|
||||
// playbackRates: Array<number>,
|
||||
// responsive: boolean,
|
||||
// poster: ?string,
|
||||
// muted: ?boolean,
|
||||
// };
|
||||
|
||||
const videoPlaybackRates = [0.25, 0.5, 0.75, 1, 1.1, 1.25, 1.5, 1.75, 2];
|
||||
|
||||
@@ -69,7 +68,7 @@ const IS_IOS =
|
||||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
|
||||
!window.MSStream;
|
||||
|
||||
const VIDEO_JS_OPTIONS: VideoJSOptions = {
|
||||
const VIDEO_JS_OPTIONS = {
|
||||
preload: 'auto',
|
||||
playbackRates: videoPlaybackRates,
|
||||
responsive: true,
|
||||
@@ -545,15 +544,8 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
|
||||
// Update video player and reload when source URL changes
|
||||
useEffect(() => {
|
||||
const fetchStartedAt = performance.now();
|
||||
// For some reason the video player is responsible for detecting content type this way
|
||||
fetch(source, { method: 'HEAD', cache: 'no-store' }).then((response) => {
|
||||
const deltaFetch = performance.now() - fetchStartedAt;
|
||||
// console.log(`Prefetch took: ${deltaFetch.toFixed(3)}ms`);
|
||||
|
||||
// Send fetch duration analytic event (in ms)
|
||||
analytics.videoFetchDuration(source, deltaFetch);
|
||||
|
||||
const player = playerRef.current;
|
||||
|
||||
if (!player) {
|
||||
@@ -561,22 +553,17 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
}
|
||||
|
||||
let type = sourceType;
|
||||
|
||||
let finalSource = source;
|
||||
// override type if we receive an .m3u8 (transcoded mp4)
|
||||
if (response && response.redirected && response.url && response.url.endsWith('m3u8')) {
|
||||
type = 'application/x-mpegURL';
|
||||
finalSource = response.url;
|
||||
}
|
||||
|
||||
// Update player poster
|
||||
// note: the poster prop seems to return null usually.
|
||||
if (poster) player.poster(poster);
|
||||
|
||||
// Update player source
|
||||
player.src({
|
||||
src: source,
|
||||
type: type,
|
||||
});
|
||||
|
||||
// set playsinline for mobile
|
||||
player.children_[0].setAttribute('playsinline', '');
|
||||
|
||||
@@ -587,7 +574,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||
|
||||
// Update player source
|
||||
player.src({
|
||||
src: source,
|
||||
src: finalSource,
|
||||
type: type,
|
||||
});
|
||||
|
||||
|
||||
@@ -114,12 +114,12 @@ function VideoViewer(props: Props) {
|
||||
const {
|
||||
location: { pathname },
|
||||
} = useHistory();
|
||||
const previousUri = usePrevious(uri);
|
||||
const embedded = useContext(EmbedContext);
|
||||
const [isPlaying, setIsPlaying] = useState(false);
|
||||
const [showAutoplayCountdown, setShowAutoplayCountdown] = useState(false);
|
||||
const [isEndededEmbed, setIsEndededEmbed] = useState(false);
|
||||
const vjsCallbackDataRef: any = React.useRef();
|
||||
const previousUri = usePrevious(uri);
|
||||
const embedded = useContext(EmbedContext);
|
||||
const approvedVideo = Boolean(channelClaimId) && adApprovedChannelIds.includes(channelClaimId);
|
||||
const adsEnabled = ENABLE_PREROLL_ADS && !authenticated && !embedded && approvedVideo;
|
||||
const [adUrl, setAdUrl, isFetchingAd] = useGetAds(approvedVideo, adsEnabled);
|
||||
|
||||
@@ -21,7 +21,9 @@ export default function WebUploadList(props: Props) {
|
||||
!!uploadCount && (
|
||||
<Card
|
||||
title={__('Currently uploading')}
|
||||
subtitle={uploadCount > 1 ? __('You files are currently uploading.') : __('Your file is currently uploading.')}
|
||||
subtitle={
|
||||
uploadCount > 1 ? __('You videos are currently uploading.') : __('Your video is currently uploading.')
|
||||
}
|
||||
body={
|
||||
<section>
|
||||
{/* $FlowFixMe */}
|
||||
|
||||
@@ -46,6 +46,7 @@ export default function WunderBarSuggestions(props: Props) {
|
||||
const inputRef: ElementRef<any> = React.useRef();
|
||||
const isFocused = inputRef && inputRef.current && inputRef.current === document.activeElement;
|
||||
|
||||
const THROTTLE_MS = 1000;
|
||||
const {
|
||||
push,
|
||||
location: { search },
|
||||
@@ -53,7 +54,7 @@ export default function WunderBarSuggestions(props: Props) {
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const queryFromUrl = urlParams.get('q') || '';
|
||||
const [term, setTerm] = React.useState(queryFromUrl);
|
||||
const throttledTerm = useThrottle(term, 500) || '';
|
||||
const throttledTerm = useThrottle(term, THROTTLE_MS) || '';
|
||||
const searchSize = isMobile ? 20 : 5;
|
||||
const { results, loading } = useLighthouse(throttledTerm, showMature, searchSize);
|
||||
const noResults = throttledTerm && !loading && results && results.length === 0;
|
||||
|
||||
@@ -118,9 +118,7 @@ export default function YoutubeTransferStatus(props: Props) {
|
||||
{isNotElligible && (
|
||||
<I18nMessage
|
||||
tokens={{
|
||||
here: (
|
||||
<Button button="link" href="https://lbry.com/faq/youtube" label={__('here')} />
|
||||
),
|
||||
here: <Button button="link" href="https://lbry.com/faq/youtube" label={__('here')} />,
|
||||
email: SITE_HELP_EMAIL,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -3,3 +3,22 @@ export const LINKED_COMMENT_QUERY_PARAM = 'lc';
|
||||
export const SORT_COMMENTS_NEW = 'new';
|
||||
export const SORT_COMMENTS_BEST = 'best';
|
||||
export const SORT_COMMENTS_CONTROVERSIAL = 'controversial';
|
||||
|
||||
export const BANNED_LIVESTREAM_WORDS = [
|
||||
'n1gga',
|
||||
'f4ggot',
|
||||
'faggot',
|
||||
'nigga',
|
||||
'nigger',
|
||||
'F4G',
|
||||
'fag',
|
||||
'n1gger',
|
||||
'faget',
|
||||
'niggah',
|
||||
'n1ggah',
|
||||
'jew',
|
||||
'j3w',
|
||||
'goy',
|
||||
'goyim',
|
||||
'fagot',
|
||||
];
|
||||
@@ -1,6 +1,6 @@
|
||||
export const FF_MAX_CHARS_DEFAULT = 2000;
|
||||
export const FF_MAX_CHARS_IN_COMMENT = 2000;
|
||||
export const FF_MAX_CHARS_IN_LIVESTREAM_COMMENT = 500;
|
||||
export const FF_MAX_CHARS_IN_LIVESTREAM_COMMENT = 300;
|
||||
export const FF_MAX_CHARS_IN_DESCRIPTION = 5000;
|
||||
export const FF_MAX_CHARS_REPORT_CONTENT_DETAILS = 500;
|
||||
export const FF_MAX_CHARS_REPORT_CONTENT_ADDRESS = 255;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export const BITWAVE_EMBED_URL = 'https://bitwave.tv/odysee';
|
||||
export const BITWAVE_LIVE_API = 'https://api.bitwave.tv/v1/odysee/live';
|
||||
export const BITWAVE_LIVE_API = 'https://api.live.odysee.com/v1/odysee/live';
|
||||
export const BITWAVE_REPLAY_API = 'https://api.bitwave.tv/v1/replays/odysee';
|
||||
@@ -6,10 +6,11 @@ import { isURIValid } from 'lbry-redux';
|
||||
import useThrottle from './use-throttle';
|
||||
|
||||
export default function useLighthouse(query: string, showMature?: boolean, size?: number = 5) {
|
||||
const THROTTLE_MS = 1000;
|
||||
const [results, setResults] = React.useState();
|
||||
const [loading, setLoading] = React.useState();
|
||||
const queryString = query ? getSearchQueryString(query, { nsfw: showMature, size }) : '';
|
||||
const throttledQuery = useThrottle(queryString, 500);
|
||||
const throttledQuery = useThrottle(queryString, THROTTLE_MS);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (throttledQuery) {
|
||||
@@ -19,9 +20,11 @@ export default function useLighthouse(query: string, showMature?: boolean, size?
|
||||
let isSubscribed = true;
|
||||
lighthouse
|
||||
.search(throttledQuery)
|
||||
.then(results => {
|
||||
.then((results) => {
|
||||
if (isSubscribed) {
|
||||
setResults(results.map(result => `lbry://${result.name}#${result.claimId}`).filter(uri => isURIValid(uri)));
|
||||
setResults(
|
||||
results.map((result) => `lbry://${result.name}#${result.claimId}`).filter((uri) => isURIValid(uri))
|
||||
);
|
||||
setLoading(false);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -44,8 +44,9 @@ class ModalPublishSuccess extends React.PureComponent<Props> {
|
||||
'Your livestream is now pending. You will be able to start shortly at the streaming dashboard.'
|
||||
);
|
||||
} else {
|
||||
publishMessage = __('Your file is now pending on LBRY. It will take a few minutes to appear for other users.');
|
||||
publishMessage = __('Your video will appear on Odysee shortly.');
|
||||
}
|
||||
clearPublish();
|
||||
|
||||
function handleClose() {
|
||||
closeModal();
|
||||
@@ -54,7 +55,7 @@ class ModalPublishSuccess extends React.PureComponent<Props> {
|
||||
return (
|
||||
<Modal isOpen type="card" contentLabel={__(contentLabel)} onAborted={handleClose}>
|
||||
<Card
|
||||
title={__('Success')}
|
||||
title={livestream ? __('Livestream Created') : __('Upload Complete')}
|
||||
subtitle={publishMessage}
|
||||
body={
|
||||
<React.Fragment>
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
selectMyChannelClaims,
|
||||
makeSelectClaimIsStreamPlaceholder,
|
||||
SETTINGS,
|
||||
doClearPublish,
|
||||
} from 'lbry-redux';
|
||||
import { selectFfmpegStatus, makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doPublishDesktop } from 'redux/actions/publish';
|
||||
@@ -32,6 +33,7 @@ const select = (state, props) => {
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
publish: (filePath, preview) => dispatch(doPublishDesktop(filePath, preview)),
|
||||
clearPublish: () => dispatch(doClearPublish()),
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
setEnablePublishPreview: (value) => dispatch(doSetClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW, value)),
|
||||
});
|
||||
|
||||
@@ -234,7 +234,7 @@ const ModalPublishPreview = (props: Props) => {
|
||||
{createRow(__('Deposit'), depositValue)}
|
||||
{createRow(__('Price'), priceValue)}
|
||||
{createRow(__('Language'), language)}
|
||||
{releaseTimeEdited && createRow(__('Release Date'), releaseTimeStr(releaseTimeEdited))}
|
||||
{releaseTimeEdited && createRow(__('Release date'), releaseTimeStr(releaseTimeEdited))}
|
||||
{createRow(__('License'), licenseValue)}
|
||||
{createRow(__('Tags'), tagsValue)}
|
||||
</tbody>
|
||||
|
||||
@@ -52,10 +52,8 @@ function ModalRemoveFile(props: Props) {
|
||||
<FormField
|
||||
name="claim_abandon"
|
||||
label={
|
||||
<I18nMessage
|
||||
tokens={{ lbc: <LbcSymbol prefix={__('reclaim %amount%', { amount: claim.amount })} /> }}
|
||||
>
|
||||
Abandon on blockchain (%lbc%)
|
||||
<I18nMessage tokens={{ lbc: <LbcSymbol postfix={claim.amount} /> }}>
|
||||
Abandon on blockchain (reclaim %lbc%)
|
||||
</I18nMessage>
|
||||
}
|
||||
type="checkbox"
|
||||
|
||||
@@ -8,14 +8,18 @@ type Props = {
|
||||
closeModal: () => void,
|
||||
uri: string,
|
||||
webShareable: boolean,
|
||||
collectionId?: number,
|
||||
};
|
||||
|
||||
class ModalSocialShare extends React.PureComponent<Props> {
|
||||
render() {
|
||||
const { closeModal, uri, webShareable } = this.props;
|
||||
const { closeModal, uri, webShareable, collectionId } = this.props;
|
||||
return (
|
||||
<Modal isOpen onAborted={closeModal} type="card">
|
||||
<Card title={__('Share')} actions={<SocialShare uri={uri} webShareable={webShareable} />} />
|
||||
<Card
|
||||
title={__('Share')}
|
||||
actions={<SocialShare uri={uri} webShareable={webShareable} collectionId={collectionId} />}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class ModalTransactionFailed extends React.PureComponent<Props> {
|
||||
|
||||
return (
|
||||
<Modal isOpen contentLabel={__('Transaction failed')} title={__('Transaction failed')} onConfirmed={closeModal}>
|
||||
<p>{__('Sorry about that. Contact help@lbry.com if you continue to have issues.')}</p>
|
||||
<p>{__('Sorry about that. Contact help@odysee.com if you continue to have issues.')}</p>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React from 'react';
|
||||
import { Modal } from 'modal/modal';
|
||||
@@ -15,18 +16,27 @@ const YoutubeWelcome = (props: Props) => {
|
||||
<Modal isOpen type="card" onAborted={doHideModal}>
|
||||
<Confetti recycle={false} style={{ position: 'fixed' }} numberOfPieces={100} />
|
||||
<Card
|
||||
title={__("You're free!")}
|
||||
title={!SIMPLE_SITE ? __("You're free!") : __('Welcome to Odysee')}
|
||||
subtitle={
|
||||
<React.Fragment>
|
||||
<p>
|
||||
{__("You've escaped the land of spying, censorship, and exploitation.")}
|
||||
<span className="emoji"> 💩</span>
|
||||
</p>
|
||||
<p>
|
||||
{__('Welcome to the land of content freedom.')}
|
||||
<span className="emoji"> 🌈</span>
|
||||
</p>
|
||||
</React.Fragment>
|
||||
!SIMPLE_SITE ? (
|
||||
<React.Fragment>
|
||||
<p>
|
||||
{__("You've escaped the land of spying, censorship, and exploitation.")}
|
||||
<span className="emoji"> 💩</span>
|
||||
</p>
|
||||
<p>
|
||||
{__('Welcome to the land of content freedom.')}
|
||||
<span className="emoji"> 🌈</span>
|
||||
</p>
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<p>
|
||||
{__('You make the party extra special!')}
|
||||
<span className="emoji"> 💖</span>
|
||||
</p>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
actions={
|
||||
<div className="card__actions">
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, doResolveUri } from 'lbry-redux';
|
||||
import AdsTestPage from './view';
|
||||
|
||||
export default connect(
|
||||
(state) => ({
|
||||
claim: makeSelectClaimForUri('lbry://fullscreenrelease#7')(state),
|
||||
}),
|
||||
{
|
||||
doResolveUri,
|
||||
}
|
||||
)(AdsTestPage);
|
||||
@@ -0,0 +1,20 @@
|
||||
// @flow
|
||||
// import React from 'react';
|
||||
// import FilePage from 'page/file';
|
||||
|
||||
type Props = {
|
||||
doResolveUri: (string) => void,
|
||||
claim: ?StreamClaim,
|
||||
};
|
||||
|
||||
export default function AdsTestPage(props: Props) {
|
||||
return null;
|
||||
// const { doResolveUri, claim } = props;
|
||||
// const hasClaim = claim !== undefined;
|
||||
// React.useEffect(() => {
|
||||
// if (!hasClaim) {
|
||||
// doResolveUri('lbry://fullscreenrelease#7');
|
||||
// }
|
||||
// }, [hasClaim, doResolveUri]);
|
||||
// return <div>{hasClaim && <FilePage uri="lbry://fullscreenrelease#7" />}</div>;
|
||||
}
|
||||
@@ -22,6 +22,7 @@ const MOONPAY_KEY = process.env.MOONPAY_SECRET_KEY;
|
||||
const COUNTRIES = Array.from(
|
||||
new Set(
|
||||
countryData.all
|
||||
.filter((country) => country.status !== 'deleted')
|
||||
.map((country) => country.name)
|
||||
.sort((a, b) => {
|
||||
if (a > b) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
selectCurrentChannelPage,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsPending,
|
||||
selectMyUnpublishedCollections,
|
||||
} from 'lbry-redux';
|
||||
import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
|
||||
import { selectYoutubeChannels } from 'redux/selectors/user';
|
||||
@@ -30,6 +31,7 @@ const select = (state, props) => ({
|
||||
youtubeChannels: selectYoutubeChannels(state),
|
||||
blockedChannels: selectModerationBlockList(state),
|
||||
mutedChannels: selectMutedChannels(state),
|
||||
unpublishedCollections: selectMyUnpublishedCollections(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
|
||||
@@ -22,10 +22,12 @@ import ClaimSupportButton from 'component/claimSupportButton';
|
||||
import ChannelStakedIndicator from 'component/channelStakedIndicator';
|
||||
import ClaimMenuList from 'component/claimMenuList';
|
||||
import Yrbl from 'component/yrbl';
|
||||
import I18nMessage from '../../component/i18nMessage';
|
||||
|
||||
export const PAGE_VIEW_QUERY = `view`;
|
||||
const CONTENT_PAGE = 'content';
|
||||
const LISTS_PAGE = 'lists';
|
||||
const REPOSTS_PAGE = 'reposts';
|
||||
const ABOUT_PAGE = `about`;
|
||||
export const DISCUSSION_PAGE = `discussion`;
|
||||
const EDIT_PAGE = 'edit';
|
||||
@@ -51,6 +53,7 @@ type Props = {
|
||||
youtubeChannels: ?Array<{ channel_claim_id: string, sync_status: string, transfer_state: string }>,
|
||||
blockedChannels: Array<string>,
|
||||
mutedChannels: Array<string>,
|
||||
unpublishedCollections: CollectionGroup,
|
||||
};
|
||||
|
||||
function ChannelPage(props: Props) {
|
||||
@@ -69,6 +72,7 @@ function ChannelPage(props: Props) {
|
||||
youtubeChannels,
|
||||
blockedChannels,
|
||||
mutedChannels,
|
||||
unpublishedCollections,
|
||||
} = props;
|
||||
const {
|
||||
push,
|
||||
@@ -98,6 +102,31 @@ function ChannelPage(props: Props) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
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>;
|
||||
}
|
||||
let channelIsBlackListed = false;
|
||||
|
||||
if (claim && blackListedOutpoints) {
|
||||
@@ -117,12 +146,15 @@ function ChannelPage(props: Props) {
|
||||
case LISTS_PAGE:
|
||||
tabIndex = 1;
|
||||
break;
|
||||
case ABOUT_PAGE:
|
||||
case REPOSTS_PAGE:
|
||||
tabIndex = 2;
|
||||
break;
|
||||
case DISCUSSION_PAGE:
|
||||
case ABOUT_PAGE:
|
||||
tabIndex = 3;
|
||||
break;
|
||||
case DISCUSSION_PAGE:
|
||||
tabIndex = 4;
|
||||
break;
|
||||
default:
|
||||
tabIndex = 0;
|
||||
break;
|
||||
@@ -137,6 +169,8 @@ function ChannelPage(props: Props) {
|
||||
} else if (newTabIndex === 1) {
|
||||
search += `${PAGE_VIEW_QUERY}=${LISTS_PAGE}`;
|
||||
} else if (newTabIndex === 2) {
|
||||
search += `${PAGE_VIEW_QUERY}=${REPOSTS_PAGE}`;
|
||||
} else if (newTabIndex === 3) {
|
||||
search += `${PAGE_VIEW_QUERY}=${ABOUT_PAGE}`;
|
||||
} else {
|
||||
search += `${PAGE_VIEW_QUERY}=${DISCUSSION_PAGE}`;
|
||||
@@ -186,7 +220,7 @@ function ChannelPage(props: Props) {
|
||||
{!(isBlocked || isMuted) && <ClaimSupportButton uri={uri} />}
|
||||
{!(isBlocked || isMuted) && (!channelIsBlackListed || isSubscribed) && <SubscribeButton uri={permanentUrl} />}
|
||||
{/* TODO: add channel collections <ClaimCollectionAddButton uri={uri} fileAction /> */}
|
||||
<ClaimMenuList uri={claim.permanent_url} channelUri={claim.permanent_url} inline />
|
||||
<ClaimMenuList uri={claim.permanent_url} channelUri={claim.permanent_url} inline isChannelPage />
|
||||
</div>
|
||||
{cover && <img className={classnames('channel-cover__custom')} src={cover} />}
|
||||
<div className="channel__primary-info">
|
||||
@@ -252,6 +286,7 @@ function ChannelPage(props: Props) {
|
||||
<TabList className="tabs__list--channel-page">
|
||||
<Tab disabled={editing}>{__('Publishes')}</Tab>
|
||||
<Tab disabled={editing}>{__('Playlists')}</Tab>
|
||||
<Tab disabled={editing}>{__('Reposts')}</Tab>
|
||||
<Tab>{editing ? __('Editing Your Channel') : __('About --[tab title in Channel Page]--')}</Tab>
|
||||
<Tab disabled={editing}>{__('Community')}</Tab>
|
||||
</TabList>
|
||||
@@ -262,6 +297,7 @@ function ChannelPage(props: Props) {
|
||||
uri={uri}
|
||||
channelIsBlackListed={channelIsBlackListed}
|
||||
viewHiddenChannels
|
||||
empty={<section className="main--empty">{__('No Content Found')}</section>}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
@@ -270,6 +306,16 @@ function ChannelPage(props: Props) {
|
||||
uri={uri}
|
||||
channelIsBlackListed={channelIsBlackListed}
|
||||
viewHiddenChannels
|
||||
empty={collectionEmpty}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
<ChannelContent
|
||||
claimType={'repost'}
|
||||
uri={uri}
|
||||
channelIsBlackListed={channelIsBlackListed}
|
||||
viewHiddenChannels
|
||||
empty={<section className="main--empty">{__('No Reposts Found')}</section>}
|
||||
/>
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
// import * as ICONS from 'constants/icons';
|
||||
// import * as PAGES from 'constants/pages';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import React from 'react';
|
||||
import Page from 'component/page';
|
||||
import Button from 'component/button';
|
||||
import ClaimTilesDiscover from 'component/claimTilesDiscover';
|
||||
// import Button from 'component/button';
|
||||
import ClaimListDiscover from 'component/claimListDiscover';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import { toCapitalCase } from 'util/string';
|
||||
// import { toCapitalCase } from 'util/string';
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
|
||||
const MORE_CHANNELS_ANCHOR = 'MoreChannels';
|
||||
@@ -19,89 +18,87 @@ type Props = {
|
||||
homepageData: any,
|
||||
};
|
||||
|
||||
type ChannelsFollowingItem = {
|
||||
title: string,
|
||||
link?: string,
|
||||
help?: any,
|
||||
options?: {},
|
||||
};
|
||||
|
||||
function ChannelsFollowingDiscover(props: Props) {
|
||||
const { followedTags, subscribedChannels, blockedChannels, homepageData } = props;
|
||||
const {
|
||||
// followedTags,
|
||||
// subscribedChannels,
|
||||
// blockedChannels,
|
||||
homepageData,
|
||||
} = props;
|
||||
const { PRIMARY_CONTENT_CHANNEL_IDS } = homepageData;
|
||||
let rowData: Array<ChannelsFollowingItem> = [];
|
||||
const notChannels = subscribedChannels
|
||||
.map(({ uri }) => uri)
|
||||
.concat(blockedChannels)
|
||||
.map(uri => uri.split('#')[1]);
|
||||
// let rowData: Array<ChannelsFollowingItem> = [];
|
||||
// const notChannels = subscribedChannels
|
||||
// .map(({ uri }) => uri)
|
||||
// .concat(blockedChannels)
|
||||
// .map(uri => uri.split('#')[1]);
|
||||
|
||||
rowData.push({
|
||||
title: 'Top Channels Of All Time',
|
||||
link: `/$/${PAGES.DISCOVER}?claim_type=channel&${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_ALL}`,
|
||||
options: {
|
||||
pageSize: 12,
|
||||
claimType: 'channel',
|
||||
orderBy: ['effective_amount'],
|
||||
},
|
||||
});
|
||||
// rowData.push({
|
||||
// title: 'Top Channels Of All Time',
|
||||
// link: `/$/${PAGES.DISCOVER}?claim_type=channel&${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_ALL}`,
|
||||
// options: {
|
||||
// pageSize: 12,
|
||||
// claimType: 'channel',
|
||||
// orderBy: ['effective_amount'],
|
||||
// },
|
||||
// });
|
||||
|
||||
rowData.push({
|
||||
title: 'Latest From @lbrycast',
|
||||
link: `/@lbrycast:4`,
|
||||
options: {
|
||||
orderBy: ['release_time'],
|
||||
pageSize: 8,
|
||||
channelIds: ['4c29f8b013adea4d5cca1861fb2161d5089613ea'],
|
||||
},
|
||||
});
|
||||
// rowData.push({
|
||||
// title: 'Latest From @lbrycast',
|
||||
// link: `/@lbrycast:4`,
|
||||
// options: {
|
||||
// orderBy: ['release_time'],
|
||||
// pageSize: 8,
|
||||
// channelIds: ['4c29f8b013adea4d5cca1861fb2161d5089613ea'],
|
||||
// },
|
||||
// });
|
||||
|
||||
rowData.push({
|
||||
title: 'Trending Channels',
|
||||
link: `/$/${PAGES.DISCOVER}?claim_type=channel`,
|
||||
options: {
|
||||
pageSize: 8,
|
||||
claimType: 'channel',
|
||||
orderBy: ['trending_group', 'trending_mixed'],
|
||||
},
|
||||
});
|
||||
// rowData.push({
|
||||
// title: 'Trending Channels',
|
||||
// link: `/$/${PAGES.DISCOVER}?claim_type=channel`,
|
||||
// options: {
|
||||
// pageSize: 8,
|
||||
// claimType: 'channel',
|
||||
// orderBy: ['trending_group', 'trending_mixed'],
|
||||
// },
|
||||
// });
|
||||
|
||||
if (followedTags.length > 0 && followedTags.length < 5) {
|
||||
const followedRows = followedTags.map((tag: Tag) => ({
|
||||
title: `Trending Channels for #${toCapitalCase(tag.name)}`,
|
||||
link: `/$/${PAGES.DISCOVER}?t=${tag.name}&claim_type=channel`,
|
||||
options: {
|
||||
claimType: 'channel',
|
||||
pageSize: 4,
|
||||
tags: [tag.name],
|
||||
},
|
||||
}));
|
||||
rowData.push(...followedRows);
|
||||
}
|
||||
// if (followedTags.length > 0 && followedTags.length < 5) {
|
||||
// const followedRows = followedTags.map((tag: Tag) => ({
|
||||
// title: `Trending Channels for #${toCapitalCase(tag.name)}`,
|
||||
// link: `/$/${PAGES.DISCOVER}?t=${tag.name}&claim_type=channel`,
|
||||
// options: {
|
||||
// claimType: 'channel',
|
||||
// pageSize: 4,
|
||||
// tags: [tag.name],
|
||||
// },
|
||||
// }));
|
||||
// rowData.push(...followedRows);
|
||||
// }
|
||||
|
||||
if (followedTags.length > 4) {
|
||||
rowData.push({
|
||||
title: 'Trending For Your Tags',
|
||||
link: `/$/${PAGES.TAGS_FOLLOWING}?claim_type=channel`,
|
||||
options: {
|
||||
claimType: 'channel',
|
||||
tags: followedTags.map(tag => tag.name),
|
||||
},
|
||||
});
|
||||
}
|
||||
// if (followedTags.length > 4) {
|
||||
// rowData.push({
|
||||
// title: 'Trending For Your Tags',
|
||||
// link: `/$/${PAGES.TAGS_FOLLOWING}?claim_type=channel`,
|
||||
// options: {
|
||||
// claimType: 'channel',
|
||||
// tags: followedTags.map(tag => tag.name),
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
|
||||
const rowDataWithGenericOptions = rowData.map(row => {
|
||||
return {
|
||||
...row,
|
||||
options: {
|
||||
...row.options,
|
||||
notChannels,
|
||||
},
|
||||
};
|
||||
});
|
||||
// const rowDataWithGenericOptions = rowData.map(row => {
|
||||
// return {
|
||||
// ...row,
|
||||
// options: {
|
||||
// ...row.options,
|
||||
// notChannels,
|
||||
// },
|
||||
// };
|
||||
// });
|
||||
|
||||
return (
|
||||
<Page>
|
||||
{rowDataWithGenericOptions.map(({ title, link, help, options = {} }) => (
|
||||
{/* {rowDataWithGenericOptions.map(({ title, link, help, options = {} }) => (
|
||||
<div key={title} className="claim-grid__wrapper">
|
||||
<h1 className="section__actions">
|
||||
{link ? (
|
||||
@@ -120,17 +117,17 @@ function ChannelsFollowingDiscover(props: Props) {
|
||||
|
||||
<ClaimTilesDiscover {...options} />
|
||||
</div>
|
||||
))}
|
||||
<h1 id={MORE_CHANNELS_ANCHOR} className="claim-grid__title">
|
||||
{__('More Channels')}
|
||||
</h1>
|
||||
{/* odysee: claimIds = PRIMARY_CONTENT_CHANNEL_IDS if simplesite CLD */}
|
||||
))} */}
|
||||
|
||||
<ClaimListDiscover
|
||||
defaultOrderBy={CS.ORDER_BY_TRENDING}
|
||||
defaultFreshness={CS.FRESH_ALL}
|
||||
claimType={CS.CLAIM_CHANNEL}
|
||||
claimIds={SIMPLE_SITE ? PRIMARY_CONTENT_CHANNEL_IDS : undefined}
|
||||
scrollAnchor={MORE_CHANNELS_ANCHOR}
|
||||
maxPages={3}
|
||||
hideFilters
|
||||
header={<h1 className="section__title">{__('Moon cheese is an acquired taste')}</h1>}
|
||||
/>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
makeSelectClaimIsPending,
|
||||
makeSelectClaimForClaimId,
|
||||
makeSelectCollectionIsMine,
|
||||
doLocalCollectionDelete,
|
||||
doCollectionDelete,
|
||||
doCollectionEdit,
|
||||
makeSelectChannelForClaimUri,
|
||||
makeSelectCountForCollectionId,
|
||||
@@ -50,7 +50,7 @@ const select = (state, props) => {
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
fetchCollectionItems: (claimId, cb) => dispatch(doFetchItemsInCollection({ collectionId: claimId }, cb)), // if this collection is not resolved, resolve it
|
||||
deleteCollection: (id) => dispatch(doLocalCollectionDelete(id)),
|
||||
deleteCollection: (id, colKey) => dispatch(doCollectionDelete(id, colKey)),
|
||||
editCollection: (id, params) => dispatch(doCollectionEdit(id, params)),
|
||||
});
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import * as PAGES from 'constants/pages';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import CollectionEdit from 'component/collectionEdit';
|
||||
import Card from 'component/common/card';
|
||||
import Button from 'component/button';
|
||||
import CollectionActions from 'component/collectionActions';
|
||||
import classnames from 'classnames';
|
||||
import ClaimAuthor from 'component/claimAuthor';
|
||||
@@ -32,7 +33,7 @@ type Props = {
|
||||
isMyCollection: boolean,
|
||||
claimIsPending: boolean,
|
||||
collectionHasEdits: boolean,
|
||||
deleteCollection: (string) => void,
|
||||
deleteCollection: (string, string) => void,
|
||||
editCollection: (string, CollectionEditParams) => void,
|
||||
fetchCollectionItems: (string, () => void) => void,
|
||||
resolveUris: (string) => void,
|
||||
@@ -51,6 +52,7 @@ export default function CollectionPage(props: Props) {
|
||||
claimIsPending,
|
||||
isResolvingCollection,
|
||||
fetchCollectionItems,
|
||||
deleteCollection,
|
||||
} = props;
|
||||
|
||||
const {
|
||||
@@ -83,7 +85,14 @@ export default function CollectionPage(props: Props) {
|
||||
</div>
|
||||
);
|
||||
|
||||
const unpublished = <span className="help">{__('Unpublished Edit')}</span>;
|
||||
const unpublished = (
|
||||
<Button
|
||||
button="close"
|
||||
icon={ICONS.REFRESH}
|
||||
label={__('Clear Edits')}
|
||||
onClick={() => deleteCollection(collectionId, COLLECTIONS_CONSTS.COL_KEY_EDITED)}
|
||||
/>
|
||||
);
|
||||
|
||||
let titleActions;
|
||||
if (collectionHasEdits) {
|
||||
@@ -104,7 +113,6 @@ export default function CollectionPage(props: Props) {
|
||||
<span>
|
||||
<Icon icon={ICONS.STACK} className="icon--margin-right" />
|
||||
{claim ? claim.value.title || claim.name : collection && collection.name}
|
||||
{collectionHasEdits && <span className={'collection-title__hasEdits'}>(*)</span>}
|
||||
</span>
|
||||
}
|
||||
titleActions={titleActions}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { SHOW_ADS, DOMAIN, SIMPLE_SITE } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import React, { useRef } from 'react';
|
||||
import Page from 'component/page';
|
||||
import ClaimListDiscover from 'component/claimListDiscover';
|
||||
@@ -11,11 +12,11 @@ import { useIsMobile } from 'effects/use-screensize';
|
||||
import analytics from 'analytics';
|
||||
import HiddenNsfw from 'component/common/hidden-nsfw';
|
||||
import Icon from 'component/common/icon';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import Ads from 'web/component/ads';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import useGetLivestreams from 'effects/use-get-livestreams';
|
||||
import moment from 'moment';
|
||||
|
||||
type Props = {
|
||||
location: { search: string },
|
||||
@@ -97,8 +98,8 @@ function DiscoverPage(props: Props) {
|
||||
} else {
|
||||
headerLabel = (
|
||||
<span>
|
||||
<Icon icon={(dynamicRouteProps && dynamicRouteProps.icon) || ICONS.DISCOVER} size={10} />
|
||||
{(dynamicRouteProps && dynamicRouteProps.title) || __('All Content')}
|
||||
<Icon icon={(dynamicRouteProps && dynamicRouteProps.icon) || ICONS.WILD_WEST} size={10} />
|
||||
{(dynamicRouteProps && dynamicRouteProps.title) || __('Wild West')}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -106,9 +107,11 @@ function DiscoverPage(props: Props) {
|
||||
return (
|
||||
<Page noFooter fullWidthPage={tileLayout}>
|
||||
<ClaimListDiscover
|
||||
limitClaimsPerChannel={3}
|
||||
hideAdvancedFilter
|
||||
hideFilters={!dynamicRouteProps}
|
||||
header={repostedUri ? <span /> : undefined}
|
||||
tileLayout={repostedUri ? false : tileLayout}
|
||||
defaultOrderBy={dynamicRouteProps ? undefined : CS.ORDER_BY_TRENDING}
|
||||
claimType={claimType ? [claimType] : undefined}
|
||||
headerLabel={headerLabel}
|
||||
tags={tags}
|
||||
@@ -117,9 +120,18 @@ function DiscoverPage(props: Props) {
|
||||
injectedItem={
|
||||
SHOW_ADS && IS_WEB ? (SIMPLE_SITE ? false : !isAuthenticated && <Ads small type={'video'} />) : false
|
||||
}
|
||||
// Assume wild west page if no dynamicRouteProps
|
||||
// Not a very good solution, but just doing it for now
|
||||
// until we are sure this page will stay around
|
||||
releaseTime={!dynamicRouteProps && `>${Math.floor(moment().subtract(1, 'day').startOf('week').unix())}`}
|
||||
feeAmount={!dynamicRouteProps && CS.FEE_AMOUNT_ANY}
|
||||
channelIds={
|
||||
(dynamicRouteProps && dynamicRouteProps.options && dynamicRouteProps.options.channelIds) || undefined
|
||||
}
|
||||
limitClaimsPerChannel={
|
||||
(dynamicRouteProps && dynamicRouteProps.options && dynamicRouteProps.options.limitClaimsPerChannel) ||
|
||||
undefined
|
||||
}
|
||||
meta={
|
||||
!dynamicRouteProps ? (
|
||||
<a
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import Page from 'component/page';
|
||||
@@ -11,6 +12,9 @@ import RecommendedContent from 'component/recommendedContent';
|
||||
import CollectionContent from 'component/collectionContentSidebar';
|
||||
import CommentsList from 'component/commentsList';
|
||||
import PostViewer from 'component/postViewer';
|
||||
import { Redirect } from 'react-router';
|
||||
import Button from 'component/button';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import Empty from 'component/common/empty';
|
||||
|
||||
export const PRIMARY_PLAYER_WRAPPER_CLASS = 'file-page__video-container';
|
||||
@@ -30,7 +34,9 @@ type Props = {
|
||||
collection?: Collection,
|
||||
collectionId: string,
|
||||
videoTheaterMode: boolean,
|
||||
claimIsMine: boolean,
|
||||
commentsDisabled: boolean,
|
||||
isLivestream: boolean,
|
||||
};
|
||||
|
||||
function FilePage(props: Props) {
|
||||
@@ -47,9 +53,12 @@ function FilePage(props: Props) {
|
||||
linkedComment,
|
||||
setPrimaryUri,
|
||||
videoTheaterMode,
|
||||
|
||||
claimIsMine,
|
||||
commentsDisabled,
|
||||
collection,
|
||||
collectionId,
|
||||
isLivestream,
|
||||
} = props;
|
||||
const cost = costInfo ? costInfo.cost : null;
|
||||
const hasFileInfo = fileInfo !== undefined;
|
||||
@@ -118,6 +127,10 @@ function FilePage(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
if (!claimIsMine && isLivestream) {
|
||||
return <Redirect to={`/$/${PAGES.LIVESTREAM}`} />;
|
||||
}
|
||||
|
||||
if (obscureNsfw && isMature) {
|
||||
return (
|
||||
<Page className="file-page" filePage isMarkdown={isMarkdown}>
|
||||
@@ -138,6 +151,18 @@ function FilePage(props: Props) {
|
||||
{!isMarkdown && (
|
||||
<div className="file-page__secondary-content">
|
||||
<div>
|
||||
{claimIsMine && isLivestream && (
|
||||
<div className="livestream__creator-message">
|
||||
<h4>{__('Only visible to you')}</h4>
|
||||
<I18nMessage>
|
||||
People who view this link will be redirected to your livestream. Make sure to use this for sharing
|
||||
so your title and thumbnail are displayed properly.
|
||||
</I18nMessage>
|
||||
<div className="section__actions">
|
||||
<Button button="primary" navigate={`/$/${PAGES.LIVESTREAM}`} label={__('View livestream')} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{RENDER_MODES.FLOATING_MODES.includes(renderMode) && <FileTitleSection uri={uri} />}
|
||||
{commentsDisabled && <Empty text={__('The creator of this content has disabled comments.')} />}
|
||||
{!commentsDisabled && <CommentsList uri={uri} linkedComment={linkedComment} />}
|
||||
|
||||
+14
-1
@@ -81,6 +81,13 @@ function HomePage(props: Props) {
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<h1 className="home__meme">
|
||||
<Button button="link" href="https://odysee.com/@Odysee:8?view=discussion">
|
||||
{__("this cave is not a natural formation")}
|
||||
</Button>
|
||||
</h1>
|
||||
|
||||
{rowData.map(({ title, route, link, icon, help, options = {} }, index) => (
|
||||
<div key={title} className="claim-grid__wrapper">
|
||||
{index !== 0 && title && typeof title === 'string' && (
|
||||
@@ -93,7 +100,13 @@ function HomePage(props: Props) {
|
||||
</h1>
|
||||
)}
|
||||
|
||||
<ClaimTilesDiscover {...options} liveLivestreamsFirst livestreamMap={livestreamMap} hasSource />
|
||||
<ClaimTilesDiscover
|
||||
{...options}
|
||||
liveLivestreamsFirst
|
||||
livestreamMap={livestreamMap}
|
||||
hasSource
|
||||
pin={route === `/$/${PAGES.GENERAL}`}
|
||||
/>
|
||||
{(route || link) && (
|
||||
<Button
|
||||
className="claim-grid__title--secondary"
|
||||
|
||||
@@ -14,12 +14,12 @@ import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import SearchPage from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const showMature = selectShowMatureContent(state);
|
||||
const urlParams = new URLSearchParams(props.location.search);
|
||||
let urlQuery = urlParams.get('q') || null;
|
||||
if (urlQuery) {
|
||||
urlQuery = urlQuery.replace(/^lbry:\/\//i, '').replace(/\//, ' ');
|
||||
}
|
||||
const showMature = selectShowMatureContent(state);
|
||||
const query = makeSelectQueryWithOptions(
|
||||
urlQuery,
|
||||
SIMPLE_SITE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
// import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as React from 'react';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
@@ -17,7 +17,7 @@ import classnames from 'classnames';
|
||||
import { getPasswordFromCookie } from 'util/saved-passwords';
|
||||
// $FlowFixMe
|
||||
import homepages from 'homepages';
|
||||
import { Lbryio } from 'lbryinc';
|
||||
// import { Lbryio } from 'lbryinc';
|
||||
import Yrbl from 'component/yrbl';
|
||||
|
||||
type Price = {
|
||||
@@ -170,7 +170,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||
const {
|
||||
daemonSettings,
|
||||
allowAnalytics,
|
||||
showNsfw,
|
||||
// showNsfw,
|
||||
isAuthenticated,
|
||||
currentTheme,
|
||||
themes,
|
||||
@@ -183,12 +183,12 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||
setClientSetting,
|
||||
toggle3PAnalytics,
|
||||
floatingPlayer,
|
||||
hideReposts,
|
||||
// hideReposts,
|
||||
clearPlayingUri,
|
||||
darkModeTimes,
|
||||
clearCache,
|
||||
openModal,
|
||||
myChannelUrls,
|
||||
// openModal,
|
||||
} = this.props;
|
||||
const { storedPassword } = this.state;
|
||||
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
|
||||
@@ -358,7 +358,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
{/* <FormField
|
||||
type="checkbox"
|
||||
name="hide_reposts"
|
||||
onChange={(e) => {
|
||||
@@ -372,7 +372,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||
checked={hideReposts}
|
||||
label={__('Hide reposts')}
|
||||
helper={__('You will not see reposts by people you follow or receive email notifying about them.')}
|
||||
/>
|
||||
/> */}
|
||||
|
||||
{/* <FormField
|
||||
type="checkbox"
|
||||
@@ -383,7 +383,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||
helper={__('Anonymous content is published without a channel.')}
|
||||
/> */}
|
||||
|
||||
<FormField
|
||||
{/* <FormField
|
||||
type="checkbox"
|
||||
name="show_nsfw"
|
||||
onChange={() =>
|
||||
@@ -396,7 +396,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
|
||||
helper={__(
|
||||
'Mature content may include nudity, intense sexuality, profanity, or other adult content. By displaying mature content, you are affirming you are of legal age to view mature content in your country or jurisdiction. '
|
||||
)}
|
||||
/>
|
||||
/> */}
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -30,6 +30,7 @@ type Props = {
|
||||
claimIsMine: boolean,
|
||||
claimIsPending: boolean,
|
||||
isLivestream: boolean,
|
||||
claimIsMine: Boolean,
|
||||
beginPublish: (string) => void,
|
||||
collectionId: string,
|
||||
collection: Collection,
|
||||
@@ -84,7 +85,12 @@ function ShowPage(props: Props) {
|
||||
// Only redirect if we are in lbry.tv land
|
||||
// replaceState will fail if on a different domain (like webcache.googleusercontent.com)
|
||||
if (canonicalUrlPath !== window.location.pathname && DOMAIN === window.location.hostname) {
|
||||
history.replaceState(history.state, '', canonicalUrlPath);
|
||||
const urlParams = new URLSearchParams(search);
|
||||
if (urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID)) {
|
||||
const listId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID) || '';
|
||||
urlParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId);
|
||||
}
|
||||
history.replaceState(history.state, '', `${canonicalUrlPath}?${urlParams.toString()}`);
|
||||
}
|
||||
}
|
||||
// @endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
import * as REACTION_TYPES from 'constants/reactions';
|
||||
import { Lbry, parseURI, buildURI, selectClaimsByUri, selectMyChannelClaims } from 'lbry-redux';
|
||||
// import { BANNED_LIVESTREAM_WORDS } from 'constants/comment';
|
||||
import { doToast, doSeeNotifications } from 'redux/actions/notifications';
|
||||
import {
|
||||
makeSelectCommentIdsForUri,
|
||||
@@ -531,13 +532,13 @@ export function doCommentModToggleBlock(channelUri: string, showLink: boolean, u
|
||||
|
||||
const sharedModBlockParams = unblock
|
||||
? {
|
||||
un_blocked_channel_id: creatorIdForAction,
|
||||
un_blocked_channel_name: creatorNameForAction,
|
||||
}
|
||||
un_blocked_channel_id: creatorIdForAction,
|
||||
un_blocked_channel_name: creatorNameForAction,
|
||||
}
|
||||
: {
|
||||
blocked_channel_id: creatorIdForAction,
|
||||
blocked_channel_name: creatorNameForAction,
|
||||
};
|
||||
blocked_channel_id: creatorIdForAction,
|
||||
blocked_channel_name: creatorNameForAction,
|
||||
};
|
||||
|
||||
const commentAction = unblock ? Comments.moderation_unblock : Comments.moderation_block;
|
||||
|
||||
@@ -564,15 +565,11 @@ export function doCommentModToggleBlock(channelUri: string, showLink: boolean, u
|
||||
data: { channelUri },
|
||||
});
|
||||
|
||||
dispatch(
|
||||
doToast({
|
||||
message: __(
|
||||
!unblock ? 'Channel blocked. They will not interact with you again.' : 'Channel unblocked!'
|
||||
),
|
||||
linkText: __(showLink ? 'See All' : ''),
|
||||
linkTarget: '/settings/block_and_mute',
|
||||
})
|
||||
);
|
||||
dispatch(doToast({
|
||||
message: __(!unblock ? 'Channel blocked. They will not interact with you again.' : 'Channel unblocked!'),
|
||||
linkText: __(showLink ? 'See All' : ''),
|
||||
linkTarget: '/settings/block_and_mute',
|
||||
}));
|
||||
})
|
||||
.catch(() => {
|
||||
dispatch({
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
import { SEARCH_OPTIONS } from 'constants/search';
|
||||
import { buildURI, doResolveUris, batchActions, isURIValid, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import {
|
||||
makeSelectSearchUris,
|
||||
@@ -135,6 +136,10 @@ export const doFetchRecommendedContent = (uri: string, mature: boolean) => (disp
|
||||
if (!mature) {
|
||||
options['nsfw'] = false;
|
||||
}
|
||||
|
||||
options[SEARCH_OPTIONS.CLAIM_TYPE] = SEARCH_OPTIONS.INCLUDE_FILES;
|
||||
options[SEARCH_OPTIONS.MEDIA_VIDEO] = true;
|
||||
|
||||
const { title } = claim.value;
|
||||
if (title && options) {
|
||||
dispatch(doSearch(title, options));
|
||||
|
||||
@@ -11,9 +11,9 @@ const defaultState: SearchState = {
|
||||
[SEARCH_OPTIONS.CLAIM_TYPE]: SEARCH_OPTIONS.INCLUDE_FILES_AND_CHANNELS,
|
||||
[SEARCH_OPTIONS.MEDIA_AUDIO]: true,
|
||||
[SEARCH_OPTIONS.MEDIA_VIDEO]: true,
|
||||
[SEARCH_OPTIONS.MEDIA_TEXT]: true,
|
||||
[SEARCH_OPTIONS.MEDIA_IMAGE]: true,
|
||||
[SEARCH_OPTIONS.MEDIA_APPLICATION]: true,
|
||||
[SEARCH_OPTIONS.MEDIA_TEXT]: false,
|
||||
[SEARCH_OPTIONS.MEDIA_IMAGE]: false,
|
||||
[SEARCH_OPTIONS.MEDIA_APPLICATION]: false,
|
||||
},
|
||||
urisByQuery: {},
|
||||
hasReachedMaxResultsLength: {},
|
||||
|
||||
@@ -8,7 +8,7 @@ import { UNSYNCED_SETTINGS } from 'config';
|
||||
const { CLIENT_SYNC_KEYS } = SHARED_PREFERENCES;
|
||||
const settingsToIgnore = (UNSYNCED_SETTINGS && UNSYNCED_SETTINGS.trim().split(' ')) || [];
|
||||
const clientSyncKeys = settingsToIgnore.length
|
||||
? CLIENT_SYNC_KEYS.filter(k => !settingsToIgnore.includes(k))
|
||||
? CLIENT_SYNC_KEYS.filter((k) => !settingsToIgnore.includes(k))
|
||||
: CLIENT_SYNC_KEYS;
|
||||
|
||||
const reducers = {};
|
||||
@@ -70,7 +70,7 @@ const defaultState = {
|
||||
[SETTINGS.AUTOPLAY_NEXT]: true,
|
||||
[SETTINGS.FLOATING_PLAYER]: true,
|
||||
[SETTINGS.AUTO_DOWNLOAD]: true,
|
||||
[SETTINGS.HIDE_REPOSTS]: false,
|
||||
[SETTINGS.HIDE_REPOSTS]: true,
|
||||
|
||||
// OS
|
||||
[SETTINGS.AUTO_LAUNCH]: true,
|
||||
@@ -89,12 +89,12 @@ reducers[ACTIONS.REHYDRATE] = (state, action) => {
|
||||
return Object.assign({}, state, { clientSettings });
|
||||
};
|
||||
|
||||
reducers[ACTIONS.FINDING_FFMPEG_STARTED] = state =>
|
||||
reducers[ACTIONS.FINDING_FFMPEG_STARTED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
findingFFmpeg: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.FINDING_FFMPEG_COMPLETED] = state =>
|
||||
reducers[ACTIONS.FINDING_FFMPEG_COMPLETED] = (state) =>
|
||||
Object.assign({}, state, {
|
||||
findingFFmpeg: false,
|
||||
});
|
||||
@@ -120,7 +120,7 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
|
||||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.UPDATE_IS_NIGHT] = state => {
|
||||
reducers[ACTIONS.UPDATE_IS_NIGHT] = (state) => {
|
||||
const { from, to } = state.clientSettings[SETTINGS.DARK_MODE_TIMES];
|
||||
const momentNow = moment();
|
||||
const startNightMoment = moment(from.formattedTime, 'HH:mm');
|
||||
@@ -155,7 +155,7 @@ reducers[LBRY_REDUX_ACTIONS.SHARED_PREFERENCE_SET] = (state, action) => {
|
||||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.SYNC_CLIENT_SETTINGS] = state => {
|
||||
reducers[ACTIONS.SYNC_CLIENT_SETTINGS] = (state) => {
|
||||
const { clientSettings } = state;
|
||||
const sharedPreferences = Object.assign({}, state.sharedPreferences);
|
||||
const selectedClientSettings = getSubsetFromKeysArray(clientSettings, clientSyncKeys);
|
||||
|
||||
@@ -258,8 +258,7 @@ export const makeSelectSigningIsMine = (rawUri: string) => {
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
const repostedChannel = claims && claims[uri] && claims[uri].reposted_claim && (claims[uri].reposted_claim.signing_channel || claims[uri].reposted_claim);
|
||||
const signingChannel = claims && claims[uri] && (repostedChannel || claims[uri].signing_channel || claims[uri]);
|
||||
const signingChannel = claims && claims[uri] && (claims[uri].signing_channel || claims[uri]);
|
||||
|
||||
return signingChannel && myClaims.has(signingChannel.claim_id);
|
||||
});
|
||||
|
||||
@@ -620,6 +620,12 @@ svg + .button__label {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.button--file-action {
|
||||
&:first-child {
|
||||
margin-right: var(--spacing-s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.button--file-action {
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
}
|
||||
|
||||
.card__body-scrollable {
|
||||
overflow-y: scroll;
|
||||
overflow-y: auto;
|
||||
max-height: 30vh;
|
||||
}
|
||||
|
||||
|
||||
@@ -408,10 +408,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
.claim-grid__header--between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.claim-grid__title {
|
||||
font-weight: 300;
|
||||
font-size: var(--font-large);
|
||||
margin-right: var(--spacing-m);
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.claim-grid__title-span {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.claim-grid__title--empty {
|
||||
|
||||
@@ -211,13 +211,28 @@
|
||||
}
|
||||
|
||||
.file-viewer__overlay-logo {
|
||||
color: var(--color-white);
|
||||
font-weight: bold;
|
||||
height: 3.5rem;
|
||||
width: 12rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
height: 30px;
|
||||
stroke-width: 5px;
|
||||
&:hover {
|
||||
filter: drop-shadow(1px 2px 10px var(--color-gray-3));
|
||||
}
|
||||
|
||||
@media (max-width: $breakpoint-small) {
|
||||
margin-right: var(--spacing-m);
|
||||
width: 2.5rem;
|
||||
|
||||
.button__label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.file-viewer__overlay-logo--videoend {
|
||||
height: 3.5rem;
|
||||
width: 12rem;
|
||||
}
|
||||
|
||||
.file-viewer--is-playing:not(:hover) .file-viewer__embedded-header {
|
||||
@@ -227,11 +242,15 @@
|
||||
.file-viewer__embedded-header {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
opacity: 1;
|
||||
z-index: 2;
|
||||
height: 4rem;
|
||||
padding-left: var(--spacing-m);
|
||||
padding-right: var(--spacing-s);
|
||||
font-size: var(--font-large);
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
@@ -241,7 +260,6 @@
|
||||
border-top-right-radius: var(--border-radius);
|
||||
|
||||
.button {
|
||||
padding: var(--spacing-s);
|
||||
color: var(--color-white);
|
||||
z-index: 2;
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ input-submit {
|
||||
height: var(--height-checkbox);
|
||||
width: var(--height-checkbox);
|
||||
border: 1px solid var(--color-input-border);
|
||||
border-radius: var(--border-radius);
|
||||
border-radius: 3px;
|
||||
left: 0px;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: var(--border-radius);
|
||||
color: var(--color-text);
|
||||
position: relative;
|
||||
font-weight: var(--font-weight-bold);
|
||||
|
||||
|
||||
@@ -281,8 +281,8 @@ $discussion-header__height: 3rem;
|
||||
}
|
||||
|
||||
.livestream-superchat__banner {
|
||||
border-top-right-radius: var(--border-radius);
|
||||
border-bottom-right-radius: var(--border-radius);
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
padding: 0.25rem var(--spacing-s);
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
@@ -298,7 +298,7 @@ $discussion-header__height: 3rem;
|
||||
background-color: var(--color-superchat);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
transform: translateX(25%) translateY(50%);
|
||||
transform: translateX(0) translateY(50%);
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
@@ -316,6 +316,11 @@ $discussion-header__height: 3rem;
|
||||
.livestream-comment__text {
|
||||
padding-right: var(--spacing-xxs);
|
||||
padding-bottom: var(--spacing-xxs);
|
||||
.markdown-preview {
|
||||
p {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.livestream-superchat__tooltip-amount {
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: $breakpoint-small) {
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.navigation--mac {
|
||||
|
||||
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user