Skip to content

Commit 84c35d3

Browse files
chore(feedback-form): customize placeholder (#2163)
Co-authored-by: Kendall Strautman Swarthout <[email protected]>
1 parent 9c17976 commit 84c35d3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/feedback-form/components/question/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ const Question: React.FC<QuestionProps> = ({
6666
break
6767
}
6868
case 'text': {
69-
const { optional, buttonText, nextQuestion } = question
69+
const {
70+
optional,
71+
buttonText,
72+
nextQuestion,
73+
placeholder = 'Your feedback...',
74+
} = question
7075
const isButtonDisabled =
7176
!optional && (inputValue === '' || feedbackContext.isTransitioning)
7277
const inputHasEntry = inputValue.length
@@ -82,7 +87,7 @@ const Question: React.FC<QuestionProps> = ({
8287
s.textArea,
8388
inputHasEntry ? s.visited : null
8489
)}
85-
placeholder="Your feedback..."
90+
placeholder={placeholder}
8691
/>
8792
{optional && !inputHasEntry ? (
8893
<span className={s.optionalText}>(optional)</span>

src/components/feedback-form/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ interface FeedbackQuestionText extends FeedbackQuestionBase {
2929
icon?: ReactElement<React.JSX.IntrinsicElements['svg']>
3030
buttonText: string
3131
nextQuestion?: string
32+
placeholder?: string
3233
optional?: boolean
3334
}
3435

0 commit comments

Comments
 (0)