2022-02-04 21:59:11 +01:00
|
|
|
// @flow
|
|
|
|
import 'scss/component/_comment-selectors.scss';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import * as ICONS from 'constants/icons';
|
|
|
|
import CreditAmount from 'component/common/credit-amount';
|
|
|
|
import I18nMessage from 'component/i18nMessage';
|
|
|
|
import Icon from 'component/common/icon';
|
|
|
|
import SelectChannel from 'component/selectChannel';
|
|
|
|
|
|
|
|
type SelectorProps = {
|
|
|
|
isReply: boolean,
|
|
|
|
isLivestream: boolean,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const FormChannelSelector = (selectorProps: SelectorProps) => {
|
2022-05-06 09:12:20 +02:00
|
|
|
const { isReply, isLivestream } = selectorProps;
|
2022-02-04 21:59:11 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="comment-create__label-wrapper">
|
|
|
|
<span className="comment-create__label">
|
|
|
|
{(isReply ? __('Replying as') : isLivestream ? __('Chat as') : __('Comment as')) + ' '}
|
|
|
|
</span>
|
|
|
|
|
2022-05-06 09:12:20 +02:00
|
|
|
<SelectChannel tiny />
|
2022-02-04 21:59:11 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
type HelpTextProps = {
|
|
|
|
deletedComment: boolean,
|
|
|
|
minAmount: number,
|
|
|
|
minSuper: number,
|
|
|
|
minTip: number,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const HelpText = (helpTextProps: HelpTextProps) => {
|
|
|
|
const { deletedComment, minAmount, minSuper, minTip } = helpTextProps;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{deletedComment && <div className="error__text">{__('This comment has been deleted.')}</div>}
|
|
|
|
|
|
|
|
{!!minAmount && (
|
2022-02-07 14:37:19 +01:00
|
|
|
<div className="help--notice comment-create__min-amount-notice">
|
2022-02-04 21:59:11 +01:00
|
|
|
<I18nMessage tokens={{ lbc: <CreditAmount noFormat amount={minAmount} /> }}>
|
|
|
|
{minTip ? 'Comment min: %lbc%' : minSuper ? 'HyperChat min: %lbc%' : ''}
|
|
|
|
</I18nMessage>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
customTooltipText={
|
|
|
|
minTip
|
|
|
|
? __('This channel requires a minimum tip for each comment.')
|
|
|
|
: minSuper
|
|
|
|
? __('This channel requires a minimum amount for HyperChats to be visible.')
|
|
|
|
: ''
|
|
|
|
}
|
|
|
|
className="icon--help"
|
|
|
|
icon={ICONS.HELP}
|
|
|
|
tooltip
|
|
|
|
size={16}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|