feat(survey-modal): add survey modal configuration to environment files

- Introduced a new environment variable VITE_ENABLE_SURVEY_MODAL to control the visibility of the survey modal.
- Updated .env.example to include the new variable with a default value of true.
- Modified SurveyPromptModal component to check the environment variable before displaying the modal, enhancing user experience by allowing toggling of the feature.
This commit is contained in:
chamikaJ
2025-07-29 11:13:08 +05:30
parent 53a28cf489
commit c2b231d5cc
3 changed files with 32 additions and 1 deletions

View File

@@ -30,6 +30,11 @@ export const SurveyPromptModal: React.FC<SurveyPromptModalProps> = ({ forceShow
const isDarkMode = themeMode === 'dark';
useEffect(() => {
// Check if survey modal is disabled via environment variable
if (import.meta.env.VITE_ENABLE_SURVEY_MODAL !== 'true' && !forceShow) {
return; // Don't show modal if disabled in environment
}
// Check if survey was skipped recently (within 7 days)
const skippedAt = localStorage.getItem('survey_skipped_at');
if (!forceShow && skippedAt) {