-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useState } from "react"; | ||
import { FeelbackTaggedMessage, FeelbackValueDefinition, Question, PRESET_YESNO_LIKE_DISLIKE } from "@feelback/react"; | ||
import "@feelback/react/styles/feelback.css"; | ||
|
||
const YES_TAGS = [ | ||
{ value: "accurate", title: "Accurate", description: "Accurately describes the product or feature.", }, | ||
{ value: "problem-solved", title: "Solved my problem", description: "Helped me resolve an issue.", }, | ||
{ value: "clear", title: "Easy to understand", description: "Easy to follow and comprehend.", }, | ||
{ value: "product-chosen", title: "Helped me decide to use the product", description: "Convinced me to adopt the product or feature.", }, | ||
{ value: "other-yes", title: "Another reason" }, | ||
]; | ||
|
||
const NO_TAGS = [ | ||
{ value: "inaccurate", title: "Inaccurate", description: "Doesn't accurately describe the product or feature.", }, | ||
{ value: "missing-info", title: "Couldn't find what I was looking for", description: "Missing important information.", }, | ||
{ value: "unclear", title: "Hard to understand", description: "Too complicated or unclear.", }, | ||
{ value: "bad-examples", title: "Code samples errors", description: "One or more code samples are incorrect.", }, | ||
{ value: "other-no", title: "Another reason" }, | ||
]; | ||
|
||
const FEEDBACK_CONTENT_SET_ID = "6d4fac2e-6797-47aa-8d5c-b9318a0655e8"; | ||
|
||
export function FeedbackComponent() { | ||
const [choice, setChoice] = useState(); | ||
|
||
return ( | ||
<div className="feelback-container"> | ||
{!choice | ||
? <Question text="Was this page helpful?" | ||
items={PRESET_YESNO_LIKE_DISLIKE} | ||
showLabels | ||
onClick={setChoice} | ||
/> | ||
: <FeelbackTaggedMessage contentSetId={FEEDBACK_CONTENT_SET_ID} | ||
layout="radio-group" | ||
tags={choice === "y" ? YES_TAGS : NO_TAGS} | ||
title={choice === "y" ? "What did you like?" : "What went wrong?"} | ||
placeholder="(optional) Please, further detail the feedback" | ||
/> | ||
} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -430,3 +430,5 @@ iframe+em { | |
margin: 0 auto 8px 0 !important; | ||
} | ||
} | ||
|
||
@import "@feelback/react/styles/feelback.css"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import Footer from '@theme-original/DocItem/Footer'; | ||
import {FeedbackComponent } from "../../../components/FeedbackComponent"; | ||
|
||
export default function FooterWrapper(props) { | ||
return ( | ||
<> | ||
<Footer {...props} /> | ||
<hr /> | ||
<FeedbackComponent /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters