-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CS-115: NPS Banner UI component (#17485)
* added survey rating and feedbackbox with submit button * added disabled prop for submit button * reverting disabled prop, not required * review comments updated * button replaced with radio button, wrapped in form * review comments updated * reverted display time * accessiblity changes * styles updated
- Loading branch information
1 parent
ba661e4
commit a29cd9e
Showing
5 changed files
with
263 additions
and
50 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/core/admin/admin/src/components/NpsSurvey/hooks/useNpsSurveySettings.js
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,17 @@ | ||
import { usePersistentState } from '@strapi/helper-plugin'; | ||
|
||
// Exported to make it available during admin user registration. | ||
// Because we only enable the NPS for users who subscribe to the newsletter when signing up | ||
export function useNpsSurveySettings() { | ||
const [npsSurveySettings, setNpsSurveySettings] = usePersistentState( | ||
'STRAPI_NPS_SURVEY_SETTINGS', | ||
{ | ||
enabled: true, | ||
lastResponseDate: null, | ||
firstDismissalDate: null, | ||
lastDismissalDate: null, | ||
} | ||
); | ||
|
||
return { npsSurveySettings, setNpsSurveySettings }; | ||
} |
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
Oops, something went wrong.