A build-time public env value was enough to publish the page, and the footer interaction story still looked for a link the component hides by default.
16 lines
585 B
TypeScript
16 lines
585 B
TypeScript
/**
|
|
* `/privacy` stays off until university counsel has read the policy.
|
|
* Only the runtime switch `ENABLE_PRIVACY_POLICY=true` turns it on.
|
|
* A build-time `NEXT_PUBLIC_ENABLE_PRIVACY_POLICY` value does not.
|
|
* Unset or any other value is off.
|
|
*/
|
|
export function isPrivacyPolicyEnabled(): boolean {
|
|
return process.env.ENABLE_PRIVACY_POLICY === "true";
|
|
}
|
|
|
|
/** Absolute /privacy URL, or null while the flag is off. */
|
|
export function privacyPolicyUrl(origin: string): string | null {
|
|
if (!isPrivacyPolicyEnabled()) return null;
|
|
return `${origin.replace(/\/$/, "")}/privacy`;
|
|
}
|