Skip to content

Commit

Permalink
feat(app-rfi): rfiDisplay false renders blank
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-williams-az committed Sep 25, 2024
1 parent 2527a58 commit 9f1983a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/app-rfi/src/components/AsuRfi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ const AsuRfi = props => {
}

const rfiState = useRfiState(betterPropNames(props));
window["rfiState"] = rfiState;

if (!rfiState.showForm) {
return <></>;
}

return (
<RfiContext.Provider
value={{
Expand Down
8 changes: 8 additions & 0 deletions packages/app-rfi/src/core/utils/appState.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export const useRfiState = props => {
setCampusProgramHasChoice,
degreeDataList,
degreeData,
showForm: true,
showStepButtons: true,
props,
formik,
Expand All @@ -231,6 +232,13 @@ export const useRfiState = props => {
stepNumber,
};

// ERFI-159 Do not render if a programOfInterest prop has rfiDisplay = false
// 'showForm' will allow the root '/AsuRfi/index.js` to exit before rendering
if (props.programOfInterest && !degreeData?.rfiDisplay) {
returnObject.showForm = false;
return returnObject;
}

// ERFI-58 Always show CertInfo page if prop is true
if (isCertMinor) {
returnObject.showStepButtons = false;
Expand Down

0 comments on commit 9f1983a

Please sign in to comment.