show currently active playing item on playlist: #6204
This commit is contained in:
parent
ad7db1e939
commit
504f230d59
5 changed files with 27 additions and 9 deletions
|
@ -21,6 +21,7 @@ type Props = {
|
||||||
headerAltControls: Node,
|
headerAltControls: Node,
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
type: string,
|
type: string,
|
||||||
|
activeUri?: string,
|
||||||
empty?: string,
|
empty?: string,
|
||||||
defaultSort?: boolean,
|
defaultSort?: boolean,
|
||||||
onScrollBottom?: (any) => void,
|
onScrollBottom?: (any) => void,
|
||||||
|
@ -50,6 +51,7 @@ type Props = {
|
||||||
|
|
||||||
export default function ClaimList(props: Props) {
|
export default function ClaimList(props: Props) {
|
||||||
const {
|
const {
|
||||||
|
activeUri,
|
||||||
uris,
|
uris,
|
||||||
headerAltControls,
|
headerAltControls,
|
||||||
loading,
|
loading,
|
||||||
|
@ -190,6 +192,7 @@ export default function ClaimList(props: Props) {
|
||||||
<ClaimPreview
|
<ClaimPreview
|
||||||
uri={uri}
|
uri={uri}
|
||||||
type={type}
|
type={type}
|
||||||
|
active={activeUri && uri === activeUri}
|
||||||
hideMenu={hideMenu}
|
hideMenu={hideMenu}
|
||||||
includeSupportAction={includeSupportAction}
|
includeSupportAction={includeSupportAction}
|
||||||
showUnresolvedClaim={showUnresolvedClaims}
|
showUnresolvedClaim={showUnresolvedClaims}
|
||||||
|
|
|
@ -36,6 +36,7 @@ const AbandonedChannelPreview = lazyImport(() =>
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
claim: ?Claim,
|
claim: ?Claim,
|
||||||
|
active: boolean,
|
||||||
obscureNsfw: boolean,
|
obscureNsfw: boolean,
|
||||||
showUserBlocked: boolean,
|
showUserBlocked: boolean,
|
||||||
claimIsMine: boolean,
|
claimIsMine: boolean,
|
||||||
|
@ -113,6 +114,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
pending,
|
pending,
|
||||||
empty,
|
empty,
|
||||||
// modifiers
|
// modifiers
|
||||||
|
active,
|
||||||
customShouldHide,
|
customShouldHide,
|
||||||
showNullPlaceholder,
|
showNullPlaceholder,
|
||||||
// value from show mature content user setting
|
// value from show mature content user setting
|
||||||
|
@ -293,6 +295,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
'claim-preview__wrapper--inline': type === 'inline',
|
'claim-preview__wrapper--inline': type === 'inline',
|
||||||
'claim-preview__wrapper--small': type === 'small',
|
'claim-preview__wrapper--small': type === 'small',
|
||||||
'claim-preview__live': live,
|
'claim-preview__live': live,
|
||||||
|
'claim-preview__active': active,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -4,19 +4,19 @@ import {
|
||||||
makeSelectUrlsForCollectionId,
|
makeSelectUrlsForCollectionId,
|
||||||
makeSelectNameForCollectionId,
|
makeSelectNameForCollectionId,
|
||||||
makeSelectCollectionForId,
|
makeSelectCollectionForId,
|
||||||
makeSelectClaimForClaimId,
|
makeSelectClaimForUri,
|
||||||
makeSelectClaimIsMine,
|
makeSelectClaimIsMine,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
|
|
||||||
const select = (state, props) => {
|
const select = (state, props) => {
|
||||||
const claim = makeSelectClaimForClaimId(props.id)(state);
|
const claim = makeSelectClaimForUri(props.uri)(state);
|
||||||
const url = claim && claim.permanent_url;
|
const url = claim && claim.permanent_url;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
url,
|
||||||
collection: makeSelectCollectionForId(props.id)(state),
|
collection: makeSelectCollectionForId(props.id)(state),
|
||||||
collectionUrls: makeSelectUrlsForCollectionId(props.id)(state),
|
collectionUrls: makeSelectUrlsForCollectionId(props.id)(state),
|
||||||
collectionName: makeSelectNameForCollectionId(props.id)(state),
|
collectionName: makeSelectNameForCollectionId(props.id)(state),
|
||||||
claim,
|
|
||||||
isMine: makeSelectClaimIsMine(url)(state),
|
isMine: makeSelectClaimIsMine(url)(state),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,18 +9,17 @@ import * as ICONS from 'constants/icons';
|
||||||
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
import { COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
id: string,
|
||||||
|
url: string,
|
||||||
|
isMine: boolean,
|
||||||
collectionUrls: Array<Claim>,
|
collectionUrls: Array<Claim>,
|
||||||
collectionName: string,
|
collectionName: string,
|
||||||
collection: any,
|
collection: any,
|
||||||
createUnpublishedCollection: (string, Array<any>, ?string) => void,
|
createUnpublishedCollection: (string, Array<any>, ?string) => void,
|
||||||
id: string,
|
|
||||||
claim: Claim,
|
|
||||||
isMine: boolean,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function CollectionContent(props: Props) {
|
export default function CollectionContent(props: Props) {
|
||||||
const { collectionUrls, collectionName, id } = props;
|
const { collectionUrls, collectionName, id, url } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
isBodyList
|
isBodyList
|
||||||
|
@ -40,7 +39,16 @@ export default function CollectionContent(props: Props) {
|
||||||
<Button label={'View List'} button="link" navigate={`/$/${PAGES.LIST}/${id}`} />
|
<Button label={'View List'} button="link" navigate={`/$/${PAGES.LIST}/${id}`} />
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
body={<ClaimList isCardBody type="small" uris={collectionUrls} collectionId={id} empty={__('List is Empty')} />}
|
body={
|
||||||
|
<ClaimList
|
||||||
|
isCardBody
|
||||||
|
type="small"
|
||||||
|
activeUri={url}
|
||||||
|
uris={collectionUrls}
|
||||||
|
collectionId={id}
|
||||||
|
empty={__('List is Empty')}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -705,6 +705,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.claim-preview__active {
|
||||||
|
background-color: var(--color-card-background-highlighted);
|
||||||
|
}
|
||||||
|
|
||||||
.claim-preview__live {
|
.claim-preview__live {
|
||||||
.claim-preview__file-property-overlay {
|
.claim-preview__file-property-overlay {
|
||||||
opacity: 1; // The original 0.7 is not visible over bright thumbnails
|
opacity: 1; // The original 0.7 is not visible over bright thumbnails
|
||||||
|
|
Loading…
Add table
Reference in a new issue