mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-14 08:56:39 +00:00
add flag to disable product help banners
This commit is contained in:
committed by
Owen Schwartz
parent
d6e0024c96
commit
8732e50047
@@ -1,9 +1,10 @@
|
||||
"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 { X } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
|
||||
type DismissableBannerProps = {
|
||||
storageKey: string;
|
||||
@@ -25,6 +26,12 @@ export const DismissableBanner = ({
|
||||
const [isDismissed, setIsDismissed] = useState(true);
|
||||
const t = useTranslations();
|
||||
|
||||
const { env } = useEnvContext();
|
||||
|
||||
if (env.flags.disableProductHelpBanners) {
|
||||
return null;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const dismissedData = localStorage.getItem(storageKey);
|
||||
if (dismissedData) {
|
||||
|
||||
Reference in New Issue
Block a user