Skip to content

Commit cf0cfe5

Browse files
feat: enable weather widget based on environment variable
1 parent a0b4b31 commit cf0cfe5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ yarn-error.log*
4141
next-env.d.ts
4242

4343
tests/reports
44-
playwright-report
44+
playwright-report
45+
.env*.local

src/app/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import Link from 'next/link';
1+
import Link from "next/link";
2+
import WeatherWidget from "./weather-widget";
3+
4+
export default async function Home() {
5+
const isWeatherFeatureEnabled = process.env.WEATHER_WIDGET_ENABLED === "true";
26

3-
export default function Home() {
47
return (
58
<div className="container">
69
<h1>Welcome to Next.js + Playwright</h1>
710
<Link href="/form">Go to Form</Link>
11+
{isWeatherFeatureEnabled && <WeatherWidget />}
812
</div>
913
);
1014
}

0 commit comments

Comments
 (0)