diff --git a/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx b/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx index 9787a7a371..e2a9f87fd7 100644 --- a/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx +++ b/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx @@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next' import CurrentPlanWidget from './current-plan-widget/current-plan-widget' import NewProjectButton from './new-project-button' import ProjectListTable from './table/project-list-table' -import SurveyWidget from './survey-widget' import UserNotifications from './notifications/user-notifications' import SearchForm from './search-form' import ProjectsDropdown from './dropdown/projects-dropdown' @@ -96,7 +95,7 @@ export function ProjectListDsNav() {
- + {/* Omit the survey card in mobile view for now */}
- +
{helpItem && ( diff --git a/services/web/frontend/js/features/project-list/components/survey-widget-ds-nav.tsx b/services/web/frontend/js/features/project-list/components/survey-widget-ds-nav.tsx new file mode 100644 index 0000000000..cac5e10bc8 --- /dev/null +++ b/services/web/frontend/js/features/project-list/components/survey-widget-ds-nav.tsx @@ -0,0 +1,54 @@ +import usePersistedState from '../../../shared/hooks/use-persisted-state' +import getMeta from '../../../utils/meta' +import { useCallback } from 'react' +import classnames from 'classnames' +import OLButton from '@/features/ui/components/ol/ol-button' +import { useTranslation } from 'react-i18next' +import { X } from '@phosphor-icons/react' + +export function SurveyWidgetDsNav() { + const { t } = useTranslation() + const survey = getMeta('ol-survey') + const [dismissedSurvey, setDismissedSurvey] = usePersistedState( + `dismissed-${survey?.name}`, + false + ) + + const dismissSurvey = useCallback(() => { + setDismissedSurvey(true) + }, [setDismissedSurvey]) + + if (!survey?.name || dismissedSurvey) { + return null + } + + return ( +
+
+
+
+

{survey.preText}

+

{survey.linkText}

+ + {t('take_survey')} + +
+ dismissSurvey()} + > + dismissSurvey()} /> + {t('close')} + +
+
+
+ ) +} diff --git a/services/web/frontend/js/features/project-list/components/survey-widget.tsx b/services/web/frontend/js/features/project-list/components/survey-widget.tsx index c7fa529133..a5604d6b01 100644 --- a/services/web/frontend/js/features/project-list/components/survey-widget.tsx +++ b/services/web/frontend/js/features/project-list/components/survey-widget.tsx @@ -3,11 +3,7 @@ import getMeta from '../../../utils/meta' import { useCallback } from 'react' import Close from '@/shared/components/close' -export default function SurveyWidget({ - variant = 'dark', -}: { - variant?: 'light' | 'dark' -}) { +export default function SurveyWidget() { const survey = getMeta('ol-survey') const [dismissedSurvey, setDismissedSurvey] = usePersistedState( `dismissed-${survey?.name}`, @@ -22,6 +18,12 @@ export default function SurveyWidget({ return null } + // Short-term hard-coded special case: hide the "DS nav" survey for users on + // the default variant + if (survey?.name === 'ds-nav') { + return null + } + return (
@@ -38,7 +40,7 @@ export default function SurveyWidget({
- dismissSurvey()} /> + dismissSurvey()} />
diff --git a/services/web/frontend/stylesheets/bootstrap-5/pages/project-list-ds-nav.scss b/services/web/frontend/stylesheets/bootstrap-5/pages/project-list-ds-nav.scss index 421ef6394a..c9402e8bbe 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/pages/project-list-ds-nav.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/pages/project-list-ds-nav.scss @@ -138,10 +138,21 @@ background-color: var(--bg-light-secondary); color: var(--content-secondary); box-shadow: none; + border-radius: var(--border-radius-large); + position: relative; - button.close { - color: var(--content-secondary) !important; + .user-notification-close { + border: none; padding: 0; + background: none; + position: absolute; + top: var(--spacing-07); + right: var(--spacing-07); + color: inherit; + } + + p { + margin-bottom: var(--spacing-03); } }