From 8217794dd0131ebda6b483ad8ca646dcb3f2c149 Mon Sep 17 00:00:00 2001
From: Hrishikesh Dalal <1010hrishikesh@gmail.com>
Date: Mon, 13 Oct 2025 11:40:29 +0530
Subject: [PATCH 1/2] Added Deg C to F
---
src/pages/Weather.jsx | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/pages/Weather.jsx b/src/pages/Weather.jsx
index 00a6f72..18c3b43 100644
--- a/src/pages/Weather.jsx
+++ b/src/pages/Weather.jsx
@@ -29,6 +29,7 @@ export default function Weather() {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
+ const [unit, setUnit] = useState('C'); // °C by default
useEffect(() => {
fetchWeather(city);
@@ -52,6 +53,9 @@ export default function Weather() {
const current = data?.current_condition?.[0];
const forecast = data?.weather?.slice(0,3) || [];
+ // Helper to convert °C to °F
+ const displayTemp = (c) => unit === 'C' ? c : Math.round((c * 9/5) + 32);
+
return (
Weather Dashboard
@@ -59,25 +63,34 @@ export default function Weather() {
setCity(e.target.value)} placeholder="Enter city" />
+
+ {/* Toggle button */}
+
+
+
+
{loading &&
}
+
{current && (
- Temperature: {current.temp_C}°C
+ Temperature: {displayTemp(Number(current.temp_C))}°{unit}
Humidity: {current.humidity}%
Desc: {current.weatherDesc?.[0]?.value}
- {/* TODO: Dynamic background based on weather condition */}
)}
+
{forecast.map(day => (
- Avg Temp: {day.avgtempC}°C
+ Avg Temp: {displayTemp(Number(day.avgtempC))}°{unit}
Sunrise: {day.astronomy?.[0]?.sunrise}
))}
- {/* TODO: Add search history & favorites */}
);
}
+
From 028224fb2fed5ed6f7336694fe0cbacb2defb6b5 Mon Sep 17 00:00:00 2001
From: Hrishikesh Dalal <1010hrishikesh@gmail.com>
Date: Mon, 13 Oct 2025 11:50:08 +0530
Subject: [PATCH 2/2] Workflows Added
---
.github/workflows/require-assigned-issue.yml | 36 ++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 .github/workflows/require-assigned-issue.yml
diff --git a/.github/workflows/require-assigned-issue.yml b/.github/workflows/require-assigned-issue.yml
new file mode 100644
index 0000000..3a04492
--- /dev/null
+++ b/.github/workflows/require-assigned-issue.yml
@@ -0,0 +1,36 @@
+name: Require referenced assigned issue
+
+on:
+ pull_request:
+ types: [opened, edited, reopened, synchronize]
+
+permissions:
+ issues: read
+ pull-requests: write
+ contents: read
+
+jobs:
+ check-issue:
+ runs-on: ubuntu-latest
+ outputs:
+ result: ${{ steps.check.outputs.result }}
+ steps:
+ - name: Check referenced issue and assignee
+ id: check
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const pr = context.payload.pull_request;
+ const body = pr.body || '';
+ const issueRefMatch = body.match(/#(\d+)/);
+ if (!issueRefMatch) {
+ core.setOutput('result', 'no-issue');
+ core.setFailed('PR must reference an issue (e.g., "Closes #12").');
+ return;
+ }
+ const issueNumber = Number(issueRefMatch[1]);
+ const { data: issue } = await github.rest.issues.get({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issueNumber });
+ if (!issue) { core.setOutput('result','issue-not-found'); core.setFailed(`Referenced issue #${issueNumber} not found.`); return; }
+ if (!issue.assignee && (!issue.assignees || issue.assignees.length === 0)) { core.setOutput('result','unassigned'); core.setFailed(`Referenced issue #${issueNumber} is not assigned. Please assign the issue before opening a PR.`); return; }
+ core.setOutput('result','ok');