Skip to content

Commit

Permalink
feat: remove progressive disclosure (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxwell Frank <[email protected]>
  • Loading branch information
MaxFrank13 and MaxFrank13 authored Aug 30, 2023
1 parent 990c8ac commit 99afff1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useContext, useRef } from 'react';
import React, { useRef } from 'react';
import {
Stack,
} from '@edx/paragon';
import { useIntl } from '@edx/frontend-platform/i18n';
import { SkillsBuilderContext } from '../../skills-builder-context';
import { useVisibilityFlags } from '../view-results/data/hooks';
import GoalSelect from './GoalSelect';
import JobTitleSelect from './JobTitleSelect';
Expand All @@ -12,26 +11,24 @@ import messages from './messages';

const SelectPreferences = () => {
const { formatMessage } = useIntl();
const { state } = useContext(SkillsBuilderContext);
const { currentGoal, currentJobTitle } = state;
const visibilityFlags = useRef(useVisibilityFlags());
const { showGoal, showCurrentJobTitle, alwaysShowCareerInterest } = visibilityFlags.current;
const { showGoal, showCurrentJobTitle, showCareerInterest } = visibilityFlags.current;

return (
<Stack gap={4}>
<p className="lead">
{formatMessage(messages.skillsBuilderDescription)}
</p>
<Stack gap={4}>
{ showGoal && (
{showGoal && (
<GoalSelect />
)}

{currentGoal && showCurrentJobTitle && (
{showCurrentJobTitle && (
<JobTitleSelect />
)}

{(alwaysShowCareerInterest || (currentGoal && currentJobTitle)) && (
{showCareerInterest && (
<CareerInterestSelect />
)}
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const DEFAULT_VISIBILITY_FLAGS = {
showCareerInterestCards: true,
showGoal: true,
showCurrentJobTitle: true,
alwaysShowCareerInterest: false,
showCareerInterest: true,
isProgressive: false,
};

Expand All @@ -46,6 +46,6 @@ export const ONE_QUESTION_VISIBILITY_FLAGS = {
showCareerInterestCards: false,
showGoal: false,
showCurrentJobTitle: false,
alwaysShowCareerInterest: true,
showCareerInterest: true,
isProgressive: true,
};

0 comments on commit 99afff1

Please sign in to comment.