show list of live stream claims

This commit is contained in:
DispatchCommit 2021-03-13 20:07:54 -08:00
parent 92e320e384
commit 99ec447bee

View file

@ -61,6 +61,7 @@ export default function CreatorDashboardPage(props: Props) {
const [isFetching, setIsFetching] = React.useState(true); const [isFetching, setIsFetching] = React.useState(true);
const [isLive, setIsLive] = React.useState(false); const [isLive, setIsLive] = React.useState(false);
const [livestreamClaim, setLivestreamClaim] = React.useState(false); const [livestreamClaim, setLivestreamClaim] = React.useState(false);
const [livestreamClaims, setLivestreamClaims] = React.useState(false);
React.useEffect(() => { React.useEffect(() => {
if (!activeChannelClaimStr) return; if (!activeChannelClaimStr) return;
@ -76,6 +77,7 @@ export default function CreatorDashboardPage(props: Props) {
if (res && res.items && res.items.length > 0) { if (res && res.items && res.items.length > 0) {
const claim = res.items[res.items.length - 1]; const claim = res.items[res.items.length - 1];
setLivestreamClaim(claim); setLivestreamClaim(claim);
setLivestreamClaims(res.items.reverse());
} else { } else {
setIsFetching(false); setIsFetching(false);
} }
@ -150,12 +152,21 @@ export default function CreatorDashboardPage(props: Props) {
} }
{/* Stream Claim(s) */} {/* Stream Claim(s) */}
{ livestreamClaim ? ( { livestreamClaim && livestreamClaims ? (
<div style={{marginTop: 'var(--spacing-l)'}}> <div style={{marginTop: 'var(--spacing-l)'}}>
<h3>Your LiveStream Claims</h3> <h3>Your LiveStream Claims</h3>
{livestreamClaims.map(claim => (
<ClaimPreview
key={claim.uri}
uri={claim.permanent_url}
/>
))}
{/*<h3>Your LiveStream Claims</h3>
<ClaimPreview <ClaimPreview
uri={livestreamClaim.permanent_url} uri={livestreamClaim.permanent_url}
/> />*/}
</div> </div>
) : ( ) : (
<div style={{marginTop: 'var(--spacing-l)'}}> <div style={{marginTop: 'var(--spacing-l)'}}>
@ -172,7 +183,7 @@ export default function CreatorDashboardPage(props: Props) {
)} )}
{/* Debug Stuff */} {/* Debug Stuff */}
{ streamKey && ( { streamKey && false && (
<div style={{marginTop: 'var(--spacing-l)'}}> <div style={{marginTop: 'var(--spacing-l)'}}>
<h3>Debug Info</h3> <h3>Debug Info</h3>