more reply placeholders

This commit is contained in:
k00b 2024-09-22 12:04:48 -05:00
parent b6dcee4f26
commit 2b5a1cbfe9
2 changed files with 9 additions and 3 deletions

View File

@ -113,7 +113,6 @@ function TopLevelItem ({ item, noReply, ...props }) {
<Reply <Reply
item={item} item={item}
replyOpen replyOpen
placeholder={item.ncomments > 3 ? 'fractions of a penny for your thoughts?' : 'early comments get more zaps'}
onCancelQuote={cancelQuote} onCancelQuote={cancelQuote}
onQuoteReply={quoteReply} onQuoteReply={quoteReply}
quote={quote} quote={quote}

View File

@ -2,7 +2,7 @@ import { Form, MarkdownInput } from '@/components/form'
import styles from './reply.module.css' import styles from './reply.module.css'
import { COMMENTS } from '@/fragments/comments' import { COMMENTS } from '@/fragments/comments'
import { useMe } from './me' import { useMe } from './me'
import { forwardRef, useCallback, useEffect, useState, useRef } from 'react' import { forwardRef, useCallback, useEffect, useState, useRef, useMemo } from 'react'
import Link from 'next/link' import Link from 'next/link'
import { FeeButtonProvider, postCommentBaseLineItems, postCommentUseRemoteLineItems } from './fee-button' import { FeeButtonProvider, postCommentBaseLineItems, postCommentUseRemoteLineItems } from './fee-button'
import { commentsViewedAfterComment } from '@/lib/new-comments' import { commentsViewedAfterComment } from '@/lib/new-comments'
@ -34,7 +34,6 @@ export default forwardRef(function Reply ({
item, item,
replyOpen, replyOpen,
children, children,
placeholder,
onQuoteReply, onQuoteReply,
onCancelQuote, onCancelQuote,
quote quote
@ -53,6 +52,14 @@ export default forwardRef(function Reply ({
} }
}, [replyOpen, quote, parentId]) }, [replyOpen, quote, parentId])
const placeholder = useMemo(() => {
return [
'comment for currency?',
'fractions of a penny for your thoughts?',
'put your money where your mouth is?'
][parentId % 3]
}, [parentId])
const onSubmit = useItemSubmit(CREATE_COMMENT, { const onSubmit = useItemSubmit(CREATE_COMMENT, {
extraValues: { parentId }, extraValues: { parentId },
paidMutationOptions: { paidMutationOptions: {