From 5a55ba195f1bc10e5f85b706980c35f96d065d29 Mon Sep 17 00:00:00 2001 From: Nandini Chatterjee Date: Thu, 1 May 2025 17:35:20 +0100 Subject: [PATCH 1/9] fix: conditionally render WeatherWidget based on environment variable --- .gitignore | 3 ++- src/app/layout.tsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 73d6529..0f21eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,5 @@ yarn-error.log* next-env.d.ts tests/reports -playwright-report \ No newline at end of file +playwright-report +.env*.local diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3267ce1..d38e155 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,6 +6,8 @@ import Header from "./header"; // Import the Header component import Footer from "./footer"; // Import the Footer component import { useState } from "react"; +const showWeatherWidget = process.env.NEXT_PUBLIC_SHOW_WEATHER_WIDGET; + export default function RootLayout({ children, }: { @@ -29,7 +31,7 @@ export default function RootLayout({
{children} - + {showWeatherWidget && }