Make textboxes in feed expandable

This commit is contained in:
Austin Chen 2022-01-19 01:43:54 -05:00
parent 5082c8b3f2
commit f75fbfb4c5

View File

@ -38,6 +38,7 @@ import { useBets } from '../hooks/use-bets'
import { Bet, withoutAnteBets } from '../lib/firebase/bets' import { Bet, withoutAnteBets } from '../lib/firebase/bets'
import { Comment, mapCommentsByBetId } from '../lib/firebase/comments' import { Comment, mapCommentsByBetId } from '../lib/firebase/comments'
import { JoinSpans } from './join-spans' import { JoinSpans } from './join-spans'
import Textarea from 'react-expanding-textarea'
function FeedComment(props: { activityItem: any }) { function FeedComment(props: { activityItem: any }) {
const { activityItem } = props const { activityItem } = props
@ -125,11 +126,12 @@ function FeedBet(props: { activityItem: any }) {
{canComment && ( {canComment && (
// Allow user to comment in an textarea if they are the creator // Allow user to comment in an textarea if they are the creator
<div className="mt-2"> <div className="mt-2">
<textarea <Textarea
value={comment} value={comment}
onChange={(e) => setComment(e.target.value)} onChange={(e) => setComment(e.target.value)}
className="textarea textarea-bordered w-full" className="textarea textarea-bordered w-full"
placeholder="Add a comment..." placeholder="Add a comment..."
rows={3}
/> />
<button <button
className="btn btn-outline btn-sm mt-1" className="btn btn-outline btn-sm mt-1"
@ -175,8 +177,9 @@ export function ContractDescription(props: {
!contract.resolution && !contract.resolution &&
(editing ? ( (editing ? (
<form className="mt-4"> <form className="mt-4">
<textarea <Textarea
className="textarea h-24 textarea-bordered w-full mb-1" className="textarea h-24 textarea-bordered w-full mb-1"
rows={3}
value={description} value={description}
onChange={(e) => setDescription(e.target.value || '')} onChange={(e) => setDescription(e.target.value || '')}
autoFocus autoFocus