Hide Creator Settings that are not ready

This commit is contained in:
infinite-persistence 2021-05-25 09:31:59 +08:00 committed by Thomas Zarebczan
parent 82aaf361f1
commit 112947adc6

View file

@ -11,6 +11,8 @@ import I18nMessage from 'component/i18nMessage';
const DEBOUNCE_REFRESH_MS = 1000; const DEBOUNCE_REFRESH_MS = 1000;
const FEATURE_IS_READY = false;
type Props = { type Props = {
activeChannelClaim: ChannelClaim, activeChannelClaim: ChannelClaim,
settingsByChannelId: { [string]: PerChannelSettings }, settingsByChannelId: { [string]: PerChannelSettings },
@ -138,30 +140,32 @@ export default function SettingsCreatorPage(props: Props) {
)} )}
{!isBusy && ( {!isBusy && (
<> <>
<Card {FEATURE_IS_READY && (
title={__('General')} <Card
actions={ title={__('General')}
<> actions={
<FormField <>
type="checkbox" <FormField
name="comments_enabled" type="checkbox"
label={__('Enable comments for channel.')} name="comments_enabled"
checked={commentsEnabled} label={__('Enable comments for channel.')}
onChange={() => setSettings({ comments_enabled: !commentsEnabled })} checked={commentsEnabled}
/> onChange={() => setSettings({ comments_enabled: !commentsEnabled })}
<FormField />
name="slow_mode_min_gap" <FormField
label={__('Minimum time gap in seconds for Slow Mode in livestream chat.')} name="slow_mode_min_gap"
min={0} label={__('Minimum time gap in seconds for Slow Mode in livestream chat.')}
step={1} min={0}
type="number" step={1}
placeholder="1" type="number"
value={slowModeMinGap} placeholder="1"
onChange={(e) => setSettings({ slow_mode_min_gap: e.target.value })} value={slowModeMinGap}
/> onChange={(e) => setSettings({ slow_mode_min_gap: e.target.value })}
</> />
} </>
/> }
/>
)}
<Card <Card
title={__('Filter')} title={__('Filter')}
actions={ actions={
@ -181,45 +185,47 @@ export default function SettingsCreatorPage(props: Props) {
</div> </div>
} }
/> />
<Card {FEATURE_IS_READY && (
title={__('Tip')} <Card
actions={ title={__('Tip')}
<> actions={
<FormField <>
name="min_tip_amount_comment" <FormField
label={ name="min_tip_amount_comment"
<I18nMessage tokens={{ lbc: <LbcSymbol /> }}>Minimum %lbc% tip amount for comments</I18nMessage> label={
} <I18nMessage tokens={{ lbc: <LbcSymbol /> }}>Minimum %lbc% tip amount for comments</I18nMessage>
helper={__( }
'Enabling a minimum amount to comment will force all comments, including livestreams, to have tips associated with them. This can help prevent spam.' helper={__(
)} 'Enabling a minimum amount to comment will force all comments, including livestreams, to have tips associated with them. This can help prevent spam.'
className="form-field--price-amount" )}
min={0} className="form-field--price-amount"
step="any" min={0}
type="number" step="any"
placeholder="1" type="number"
value={minTipAmountComment} placeholder="1"
onChange={(e) => setSettings({ min_tip_amount_comment: parseFloat(e.target.value) })} value={minTipAmountComment}
/> onChange={(e) => setSettings({ min_tip_amount_comment: parseFloat(e.target.value) })}
<FormField />
name="min_tip_amount_super_chat" <FormField
label={ name="min_tip_amount_super_chat"
<I18nMessage tokens={{ lbc: <LbcSymbol /> }}>Minimum %lbc% tip amount for hyperchats</I18nMessage> label={
} <I18nMessage tokens={{ lbc: <LbcSymbol /> }}>Minimum %lbc% tip amount for hyperchats</I18nMessage>
helper={__( }
'Enabling a minimum amount to hyperchat will force all TIPPED comments to have this value in order to be shown. This still allows regular comments to be posted.' helper={__(
)} 'Enabling a minimum amount to hyperchat will force all TIPPED comments to have this value in order to be shown. This still allows regular comments to be posted.'
className="form-field--price-amount" )}
min={0} className="form-field--price-amount"
step="any" min={0}
type="number" step="any"
placeholder="1" type="number"
value={minTipAmountSuperChat} placeholder="1"
onChange={(e) => setSettings({ min_tip_amount_super_chat: parseFloat(e.target.value) })} value={minTipAmountSuperChat}
/> onChange={(e) => setSettings({ min_tip_amount_super_chat: parseFloat(e.target.value) })}
</> />
} </>
/> }
/>
)}
</> </>
)} )}
</Page> </Page>