diff --git a/ui/component/commentCreate/view.jsx b/ui/component/commentCreate/view.jsx
index adf1210d0..ad1b3d638 100644
--- a/ui/component/commentCreate/view.jsx
+++ b/ui/component/commentCreate/view.jsx
@@ -15,6 +15,7 @@ import WalletTipAmountSelector from 'component/walletTipAmountSelector';
import CreditAmount from 'component/common/credit-amount';
import ChannelThumbnail from 'component/channelThumbnail';
import UriIndicator from 'component/uriIndicator';
+import I18nMessage from 'component/i18nMessage';
import Empty from 'component/common/empty';
import { Lbryio } from 'lbryinc';
import { getChannelIdFromClaim } from 'util/claim';
@@ -97,6 +98,17 @@ export function CommentCreate(props: Props) {
const [shouldDisableReviewButton, setShouldDisableReviewButton] = React.useState();
const channelId = getChannelIdFromClaim(claim);
const channelSettings = channelId ? settingsByChannelId[channelId] : undefined;
+ const minTip = (channelSettings && channelSettings.min_tip_amount_comment) || 0;
+ const minTipMet = minTip === 0 || tipAmount >= minTip;
+
+ const MinTipNotice =
+ minTip !== 0 ? (
+
+ }}>
+ This channel requires a minimum tip of %lbc% to post a comment.
+
+
+ ) : null;
function handleCommentChange(event) {
let commentValue;
@@ -125,6 +137,14 @@ export function CommentCreate(props: Props) {
window.removeEventListener('keydown', altEnterListener);
}
+ function handleReview() {
+ if (channelId) {
+ // Get the latest minTip value for final review.
+ doFetchCreatorSettings(channelId);
+ }
+ setIsReviewingSupportComment(true);
+ }
+
function handleSubmit() {
if (activeChannelClaim && commentValue.length) {
handleCreateComment();
@@ -238,7 +258,7 @@ export function CommentCreate(props: Props) {
}
/**
- *
+ * handleCreateComment
* @param {string} [txid] Optional transaction id generated by
* @param {string} [payment_intent_id] Optional payment_intent_id from Stripe payment
* @param {string} [environment] Optional environment for Stripe (test|live)
@@ -271,6 +291,7 @@ export function CommentCreate(props: Props) {
setAdvancedEditor(!advancedEditor);
}
+ // Fetch channel constraints if not already.
React.useEffect(() => {
if (!channelSettings && channelId) {
doFetchCreatorSettings(channelId);
@@ -333,7 +354,7 @@ export function CommentCreate(props: Props) {