mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-05 02:06:41 +00:00
add flag to disable product help banners
This commit is contained in:
committed by
Owen Schwartz
parent
d6e0024c96
commit
8732e50047
@@ -84,6 +84,10 @@ export class Config {
|
|||||||
?.disable_basic_wireguard_sites
|
?.disable_basic_wireguard_sites
|
||||||
? "true"
|
? "true"
|
||||||
: "false";
|
: "false";
|
||||||
|
process.env.FLAGS_DISABLE_PRODUCT_HELP_BANNERS = parsedConfig.flags
|
||||||
|
?.disable_product_help_banners
|
||||||
|
? "true"
|
||||||
|
: "false";
|
||||||
|
|
||||||
process.env.PRODUCT_UPDATES_NOTIFICATION_ENABLED = parsedConfig.app
|
process.env.PRODUCT_UPDATES_NOTIFICATION_ENABLED = parsedConfig.app
|
||||||
.notifications.product_updates
|
.notifications.product_updates
|
||||||
|
|||||||
@@ -330,7 +330,8 @@ export const configSchema = z
|
|||||||
enable_integration_api: z.boolean().optional(),
|
enable_integration_api: z.boolean().optional(),
|
||||||
disable_local_sites: z.boolean().optional(),
|
disable_local_sites: z.boolean().optional(),
|
||||||
disable_basic_wireguard_sites: z.boolean().optional(),
|
disable_basic_wireguard_sites: z.boolean().optional(),
|
||||||
disable_config_managed_domains: z.boolean().optional()
|
disable_config_managed_domains: z.boolean().optional(),
|
||||||
|
disable_product_help_banners: z.boolean().optional()
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
dns: z
|
dns: z
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState, useEffect, type ReactNode } from "react";
|
import React, { useState, useEffect, type ReactNode, useEffectEvent } from "react";
|
||||||
import { Card, CardContent } from "@app/components/ui/card";
|
import { Card, CardContent } from "@app/components/ui/card";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
|
|
||||||
type DismissableBannerProps = {
|
type DismissableBannerProps = {
|
||||||
storageKey: string;
|
storageKey: string;
|
||||||
@@ -25,6 +26,12 @@ export const DismissableBanner = ({
|
|||||||
const [isDismissed, setIsDismissed] = useState(true);
|
const [isDismissed, setIsDismissed] = useState(true);
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
|
|
||||||
|
const { env } = useEnvContext();
|
||||||
|
|
||||||
|
if (env.flags.disableProductHelpBanners) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const dismissedData = localStorage.getItem(storageKey);
|
const dismissedData = localStorage.getItem(storageKey);
|
||||||
if (dismissedData) {
|
if (dismissedData) {
|
||||||
|
|||||||
@@ -59,7 +59,11 @@ export function pullEnv(): Env {
|
|||||||
hideSupporterKey:
|
hideSupporterKey:
|
||||||
process.env.HIDE_SUPPORTER_KEY === "true" ? true : false,
|
process.env.HIDE_SUPPORTER_KEY === "true" ? true : false,
|
||||||
usePangolinDns:
|
usePangolinDns:
|
||||||
process.env.USE_PANGOLIN_DNS === "true" ? true : false
|
process.env.USE_PANGOLIN_DNS === "true" ? true : false,
|
||||||
|
disableProductHelpBanners:
|
||||||
|
process.env.FLAGS_DISABLE_PRODUCT_HELP_BANNERS === "true"
|
||||||
|
? true
|
||||||
|
: false
|
||||||
},
|
},
|
||||||
|
|
||||||
branding: {
|
branding: {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export type Env = {
|
|||||||
disableBasicWireguardSites: boolean;
|
disableBasicWireguardSites: boolean;
|
||||||
hideSupporterKey: boolean;
|
hideSupporterKey: boolean;
|
||||||
usePangolinDns: boolean;
|
usePangolinDns: boolean;
|
||||||
|
disableProductHelpBanners: boolean;
|
||||||
};
|
};
|
||||||
branding: {
|
branding: {
|
||||||
appName?: string;
|
appName?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user