Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Survey - show switch when answers exist #134 #136

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/features/surveys/managers/surveyResultsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const useSurveyResultsManager = () => {
createDate,
showOnlyWithExtraFeedback,
filteredAnswersData,
answersData,
setShowOnlyWithExtraFeedback,
navigateToSurveys,
updateSurveyStatus,
Expand Down
18 changes: 11 additions & 7 deletions src/pages/survey/answer/[surveyId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function SurveyResultsPage() {
createDate,
showOnlyWithExtraFeedback,
filteredAnswersData,
answersData,
setShowOnlyWithExtraFeedback,
navigateToSurveys,
updateSurveyStatus,
Expand Down Expand Up @@ -114,13 +115,16 @@ function SurveyResultsPage() {
createDate={createDate}
/>

<div className="mt-10 mb-4 flex justify-center">
<Toggle
isEnabled={showOnlyWithExtraFeedback}
onToggle={toggleShowOnlyWithExtraFeedback}
label="With extra feedback only"
/>
</div>
{answersData.length > 0 && (
<div className="mt-10 mb-4 flex justify-center">
<Toggle
isEnabled={showOnlyWithExtraFeedback}
onToggle={toggleShowOnlyWithExtraFeedback}
label="With extra feedback only"
/>
</div>
)}

{items.length > 0 ? (
<div className="mb-6">
{items.map((answer) => (
Expand Down