diff --git a/ui/component/publishForm/view.jsx b/ui/component/publishForm/view.jsx index c3e728a11..9d59e0b16 100644 --- a/ui/component/publishForm/view.jsx +++ b/ui/component/publishForm/view.jsx @@ -66,6 +66,7 @@ type Props = { // Add back type updatePublishForm: any => void, checkAvailability: string => void, + onChannelChange: string => void, }; function PublishForm(props: Props) { @@ -89,6 +90,7 @@ function PublishForm(props: Props) { publish, disabled = false, checkAvailability, + onChannelChange, } = props; const TAGS_LIMIT = 5; const formDisabled = (!filePath && !editingURI) || publishing; @@ -144,6 +146,11 @@ function PublishForm(props: Props) { } }, [name, channel, resolveUri, updatePublishForm, checkAvailability]); + function handleChannelNameChange(channel) { + onChannelChange(channel); + updatePublishForm({ channel }); + } + return (
@@ -182,7 +189,7 @@ function PublishForm(props: Props) { - updatePublishForm({ channel })} /> +

{__('This is a username or handle that your content can be found under.')}{' '} {__('Ex. @Marvel, @TheBeatles, @BooksByJoe')} diff --git a/ui/page/publish/view.jsx b/ui/page/publish/view.jsx index 3cd94f309..85a7cba40 100644 --- a/ui/page/publish/view.jsx +++ b/ui/page/publish/view.jsx @@ -5,6 +5,7 @@ import Page from 'component/page'; import Yrbl from 'component/yrbl'; import LbcSymbol from 'component/common/lbc-symbol'; import RewardAuthIntro from 'component/rewardAuthIntro'; +import usePersistedState from 'effects/use-persisted-state'; type Props = { balance: number, @@ -14,6 +15,8 @@ type Props = { function PublishPage(props: Props) { const { balance } = props; + const [channel, setChannel] = usePersistedState('publish-channel', ''); + function scrollToTop() { const mainContent = document.querySelector('main'); if (mainContent) { @@ -21,6 +24,10 @@ function PublishPage(props: Props) { } } + function handleChannelChange(channel) { + setChannel(channel); + } + return ( {balance === 0 ? ( @@ -55,7 +62,12 @@ function PublishPage(props: Props) {

) : ( - + )} );