From 3aead19b4748b895984f6a3c590af88d8ac46cfd Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 15 Mar 2021 10:58:21 -0400 Subject: [PATCH] style cleanup --- ui/component/copyableText/view.jsx | 4 +- ui/component/router/view.jsx | 4 +- ui/page/livestreamSetup/view.jsx | 202 ++++++++++++++--------------- ui/scss/component/_livestream.scss | 4 + 4 files changed, 110 insertions(+), 104 deletions(-) diff --git a/ui/component/copyableText/view.jsx b/ui/component/copyableText/view.jsx index b45d24b46..561b83a7e 100644 --- a/ui/component/copyableText/view.jsx +++ b/ui/component/copyableText/view.jsx @@ -10,10 +10,11 @@ type Props = { doToast: ({ message: string }) => void, label?: string, primaryButton?: boolean, + name?: string, }; export default function CopyableText(props: Props) { - const { copyable, doToast, snackMessage, label, primaryButton = false } = props; + const { copyable, doToast, snackMessage, label, primaryButton = false, name } = props; const input = useRef(); @@ -38,6 +39,7 @@ export default function CopyableText(props: Props) { type="text" className="form-field--copyable" readOnly + name={name} label={label} value={copyable || ''} ref={input} diff --git a/ui/component/router/view.jsx b/ui/component/router/view.jsx index 738e81a9d..056127b7a 100644 --- a/ui/component/router/view.jsx +++ b/ui/component/router/view.jsx @@ -36,7 +36,7 @@ import PasswordResetPage from 'page/passwordReset'; import PasswordSetPage from 'page/passwordSet'; import SignInVerifyPage from 'page/signInVerify'; import ChannelsPage from 'page/channels'; -import LiveStreamPage from 'page/livestream'; +import LiveStreamSetupPage from 'page/livestreamSetup'; import EmbedWrapperPage from 'page/embedWrapper'; import TopPage from 'page/top'; import Welcome from 'page/welcome'; @@ -276,7 +276,7 @@ function AppRouter(props: Props) { - + diff --git a/ui/page/livestreamSetup/view.jsx b/ui/page/livestreamSetup/view.jsx index fbf828d27..792238dfc 100644 --- a/ui/page/livestreamSetup/view.jsx +++ b/ui/page/livestreamSetup/view.jsx @@ -1,5 +1,6 @@ // @flow import * as PAGES from 'constants/pages'; +import * as PUBLISH_MODES from 'constants/publish_types'; import React from 'react'; import Page from 'component/page'; import Spinner from 'component/spinner'; @@ -10,7 +11,10 @@ import { Lbry } from 'lbry-redux'; import { toHex } from 'util/hex'; import ClaimPreview from 'component/claimPreview'; import { FormField } from 'component/common/form'; -import * as PUBLISH_MODES from 'constants/publish_types'; +import CopyableText from 'component/copyableText'; +import Card from 'component/common/card'; +import ClaimList from 'component/claimList'; +import livestream from '../livestream'; type Props = { channels: Array, @@ -62,7 +66,6 @@ export default function LivestreamSetupPage(props: Props) { const [isFetching, setIsFetching] = React.useState(true); const [isLive, setIsLive] = React.useState(false); - const [livestreamClaim, setLivestreamClaim] = React.useState(false); const [livestreamClaims, setLivestreamClaims] = React.useState([]); React.useEffect(() => { @@ -78,7 +81,6 @@ export default function LivestreamSetupPage(props: Props) { .then((res) => { if (res && res.items && res.items.length > 0) { const claim = res.items[res.items.length - 1]; - setLivestreamClaim(claim); setLivestreamClaims(res.items.reverse()); } else { setIsFetching(false); @@ -109,113 +111,111 @@ export default function LivestreamSetupPage(props: Props) { /> )} - {!fetchingChannels && activeChannelClaim && ( - - {/* Channel Selector */} - +
+ {!fetchingChannels && activeChannelClaim && ( + <> + - {/* Display StreamKey */} - {streamKey ? ( -
- {/* Stream Server Address */} - 0 && ( + + + + + } /> + )} - {/* Stream Key */} - -
- ) : ( -
-
{JSON.stringify(activeChannelClaim)}
- {sigData &&
{JSON.stringify(sigData)}
} -
- )} - - {/* Stream Claim(s) */} - {livestreamClaim && livestreamClaims ? ( -
-

Your LiveStream Claims

- - {livestreamClaims.map((claim) => ( - - ))} - - {/*

Your LiveStream Claims

- */} -
- ) : ( -
-
You must first publish a livestream claim before your stream will be visible!
- - {/* Relies on https://github.com/lbryio/lbry-desktop/pull/5669 */} -
- )} - - {/* Debug Stuff */} - {streamKey && false && ( -
-

Debug Info

- - {/* Channel ID */} - +
+ } /> + )} - {/* Signature */} - + {/* Debug Stuff */} + {streamKey && false && ( +
+

Debug Info

- {/* Signature TS */} - + {/* Channel ID */} + - {/* Hex Data */} - + {/* Signature */} + - {/* Channel Public Key */} - -
- )} - - )} + {/* Signature TS */} + + + {/* Hex Data */} + + + {/* Channel Public Key */} + +
+ )} + + )} + ); } diff --git a/ui/scss/component/_livestream.scss b/ui/scss/component/_livestream.scss index fb218a88d..9cca8fcb0 100644 --- a/ui/scss/component/_livestream.scss +++ b/ui/scss/component/_livestream.scss @@ -196,3 +196,7 @@ display: inline-block; } } + +.livestream__publish-intro { + margin-top: var(--spacing-l); +}