2019-05-07 04:35:04 +02:00
|
|
|
// @flow
|
2020-08-03 22:14:43 +02:00
|
|
|
import { SHOW_ADS } from 'config';
|
2020-06-18 17:10:46 +02:00
|
|
|
import * as CS from 'constants/claim_search';
|
|
|
|
import * as ICONS from 'constants/icons';
|
2019-05-07 04:35:04 +02:00
|
|
|
import React, { Fragment } from 'react';
|
|
|
|
import HiddenNsfwClaims from 'component/hiddenNsfwClaims';
|
2020-06-18 17:10:46 +02:00
|
|
|
import { useHistory } from 'react-router-dom';
|
2019-08-29 03:39:21 +02:00
|
|
|
import Button from 'component/button';
|
2020-02-28 15:40:18 +01:00
|
|
|
import ClaimListDiscover from 'component/claimListDiscover';
|
2020-05-07 20:44:11 +02:00
|
|
|
import Ads from 'web/component/ads';
|
2020-06-18 17:10:46 +02:00
|
|
|
import Icon from 'component/common/icon';
|
2021-03-19 21:14:31 +01:00
|
|
|
import LivestreamLink from 'component/livestreamLink';
|
2020-06-18 17:10:46 +02:00
|
|
|
import { Form, FormField } from 'component/common/form';
|
|
|
|
import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search';
|
2020-12-03 22:37:58 +01:00
|
|
|
import { lighthouse } from 'redux/actions/search';
|
2019-05-07 04:35:04 +02:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
uri: string,
|
|
|
|
totalPages: number,
|
|
|
|
fetching: boolean,
|
|
|
|
params: { page: number },
|
2019-11-22 02:37:25 +01:00
|
|
|
pageOfClaimsInChannel: Array<StreamClaim>,
|
2019-07-08 22:54:58 +02:00
|
|
|
channelIsBlocked: boolean,
|
2019-05-07 04:35:04 +02:00
|
|
|
channelIsMine: boolean,
|
|
|
|
fetchClaims: (string, number) => void,
|
2019-08-29 03:39:21 +02:00
|
|
|
channelIsBlackListed: boolean,
|
2020-04-22 14:07:09 +02:00
|
|
|
defaultPageSize?: number,
|
|
|
|
defaultInfiniteScroll?: Boolean,
|
2021-06-15 22:06:57 +02:00
|
|
|
claim: Claim,
|
2020-03-26 22:47:07 +01:00
|
|
|
isAuthenticated: boolean,
|
2020-06-18 17:10:46 +02:00
|
|
|
showMature: boolean,
|
2020-09-17 19:28:46 +02:00
|
|
|
tileLayout: boolean,
|
2021-03-04 18:55:16 +01:00
|
|
|
viewHiddenChannels: boolean,
|
2021-03-05 08:10:18 +01:00
|
|
|
doResolveUris: (Array<string>, boolean) => void,
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
claimType: string,
|
2021-06-10 23:01:32 +02:00
|
|
|
empty?: string,
|
2019-05-07 04:35:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function ChannelContent(props: Props) {
|
2020-04-22 14:07:09 +02:00
|
|
|
const {
|
|
|
|
uri,
|
|
|
|
fetching,
|
|
|
|
channelIsMine,
|
|
|
|
channelIsBlocked,
|
|
|
|
channelIsBlackListed,
|
|
|
|
claim,
|
|
|
|
isAuthenticated,
|
|
|
|
defaultPageSize = CS.PAGE_SIZE,
|
|
|
|
defaultInfiniteScroll = true,
|
2020-06-18 17:10:46 +02:00
|
|
|
showMature,
|
2020-09-17 19:28:46 +02:00
|
|
|
tileLayout,
|
2021-03-04 18:55:16 +01:00
|
|
|
viewHiddenChannels,
|
2021-03-05 08:10:18 +01:00
|
|
|
doResolveUris,
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
claimType,
|
2021-06-10 23:01:32 +02:00
|
|
|
empty,
|
2020-04-22 14:07:09 +02:00
|
|
|
} = props;
|
2019-12-13 23:32:20 +01:00
|
|
|
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
2020-06-18 17:10:46 +02:00
|
|
|
const [searchQuery, setSearchQuery] = React.useState('');
|
|
|
|
const [searchResults, setSearchResults] = React.useState(undefined);
|
|
|
|
const {
|
|
|
|
location: { pathname, search },
|
|
|
|
} = useHistory();
|
|
|
|
const url = `${pathname}${search}`;
|
|
|
|
const claimId = claim && claim.claim_id;
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
const showFilters = !claimType || claimType === 'stream';
|
2020-06-18 17:10:46 +02:00
|
|
|
|
|
|
|
function handleInputChange(e) {
|
|
|
|
const { value } = e.target;
|
|
|
|
setSearchQuery(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
const timer = setTimeout(() => {
|
|
|
|
if (searchQuery === '' || !claimId) {
|
|
|
|
// In order to display original search results, search results must be set to null. A query of '' should display original results.
|
|
|
|
return setSearchResults(null);
|
|
|
|
} else {
|
2020-12-03 22:37:58 +01:00
|
|
|
lighthouse
|
|
|
|
.search(
|
|
|
|
`s=${encodeURIComponent(searchQuery)}&channel_id=${encodeURIComponent(claimId)}${
|
2021-03-17 20:52:23 +01:00
|
|
|
!showMature ? '&nsfw=false&size=50&from=0' : ''
|
2020-12-03 22:37:58 +01:00
|
|
|
}`
|
|
|
|
)
|
2021-02-18 08:54:30 +01:00
|
|
|
.then((results) => {
|
2020-12-03 22:37:58 +01:00
|
|
|
const urls = results.map(({ name, claimId }) => {
|
|
|
|
return `lbry://${name}#${claimId}`;
|
|
|
|
});
|
|
|
|
|
2021-03-05 08:10:18 +01:00
|
|
|
// Batch-resolve the urls before calling 'setSearchResults', as the
|
|
|
|
// latter will immediately cause the tiles to resolve, ending up
|
|
|
|
// calling doResolveUri one by one before the batched one.
|
|
|
|
doResolveUris(urls, true);
|
|
|
|
|
2020-12-03 22:37:58 +01:00
|
|
|
setSearchResults(urls);
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
setSearchResults(null);
|
|
|
|
});
|
2020-06-18 17:10:46 +02:00
|
|
|
}
|
|
|
|
}, DEBOUNCE_WAIT_DURATION_MS);
|
|
|
|
return () => clearTimeout(timer);
|
|
|
|
}, [claimId, searchQuery, showMature]);
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
setSearchQuery('');
|
|
|
|
setSearchResults(null);
|
|
|
|
}, [url]);
|
2020-02-28 15:40:18 +01:00
|
|
|
|
2019-05-07 04:35:04 +02:00
|
|
|
return (
|
|
|
|
<Fragment>
|
2020-02-28 15:40:18 +01:00
|
|
|
{!fetching && Boolean(claimsInChannel) && !channelIsBlocked && !channelIsBlackListed && (
|
|
|
|
<HiddenNsfwClaims uri={uri} />
|
2019-12-13 23:32:20 +01:00
|
|
|
)}
|
|
|
|
|
2021-03-19 21:14:31 +01:00
|
|
|
<LivestreamLink uri={uri} />
|
|
|
|
|
2019-08-29 03:39:21 +02:00
|
|
|
{!fetching && channelIsBlackListed && (
|
|
|
|
<section className="card card--section">
|
|
|
|
<p>
|
|
|
|
{__(
|
|
|
|
'In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this channel from our applications.'
|
|
|
|
)}
|
|
|
|
</p>
|
2020-05-01 19:55:42 +02:00
|
|
|
<div className="section__actions">
|
2019-08-29 03:39:21 +02:00
|
|
|
<Button button="link" href="https://lbry.com/faq/dmca" label={__('Read More')} />
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
)}
|
|
|
|
|
2019-07-08 22:54:58 +02:00
|
|
|
{!fetching && channelIsBlocked && (
|
|
|
|
<div className="card--section">
|
2019-08-02 17:11:31 +02:00
|
|
|
<h2 className="help">{__('You have blocked this channel content.')}</h2>
|
2019-07-08 22:54:58 +02:00
|
|
|
</div>
|
|
|
|
)}
|
2019-05-07 04:35:04 +02:00
|
|
|
|
2020-02-28 15:40:18 +01:00
|
|
|
{!channelIsMine && claimsInChannel > 0 && <HiddenNsfwClaims uri={uri} />}
|
2019-10-27 15:41:43 +01:00
|
|
|
|
2021-06-15 22:06:57 +02:00
|
|
|
<ClaimListDiscover
|
odysee
fix replay select styling
make meme a link
Fix audio references
get newest livestream claim in livestreamLink
pin crackermilk
fix livestream banner placement
fix live page
fix rebase
fix rebase
fix error nag
fix darkmode blockquote style
break word on livestream comment text
fix dark mode snack
fix live badge
fix lint
small fixes - word wrap, live badge
wip
Fix invisible snack in Odysee Light Theme
Revert "wip"
This reverts commit d17e477fe0e6633709ea30bdc403448825db4c71.
Revert "small fixes - word wrap, live badge"
This reverts commit 0e431d4038d774079c78f0de32238aac7260e4ca.
fix blank
pinned destiny
fix badges and homepage again
only get livestreams live for less than a day
pinned hammy and olivia
multi pin
pin destiny
updated pinned videos
update tagline
Update view.jsx
pins
updated destiny's video
updated pinned videos
removed destiny, added lie likes music
pinned destiny and mason's woodshop
removed hammy and olivia
unpinned mason's woodshop
removed pins
added hammy and olivia
pinned sam seder
unpinned destiny and hammy and olivia
Fix merge on ChannelThumbnails
- sam seder, + hammy & olivia and passion for food
update tagline (#6086)
removed everyone, added kona and suba
Theme color fixes (odysee) (#6089)
* Cherry-pick master's 'base-theme.scss'
* Non-functional cleanup (remove dups, re-order, etc.)
* Dark: update positive Toast to --color-primary as well.
This follows the intention of the refactoring, which I guess was (1) reduce the number of color names (2) reduce the number of customizations needed.
The only issue I have with this is that the current Odysee primary color is pink, which can be intepreted as an error.
The original (pre-refactoring color was green).
For now, I follow the refactoring path. We can tweak this later.
* Fix text color inside '--color-card-background-highlighted'
Light: use base-theme (it was the same value anyway).
Dark: use bright text.
* Dark: add some contrast between the components
The color for the background, header, card, placeholder, etc. is almost identical -- it looks like there are all in the same component. The almost-invisible border doesn't help. One would have to crank up the monitor's contrast setting to see separation of components.
Brighten up the components a bit, somewhat following the same scale as lbry.tv's dark theme.
Overall, I still think it's too dark. The Card's background color can still be brightened up further for better contrast, but I try not to make too drastic of a change for now.
The original lbry.tv's gray theme is the most pleasant theme I've seen so far, but this is all subjective.
changed pins
removed kona and suba
added destiny
changed pins
removed destiny
pinned sgtducky
changed pins
removed sgtducky
added hammy and olivia
added chrissie mayr
added the bite shot
changed pins
removed the bite shot
added heads of tech
changed pins
removed hammy and olivia
removed chrissie mayr
changed pins
removed heads of tech
added crackermilk
changed pins
removed crackermilk
added some ordinary gamer
added passion for food
changed pins
removed some ordinary gamers
removed passion for food
added emmy hucker
changed pins
added game knights
Update view.jsx
Force rebuild
changed pins
removed emmy hucker
changed pins
removed game knights
added crackermilk
changed pins
removed crackermilk
added some ordinary gamer
changed pins
removed some ordinary gamers
added passion for food
added green renaissance
changed pins
removed passion for food
removed green renaissance
added expand love
changed pins
removed expand love
added dr nora
change tagline (#6122)
there's so much room for activities
comment out music
changed pins
removed dr nora
added kona and suba
changed pins
removed kona and suba
added destiny
changed pins
removed destiny
added crackermilk
changed pins
removed crackermilk
added someordinarygamers
change tagline
Drake, where's the door hole?
changed pins
unpinned someordinarygamers
pinned kona and suba
Add message for mature content
changed pin
changed pins
removed creative model
changed pins
added bcpov
added krish mohan
added cigarvixen
changed pins
removed krish mohan
added adrian logan
bump
fix footer
change tagline
just like the simulations
changed pins
removed:
bcpov
cigarvixen
adrian logan
added:
someordinarygamers
quick fix for reposts
oops
fix channel tabs
changed pin
removed someordinarygamers
added kona and suba
changed pins
removed kona and suba
added dirtyworkz
added crackermilk
2021-06-11 19:47:56 +02:00
|
|
|
hideLivestreamClaims
|
2021-06-15 22:06:57 +02:00
|
|
|
showHiddenByUser={viewHiddenChannels}
|
|
|
|
forceShowReposts
|
|
|
|
hideFilters={!showFilters}
|
|
|
|
hideAdvancedFilter={!showFilters}
|
|
|
|
tileLayout={tileLayout}
|
|
|
|
uris={searchResults}
|
odysee
fix replay select styling
make meme a link
Fix audio references
get newest livestream claim in livestreamLink
pin crackermilk
fix livestream banner placement
fix live page
fix rebase
fix rebase
fix error nag
fix darkmode blockquote style
break word on livestream comment text
fix dark mode snack
fix live badge
fix lint
small fixes - word wrap, live badge
wip
Fix invisible snack in Odysee Light Theme
Revert "wip"
This reverts commit d17e477fe0e6633709ea30bdc403448825db4c71.
Revert "small fixes - word wrap, live badge"
This reverts commit 0e431d4038d774079c78f0de32238aac7260e4ca.
fix blank
pinned destiny
fix badges and homepage again
only get livestreams live for less than a day
pinned hammy and olivia
multi pin
pin destiny
updated pinned videos
update tagline
Update view.jsx
pins
updated destiny's video
updated pinned videos
removed destiny, added lie likes music
pinned destiny and mason's woodshop
removed hammy and olivia
unpinned mason's woodshop
removed pins
added hammy and olivia
pinned sam seder
unpinned destiny and hammy and olivia
Fix merge on ChannelThumbnails
- sam seder, + hammy & olivia and passion for food
update tagline (#6086)
removed everyone, added kona and suba
Theme color fixes (odysee) (#6089)
* Cherry-pick master's 'base-theme.scss'
* Non-functional cleanup (remove dups, re-order, etc.)
* Dark: update positive Toast to --color-primary as well.
This follows the intention of the refactoring, which I guess was (1) reduce the number of color names (2) reduce the number of customizations needed.
The only issue I have with this is that the current Odysee primary color is pink, which can be intepreted as an error.
The original (pre-refactoring color was green).
For now, I follow the refactoring path. We can tweak this later.
* Fix text color inside '--color-card-background-highlighted'
Light: use base-theme (it was the same value anyway).
Dark: use bright text.
* Dark: add some contrast between the components
The color for the background, header, card, placeholder, etc. is almost identical -- it looks like there are all in the same component. The almost-invisible border doesn't help. One would have to crank up the monitor's contrast setting to see separation of components.
Brighten up the components a bit, somewhat following the same scale as lbry.tv's dark theme.
Overall, I still think it's too dark. The Card's background color can still be brightened up further for better contrast, but I try not to make too drastic of a change for now.
The original lbry.tv's gray theme is the most pleasant theme I've seen so far, but this is all subjective.
changed pins
removed kona and suba
added destiny
changed pins
removed destiny
pinned sgtducky
changed pins
removed sgtducky
added hammy and olivia
added chrissie mayr
added the bite shot
changed pins
removed the bite shot
added heads of tech
changed pins
removed hammy and olivia
removed chrissie mayr
changed pins
removed heads of tech
added crackermilk
changed pins
removed crackermilk
added some ordinary gamer
added passion for food
changed pins
removed some ordinary gamers
removed passion for food
added emmy hucker
changed pins
added game knights
Update view.jsx
Force rebuild
changed pins
removed emmy hucker
changed pins
removed game knights
added crackermilk
changed pins
removed crackermilk
added some ordinary gamer
changed pins
removed some ordinary gamers
added passion for food
added green renaissance
changed pins
removed passion for food
removed green renaissance
added expand love
changed pins
removed expand love
added dr nora
change tagline (#6122)
there's so much room for activities
comment out music
changed pins
removed dr nora
added kona and suba
changed pins
removed kona and suba
added destiny
changed pins
removed destiny
added crackermilk
changed pins
removed crackermilk
added someordinarygamers
change tagline
Drake, where's the door hole?
changed pins
unpinned someordinarygamers
pinned kona and suba
Add message for mature content
changed pin
changed pins
removed creative model
changed pins
added bcpov
added krish mohan
added cigarvixen
changed pins
removed krish mohan
added adrian logan
bump
fix footer
change tagline
just like the simulations
changed pins
removed:
bcpov
cigarvixen
adrian logan
added:
someordinarygamers
quick fix for reposts
oops
fix channel tabs
changed pin
removed someordinarygamers
added kona and suba
changed pins
removed kona and suba
added dirtyworkz
added crackermilk
2021-06-11 19:47:56 +02:00
|
|
|
streamType={CS.CONTENT_ALL}
|
2021-06-15 22:06:57 +02:00
|
|
|
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}
|
|
|
|
/>
|
2019-05-07 04:35:04 +02:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-06-18 17:10:46 +02:00
|
|
|
export default ChannelContent;
|