Skip to content

Commit bd60983

Browse files
committed
add favicon, change leaf icon and remove unused React imports
1 parent 6f78b5f commit bd60983

12 files changed

Lines changed: 103 additions & 42 deletions

web/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>demetereye-web</title>
88
</head>

web/public/favicon.svg

Lines changed: 50 additions & 0 deletions
Loading

web/src/App.jsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
import React from "react";
2-
import { Routes, Route, Navigate, useLocation, Link, useNavigate } from "react-router-dom";
1+
import {
2+
Routes,
3+
Route,
4+
Navigate,
5+
useLocation,
6+
Link,
7+
useNavigate,
8+
} from "react-router-dom";
39
import AuthScreen from "./views/AuthScreen.jsx";
410
import FieldsList from "./views/FieldsList.jsx";
511
import CreateField from "./views/CreateField.jsx";
612
import FieldDetails from "./views/FieldDetails.jsx";
7-
import { LogOut, Leaf } from "lucide-react";
13+
import { LogOut } from "lucide-react";
814

915
function RequireAuth({ children }) {
1016
const token = localStorage.getItem("token");
@@ -22,7 +28,7 @@ function Shell({ children }) {
2228
<header className="sticky top-0 z-10 bg-white border-b">
2329
<div className="mx-auto max-w-6xl px-4 h-14 flex items-center justify-between">
2430
<Link to="/" className="inline-flex items-center gap-2 font-semibold">
25-
<Leaf className="h-4 w-4 text-emerald-600" />
31+
<img src="/public/favicon.svg" className="h-16 w-16" />
2632
DemeterEye
2733
</Link>
2834
{token && (
@@ -49,7 +55,10 @@ export default function App() {
4955
return (
5056
<Shell>
5157
<Routes>
52-
<Route path="/" element={<Navigate to={token ? "/fields" : "/login"} replace />} />
58+
<Route
59+
path="/"
60+
element={<Navigate to={token ? "/fields" : "/login"} replace />}
61+
/>
5362

5463
<Route path="/login" element={<AuthScreen />} />
5564

@@ -78,7 +87,10 @@ export default function App() {
7887
}
7988
/>
8089

81-
<Route path="*" element={<div className="p-6 text-gray-600">Not found</div>} />
90+
<Route
91+
path="*"
92+
element={<div className="p-6 text-gray-600">Not found</div>}
93+
/>
8294
</Routes>
8395
</Shell>
8496
);

web/src/components/FieldDrawMap.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// src/components/FieldDrawMap.jsx
2-
import React, { useEffect, useRef, useState, useMemo } from "react";
2+
import { useEffect, useRef, useState, useMemo } from "react";
33
import {
44
MapContainer,
55
TileLayer,
@@ -13,14 +13,14 @@ import { EditControl } from "react-leaflet-draw";
1313
import L from "leaflet";
1414

1515
export default function FieldDrawMap({
16-
value, // GeoJSON geometry: Polygon | MultiPolygon
16+
value, // GeoJSON geometry: Polygon | MultiPolygon
1717
onChange,
1818
initialCenter = [47.4554598, -122.2208032],
1919
initialZoom = 14,
2020
rememberView = true,
2121
fitToGeometry = true,
2222
className = "w-full h-[70vh] rounded-xl border",
23-
mode = "view", // "view" | "edit" | "draw"
23+
mode = "view", // "view" | "edit" | "draw"
2424
}) {
2525
const fgRef = useRef(null);
2626
const mapRef = useRef(null);
@@ -98,7 +98,11 @@ export default function FieldDrawMap({
9898
// Toolbar options by mode
9999
const editControlExtra =
100100
mode === "view"
101-
? { edit: false, remove: false, selectedPathOptions: { maintainColor: true } }
101+
? {
102+
edit: false,
103+
remove: false,
104+
selectedPathOptions: { maintainColor: true },
105+
}
102106
: { selectedPathOptions: { maintainColor: true } };
103107

104108
const drawOptions =

web/src/components/MetricsChart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useMemo, useState, useEffect } from "react";
1+
import { useMemo, useState, useEffect } from "react";
22
import {
33
LineChart,
44
Line,

web/src/components/SimpleClickMap.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import { useState } from "react";
22

33
export default function SimpleClickMap({ coords, setCoords }) {
44
// Minimal SVG pad to capture polygon points without external map deps.

web/src/components/StatusPill.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from "react";
2-
31
/** Small colored pill for field status: processing | ready | error */
42
export default function StatusPill({ status }) {
53
const map = {
@@ -16,7 +14,10 @@ export default function StatusPill({ status }) {
1614
cls: "bg-rose-100 text-rose-700 ring-rose-200",
1715
},
1816
};
19-
const m = map[status] || { label: "Unknown", cls: "bg-gray-100 text-gray-700 ring-gray-200" };
17+
const m = map[status] || {
18+
label: "Unknown",
19+
cls: "bg-gray-100 text-gray-700 ring-gray-200",
20+
};
2021

2122
return (
2223
<span
@@ -26,4 +27,4 @@ export default function StatusPill({ status }) {
2627
{m.label}
2728
</span>
2829
);
29-
}
30+
}

web/src/components/Topbar.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import React from "react";
2-
import { Leaf, LogOut } from "lucide-react";
1+
import { LogOut } from "lucide-react";
32

43
export default function Topbar({ onLogout }) {
54
return (
65
<div className="sticky top-0 z-10 bg-white/80 backdrop-blur border-b">
76
<div className="mx-auto max-w-6xl px-4 md:px-6 h-14 flex items-center justify-between">
87
<div className="flex items-center gap-2 font-semibold">
9-
<Leaf className="h-5 w-5 text-emerald-600" />
8+
<img src="/public/favicon.svg" className="h-16 w-16" />
109
<span>DemeterEye</span>
1110
</div>
1211
<button

web/src/views/AuthScreen.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { useState } from "react";
2-
import { Leaf, Loader2 } from "lucide-react";
1+
import { useState } from "react";
2+
import { Loader2 } from "lucide-react";
33
import { apiFetch } from "../lib/api.js";
44
import { useLocation, useNavigate } from "react-router-dom";
55

@@ -48,7 +48,7 @@ export default function AuthScreen() {
4848
<div className="min-h-[70vh] grid place-items-center p-4">
4949
<div className="w-full max-w-md rounded-2xl border bg-white p-6 shadow-sm">
5050
<div className="flex items-center gap-2 mb-4">
51-
<Leaf className="h-5 w-5 text-emerald-600" />
51+
<img src="/public/favicon.svg" className="h-16 w-16" />
5252
<h1 className="text-xl font-semibold">DemeterEye</h1>
5353
</div>
5454
<p className="text-gray-600 mb-4">

web/src/views/CreateField.jsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from "react";
1+
import { useState, useEffect } from "react";
22
import area from "@turf/area";
33
import { useNavigate } from "react-router-dom";
44
import {
@@ -18,16 +18,10 @@ export default function CreateField() {
1818
const [areaHa, setArea] = useState("");
1919
const [autoAreaHa, setAutoAreaHa] = useState();
2020
const [autoCalcArea, setAutoCalcArea] = useState(true);
21-
const [overrideArea, setOverrideArea] = useState(false);
22-
const [photo, setPhoto] = useState("");
21+
const [_overrideArea, setOverrideArea] = useState(false);
22+
const [photo, _setPhoto] = useState("");
2323
const [crop, setCrop] = useState("");
24-
const CROP_OPTIONS = [
25-
"Potato",
26-
"Soybean",
27-
"Sugar Beet",
28-
"Tomato",
29-
"Wheat",
30-
];
24+
const CROP_OPTIONS = ["Potato", "Soybean", "Sugar Beet", "Tomato", "Wheat"];
3125
const [notes, setNotes] = useState("");
3226
const [geometry, setGeometry] = useState(null);
3327
const [yields, setYields] = useState([
@@ -73,14 +67,16 @@ export default function CreateField() {
7367
});
7468
};
7569
const addYieldRow = () => {
76-
7770
if (yields.length === 0) {
78-
setYields((p) => [...p, { year: new Date().getFullYear(), valueTph: "", unit: "t/ha" }]);
71+
setYields((p) => [
72+
...p,
73+
{ year: new Date().getFullYear(), valueTph: "", unit: "t/ha" },
74+
]);
7975
return;
8076
}
8177
const prevYear = yields[yields.length - 1].year - 1;
8278
setYields((p) => [...p, { year: prevYear, valueTph: "", unit: "t/ha" }]);
83-
}
79+
};
8480
const removeYieldRow = (idx) =>
8581
setYields((p) => p.filter((_, i) => i !== idx));
8682

@@ -131,7 +127,6 @@ export default function CreateField() {
131127
<div className="grid gap-4 lg:grid-cols-[2fr_1fr]">
132128
{/* LEFT: Map + tips */}
133129
<div className="flex flex-col gap-4">
134-
135130
<div className="rounded-2xl border bg-white p-3">
136131
<div className="flex items-center justify-between mb-2">
137132
<h3 className="font-semibold flex items-center gap-2">

0 commit comments

Comments
 (0)