Skip to content

Commit

Permalink
adding conditional with environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizFNJ committed Nov 8, 2024
1 parent 7a0689a commit 3882a81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DATA_PATH=../
DEVELOPMENT_PASSWORD=123456
ENVIRONMENT=watch-dev
FROM_EMAIL=[email protected]
NEXT_PUBLIC_ENABLE_BANNER_DONATION=

MONGODB_NAME=Aletheia
MONGODB_PORT=27017
Expand Down
5 changes: 5 additions & 0 deletions src/components/Home/DonationBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ import { useTranslation } from "next-i18next";
const DonationBanner = () => {
const { t } = useTranslation();
const [isBannerVisible, setIsBannerVisible] = useState(true);
const enableDonationBanner = process.env.NEXT_PUBLIC_ENABLE_BANNER_DONATION === "true";
const handleToggleBanner = () => {
setIsBannerVisible((prev) => !prev);
}

if (!enableDonationBanner){
return null
};

return (
<DonationBannerStyle>
<Col className="banner-container">
Expand Down

0 comments on commit 3882a81

Please sign in to comment.