Skip to content

Commit

Permalink
chore(surveys): add surveys opt in to onboarding ingestion (#18045)
Browse files Browse the repository at this point in the history
  • Loading branch information
liyiy authored and daibhin committed Oct 23, 2023
1 parent 5703cb3 commit 2cddb46
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions frontend/src/scenes/ingestion/panels/SuperpowersPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function SuperpowersPanel(): JSX.Element {
const { completeOnboarding } = useActions(ingestionLogic)
const [sessionRecordingsChecked, setSessionRecordingsChecked] = useState(true)
const [autocaptureChecked, setAutocaptureChecked] = useState(true)
const [surveysChecked, setSurveysChecked] = useState(true)

return (
<CardContainer
Expand All @@ -22,6 +23,7 @@ export function SuperpowersPanel(): JSX.Element {
capture_console_log_opt_in: sessionRecordingsChecked,
capture_performance_opt_in: sessionRecordingsChecked,
autocapture_opt_out: !autocaptureChecked,
surveys_opt_in: surveysChecked,
})
if (!showBillingStep) {
completeOnboarding()
Expand Down Expand Up @@ -82,6 +84,25 @@ export function SuperpowersPanel(): JSX.Element {
directly in your code snippet.
</p>
</div>
<div>
<LemonSwitch
data-attr="opt-in-surveys-switch"
onChange={(checked) => {
setSurveysChecked(checked)
}}
label="Get qualitative feedback from your users"
fullWidth={true}
labelClassName={'text-base font-semibold'}
checked={surveysChecked}
/>
<p className="prompt-text ml-0">
Collect feedback from your users directly in your product.{' '}
<Link to={'https://posthog.com/docs/surveys'} target="blank">
Learn more
</Link>{' '}
about Surveys.
</p>
</div>
</CardContainer>
)
}

0 comments on commit 2cddb46

Please sign in to comment.