Skip to content

Commit

Permalink
fix(surveys): fix survey template (#18034)
Browse files Browse the repository at this point in the history
* fix(surveys): fix survey template

* fix appearance

* Update UI snapshots for `chromium` (2)

* make emoji colors darker

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
liyiy and github-actions[bot] authored Oct 17, 2023
1 parent 1ef8814 commit 3e7c837
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Binary file modified frontend/__snapshots__/scenes-app-surveys--survey-templates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions frontend/src/scenes/surveys/SurveyTemplates.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SceneExport } from 'scenes/sceneTypes'
import { SurveyAppearance } from './SurveyAppearance'
import { defaultSurveyTemplates } from './constants'
import { defaultSurveyTemplates, defaultSurveyAppearance } from './constants'
import { SurveyQuestion } from '~/types'
import './SurveyTemplates.scss'
import { useActions } from 'kea'
Expand Down Expand Up @@ -36,7 +36,11 @@ export function SurveyTemplates(): JSX.Element {
data-attr="survey-template"
key={idx}
onClick={() => {
setSurveyTemplateValues({ name: template.type, questions: template.questions })
setSurveyTemplateValues({
name: template.type,
questions: template.questions,
appearance: { ...defaultSurveyAppearance, ...template.appearance },
})
reportSurveyTemplateClicked(template.type)
}}
>
Expand All @@ -52,7 +56,11 @@ export function SurveyTemplates(): JSX.Element {
key={idx}
type={template.questions[0].type}
question={template.questions[0].question}
appearance={{ whiteLabel: true, ...template.appearance }}
appearance={{
...defaultSurveyAppearance,
whiteLabel: true,
...template.appearance,
}}
surveyQuestionItem={template.questions[0] as SurveyQuestion}
/>
</div>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/scenes/surveys/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const defaultSurveyTemplates = [
},
],
description: 'Works best after a checkout or support flow.',
appearance: { ratingButtonColor: '#939393' },
},
{
type: SurveyTemplateType.CES,
Expand All @@ -225,6 +226,7 @@ export const defaultSurveyTemplates = [
},
],
description: 'Works well with churn surveys.',
appearance: { ratingButtonColor: '#939393' },
},
{
type: SurveyTemplateType.CCR,
Expand Down

0 comments on commit 3e7c837

Please sign in to comment.