fix: allow zap comments #229

Merged
verbiricha merged 3 commits from fixes into main 2023-02-09 11:32:36 +00:00
2 changed files with 13 additions and 21 deletions
Showing only changes of commit aa10585d17 - Show all commits

View File

@ -77,6 +77,8 @@ export default function LNURLTip(props: LNURLTipProps) {
const { formatMessage } = useIntl();
const publisher = useEventPublisher();
const horizontalScroll = useHorizontalScroll();
const canComment =
(payService?.commentAllowed ?? 0) > 0 || payService?.nostrPubkey;
useEffect(() => {
if (show && !props.invoice) {
@ -241,16 +243,15 @@ export default function LNURLTip(props: LNURLTipProps) {
</div>
{payService && custom()}
<div className="flex">
{(payService?.commentAllowed ?? 0) > 0 ||
(payService?.nostrPubkey && (
<input
type="text"
placeholder={formatMessage(messages.Comment)}
className="f-grow"
maxLength={payService?.commentAllowed || 120}
onChange={(e) => setComment(e.target.value)}
/>
))}
{canComment && (
<input
type="text"
placeholder={formatMessage(messages.Comment)}
className="f-grow"
maxLength={payService?.commentAllowed || 120}
onChange={(e) => setComment(e.target.value)}
/>
)}
</div>
{(amount ?? 0) > 0 && (
<button

View File

@ -108,24 +108,15 @@ export const Reaction = {
*/
export function normalizeReaction(content: string) {
switch (content) {
case "":
return Reaction.Positive;
case "🤙":
return Reaction.Positive;
case "❤️":
return Reaction.Positive;
case "👍":
return Reaction.Positive;
case "💯":
return Reaction.Positive;
case "+":
return Reaction.Positive;
case "-":
return Reaction.Negative;
case "👎":
return Reaction.Negative;
default:
return Reaction.Positive;
}
return content;
}
/**