fix: allow zap comments #229
@ -77,6 +77,8 @@ export default function LNURLTip(props: LNURLTipProps) {
|
|||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
const publisher = useEventPublisher();
|
const publisher = useEventPublisher();
|
||||||
const horizontalScroll = useHorizontalScroll();
|
const horizontalScroll = useHorizontalScroll();
|
||||||
|
const canComment =
|
||||||
|
(payService?.commentAllowed ?? 0) > 0 || payService?.nostrPubkey;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (show && !props.invoice) {
|
if (show && !props.invoice) {
|
||||||
@ -241,8 +243,7 @@ export default function LNURLTip(props: LNURLTipProps) {
|
|||||||
</div>
|
</div>
|
||||||
{payService && custom()}
|
{payService && custom()}
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
{(payService?.commentAllowed ?? 0) > 0 ||
|
{canComment && (
|
||||||
(payService?.nostrPubkey && (
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder={formatMessage(messages.Comment)}
|
placeholder={formatMessage(messages.Comment)}
|
||||||
@ -250,7 +251,7 @@ export default function LNURLTip(props: LNURLTipProps) {
|
|||||||
maxLength={payService?.commentAllowed || 120}
|
maxLength={payService?.commentAllowed || 120}
|
||||||
onChange={(e) => setComment(e.target.value)}
|
onChange={(e) => setComment(e.target.value)}
|
||||||
/>
|
/>
|
||||||
))}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{(amount ?? 0) > 0 && (
|
{(amount ?? 0) > 0 && (
|
||||||
<button
|
<button
|
||||||
|
13
src/Util.ts
13
src/Util.ts
@ -108,24 +108,15 @@ export const Reaction = {
|
|||||||
*/
|
*/
|
||||||
export function normalizeReaction(content: string) {
|
export function normalizeReaction(content: string) {
|
||||||
switch (content) {
|
switch (content) {
|
||||||
case "":
|
|
||||||
return Reaction.Positive;
|
|
||||||
case "🤙":
|
|
||||||
return Reaction.Positive;
|
|
||||||
case "❤️":
|
|
||||||
return Reaction.Positive;
|
|
||||||
case "👍":
|
|
||||||
return Reaction.Positive;
|
|
||||||
case "💯":
|
|
||||||
return Reaction.Positive;
|
|
||||||
case "+":
|
case "+":
|
||||||
return Reaction.Positive;
|
return Reaction.Positive;
|
||||||
case "-":
|
case "-":
|
||||||
return Reaction.Negative;
|
return Reaction.Negative;
|
||||||
case "👎":
|
case "👎":
|
||||||
return Reaction.Negative;
|
return Reaction.Negative;
|
||||||
|
default:
|
||||||
|
return Reaction.Positive;
|
||||||
}
|
}
|
||||||
return content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user