2018-07-25 02:50:04 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import FileTile from 'component/fileTile';
|
|
|
|
import { FormRow, FormField } from 'component/common/form';
|
|
|
|
import ToolTip from 'component/common/tooltip';
|
|
|
|
import type { Claim } from 'types/claim';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
channelUri: ?string,
|
|
|
|
claimsInChannel: ?Array<Claim>,
|
|
|
|
fetchClaims: (string, number) => void,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default class RecommendedVideos extends React.PureComponent<Props> {
|
|
|
|
componentDidMount() {
|
|
|
|
const { channelUri, fetchClaims, claimsInChannel } = this.props;
|
2018-07-25 03:10:33 +02:00
|
|
|
if (channelUri && !claimsInChannel) {
|
2018-07-25 02:50:04 +02:00
|
|
|
fetchClaims(channelUri, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2018-07-25 03:10:33 +02:00
|
|
|
const { claimsInChannel } = this.props;
|
2018-07-25 02:50:04 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="card__list--recommended">
|
2018-07-25 03:10:33 +02:00
|
|
|
<FormRow>
|
2018-07-25 02:50:04 +02:00
|
|
|
<ToolTip onComponent body={__('Automatically download and play free content.')}>
|
|
|
|
<FormField
|
|
|
|
useToggle
|
|
|
|
noPadding
|
|
|
|
name="autoplay"
|
|
|
|
type="checkbox"
|
|
|
|
prefix={__('Autoplay')}
|
|
|
|
checked={false}
|
|
|
|
onChange={() => {}}
|
|
|
|
/>
|
|
|
|
</ToolTip>
|
|
|
|
</FormRow>
|
|
|
|
{claimsInChannel &&
|
|
|
|
claimsInChannel.map(({ permanent_url: permanentUrl }) => (
|
|
|
|
<FileTile
|
|
|
|
small
|
|
|
|
displayDescription={false}
|
|
|
|
key={permanentUrl}
|
|
|
|
uri={`lbry://${permanentUrl}`}
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|