minor improvement: if not live yet, say users are waiting instead of watching
This commit is contained in:
parent
f0d0992d20
commit
e1531b03bf
3 changed files with 7 additions and 5 deletions
|
@ -8,17 +8,18 @@ type Props = {
|
|||
uri: string,
|
||||
livestream?: boolean,
|
||||
activeViewers?: number,
|
||||
stateOfViewers: string,
|
||||
};
|
||||
|
||||
function FileSubtitle(props: Props) {
|
||||
const { uri, livestream = false, activeViewers = 0 } = props;
|
||||
const { uri, livestream = false, activeViewers = 0, stateOfViewers } = props;
|
||||
|
||||
return (
|
||||
<div className="media__subtitle--between">
|
||||
<div className="file__viewdate">
|
||||
{livestream ? <span>{__('Right now')}</span> : <DateTime uri={uri} show={DateTime.SHOW_DATE} />}
|
||||
{livestream ? (
|
||||
<span>{__('%viewer_count% currently watching', { viewer_count: activeViewers })}</span>
|
||||
<span>{__('%viewer_count% currently %viewer_state%', { viewer_count: activeViewers, viewer_state: stateOfViewers })}</span>
|
||||
) : (
|
||||
<FileViewCount uri={uri} />
|
||||
)}
|
||||
|
|
|
@ -20,10 +20,11 @@ type Props = {
|
|||
isNsfwBlocked: boolean,
|
||||
livestream?: boolean,
|
||||
activeViewers?: number,
|
||||
stateOfViewers: string,
|
||||
};
|
||||
|
||||
function FileTitleSection(props: Props) {
|
||||
const { title, uri, nsfw, isNsfwBlocked, livestream = false, activeViewers } = props;
|
||||
const { title, uri, nsfw, isNsfwBlocked, livestream = false, activeViewers, stateOfViewers } = props;
|
||||
|
||||
return (
|
||||
<Card
|
||||
|
@ -43,7 +44,7 @@ function FileTitleSection(props: Props) {
|
|||
body={
|
||||
<React.Fragment>
|
||||
<ClaimInsufficientCredits uri={uri} />
|
||||
<FileSubtitle uri={uri} livestream={livestream} activeViewers={activeViewers} />
|
||||
<FileSubtitle uri={uri} livestream={livestream} activeViewers={activeViewers} stateOfViewers={stateOfViewers} />
|
||||
</React.Fragment>
|
||||
}
|
||||
actions={
|
||||
|
|
|
@ -41,7 +41,7 @@ export default function LivestreamLayout(props: Props) {
|
|||
})}
|
||||
</div>
|
||||
)}
|
||||
<FileTitleSection uri={uri} livestream isLive={isLive} activeViewers={activeViewers} />
|
||||
<FileTitleSection uri={uri} livestream isLive={isLive} activeViewers={activeViewers} stateOfViewers={isLive ? "watching" : "waiting"} />
|
||||
</div>
|
||||
<LivestreamComments uri={uri} />
|
||||
</>
|
||||
|
|
Loading…
Reference in a new issue