Change placeholder in fold create question
This commit is contained in:
parent
6696ac2a15
commit
bb788d5201
|
@ -58,6 +58,7 @@ export function FeedPromo(props: { hotContracts: Contract[] }) {
|
||||||
export default function FeedCreate(props: {
|
export default function FeedCreate(props: {
|
||||||
user?: User
|
user?: User
|
||||||
tag?: string
|
tag?: string
|
||||||
|
placeholder?: string
|
||||||
className?: string
|
className?: string
|
||||||
}) {
|
}) {
|
||||||
const { user, tag, className } = props
|
const { user, tag, className } = props
|
||||||
|
@ -74,7 +75,9 @@ export default function FeedCreate(props: {
|
||||||
// Rotate through a new placeholder each day
|
// Rotate through a new placeholder each day
|
||||||
// Easter egg idea: click your own name to shuffle the placeholder
|
// Easter egg idea: click your own name to shuffle the placeholder
|
||||||
const daysSinceEpoch = Math.floor(Date.now() / 1000 / 60 / 60 / 24)
|
const daysSinceEpoch = Math.floor(Date.now() / 1000 / 60 / 60 / 24)
|
||||||
const placeholder = placeholders[daysSinceEpoch % placeholders.length]
|
const placeholder =
|
||||||
|
props.placeholder ??
|
||||||
|
`e.g. ${placeholders[daysSinceEpoch % placeholders.length]}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={clsx('w-full bg-indigo-50 sm:rounded-md p-4', className)}>
|
<div className={clsx('w-full bg-indigo-50 sm:rounded-md p-4', className)}>
|
||||||
|
@ -92,7 +95,7 @@ export default function FeedCreate(props: {
|
||||||
</div>
|
</div>
|
||||||
<Textarea
|
<Textarea
|
||||||
className="text-lg sm:text-xl text-indigo-700 w-full border-transparent focus:border-transparent bg-transparent p-0 appearance-none resize-none focus:ring-transparent placeholder:text-gray-400"
|
className="text-lg sm:text-xl text-indigo-700 w-full border-transparent focus:border-transparent bg-transparent p-0 appearance-none resize-none focus:ring-transparent placeholder:text-gray-400"
|
||||||
placeholder={`e.g. ${placeholder}`}
|
placeholder={placeholder}
|
||||||
value={question}
|
value={question}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
onChange={(e) => setQuestion(e.target.value || '')}
|
onChange={(e) => setQuestion(e.target.value || '')}
|
||||||
|
|
|
@ -216,9 +216,10 @@ export default function FoldPage(props: {
|
||||||
<Col className="flex-1">
|
<Col className="flex-1">
|
||||||
{user !== null && (
|
{user !== null && (
|
||||||
<FeedCreate
|
<FeedCreate
|
||||||
|
className={clsx(page !== 'activity' && 'hidden')}
|
||||||
user={user}
|
user={user}
|
||||||
tag={toCamelCase(fold.name)}
|
tag={toCamelCase(fold.name)}
|
||||||
className={clsx(page !== 'activity' && 'hidden')}
|
placeholder={`Type your question about ${fold.name}`}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{page === 'activity' ? (
|
{page === 'activity' ? (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user