Skip to content

Commit

Permalink
Merge pull request #161 from OperationSpark/fix/hs-form-disable-on-date
Browse files Browse the repository at this point in the history
provide date to remove hs form + buttons/redirect
  • Loading branch information
ptbarnum4 committed Jun 13, 2024
2 parents f2125da + e93995a commit 5f83131
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ const { validateData } = require('./data/validate');
const {
OVERRIDE_NODE_ENV = '',
FB_PIXEL_ID,
HIGHSCHOOL_FORM_ACTIVE = 'false',
HIGHSCHOOL_FORM_ACTIVE_UNTIL,
HIGHSCHOOL_FORM_RESPONSES_NAME = '__TAB_NAME_NOT_SET__',
} = process.env;

const isHsFormActive = HIGHSCHOOL_FORM_ACTIVE?.toLowerCase() === 'true';
const hsFormActiveUntil = new Date(HIGHSCHOOL_FORM_ACTIVE_UNTIL);

module.exports = (phase, { defaultConfig }) => {
const isHsFormActive = hsFormActiveUntil > new Date();

console.info(color.magentaBright.bold('\nValidating... '));
if (
!process.env.GITHUB_ACTION &&
Expand Down Expand Up @@ -52,7 +54,7 @@ module.exports = (phase, { defaultConfig }) => {
env: {
OVERRIDE_NODE_ENV: OVERRIDE_NODE_ENV || '',
FB_PIXEL_ID,
HIGHSCHOOL_FORM_ACTIVE: `${isHsFormActive}`,
HIGHSCHOOL_FORM_ACTIVE: isHsFormActive,
HIGHSCHOOL_FORM_RESPONSES_NAME,
},

Expand Down

0 comments on commit 5f83131

Please sign in to comment.