Rename: use-thumbnail --> use-get-poster

This disambiguates the other effect file called `use-get-thumbnail`, and is also clearer.
This commit is contained in:
infinite-persistence 2022-06-16 12:04:52 +08:00
parent 5c939d0e32
commit 3e5a9ba193
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
3 changed files with 5 additions and 5 deletions

View file

@ -15,7 +15,7 @@ import { LivestreamContext } from 'page/livestream/view';
import { formatLbryUrlForWeb } from 'util/url'; import { formatLbryUrlForWeb } from 'util/url';
import FileViewerEmbeddedTitle from 'component/fileViewerEmbeddedTitle'; import FileViewerEmbeddedTitle from 'component/fileViewerEmbeddedTitle';
import useFetchLiveStatus from 'effects/use-fetch-live'; import useFetchLiveStatus from 'effects/use-fetch-live';
import useThumbnail from 'effects/use-thumbnail'; import useGetPoster from 'effects/use-get-poster';
type Props = { type Props = {
channelClaimId: ?string, channelClaimId: ?string,
@ -108,7 +108,7 @@ export default function FileRenderInitiator(props: Props) {
// in case of a livestream outside of the livestream page component, like embed // in case of a livestream outside of the livestream page component, like embed
useFetchLiveStatus(isLivestreamClaim && !livestreamPage ? channelClaimId : undefined, doFetchChannelLiveStatus); useFetchLiveStatus(isLivestreamClaim && !livestreamPage ? channelClaimId : undefined, doFetchChannelLiveStatus);
const thumbnail = useThumbnail(claimThumbnail, containerRef); const thumbnail = useGetPoster(claimThumbnail, containerRef);
function handleClick() { function handleClick() {
if (embedded && !isPlayable) { if (embedded && !isPlayable) {

View file

@ -4,7 +4,7 @@ import React from 'react';
// $FlowFixMe cannot resolve ... // $FlowFixMe cannot resolve ...
import FileRenderPlaceholder from 'static/img/fileRenderPlaceholder.png'; import FileRenderPlaceholder from 'static/img/fileRenderPlaceholder.png';
export default function useThumbnail(claimThumbnail: ?string, containerRef: any) { export default function useGetPoster(claimThumbnail: ?string, containerRef: any) {
const [thumbnail, setThumbnail] = React.useState(FileRenderPlaceholder); const [thumbnail, setThumbnail] = React.useState(FileRenderPlaceholder);
React.useEffect(() => { React.useEffect(() => {

View file

@ -13,7 +13,7 @@ import { useHistory } from 'react-router';
import Yrbl from 'component/yrbl'; import Yrbl from 'component/yrbl';
// $FlowFixMe cannot resolve ... // $FlowFixMe cannot resolve ...
import useFetchLiveStatus from 'effects/use-fetch-live'; import useFetchLiveStatus from 'effects/use-fetch-live';
import useThumbnail from 'effects/use-thumbnail'; import useGetPoster from 'effects/use-get-poster';
type Props = { type Props = {
uri: string, uri: string,
@ -119,7 +119,7 @@ export default function EmbedWrapperPage(props: Props) {
(outpoint.txid === txid && outpoint.nout === nout) (outpoint.txid === txid && outpoint.nout === nout)
); );
const thumbnail = useThumbnail(claimThumbnail, containerRef); const thumbnail = useGetPoster(claimThumbnail, containerRef);
React.useEffect(() => { React.useEffect(() => {
if (!latestClaimUrl && liveContentPath && claimId) { if (!latestClaimUrl && liveContentPath && claimId) {