Skip to content

Commit fc06336

Browse files
committed
Add components
1 parent adc9610 commit fc06336

26 files changed

+1617
-201
lines changed

package-lock.json

Lines changed: 462 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"react-redux": "^7.2.3",
3535
"react-router-dom": "^5.2.0",
3636
"react-scripts": "4.0.3",
37+
"react-to-pdf": "^0.0.13",
3738
"redux-persist": "^6.0.0",
3839
"web-vitals": "^1.1.0"
3940
},

public/coconut.jpeg

317 KB
Loading

public/paddy.jpeg

304 KB
Loading

public/pesticides.jpeg

166 KB
Loading

public/vegetables.jpeg

283 KB
Loading

src/App.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import UMessages from "./components/user/UMessages";
2323
import UProfile from "./components/user/UProfile";
2424
import USurvey from "./components/user/USurvey";
2525
import URequests from "./components/user/URequests";
26+
import Recommendations from "./components/user/Recommendations";
27+
import ARequests from "./components/admin/ARequests";
28+
import Reports from "./components/admin/Reports";
2629

2730
function App() {
2831
const checkAuth = (component, type) => {
@@ -51,13 +54,21 @@ function App() {
5154
render={(props) => checkAuth(<Farmers {...props} />, "admin")}
5255
/>
5356
<Route
54-
path="/admin/divisions"
57+
path="/admin/branches"
5558
render={(props) => checkAuth(<Divisions {...props} />, "admin")}
5659
/>
5760
<Route
5861
path="/admin/messages"
5962
render={(props) => checkAuth(<Messages {...props} />, "admin")}
6063
/>
64+
<Route
65+
path="/admin/requests"
66+
render={(props) => checkAuth(<ARequests {...props} />, "admin")}
67+
/>
68+
<Route
69+
path="/admin/reports"
70+
render={(props) => checkAuth(<Reports {...props} />, "admin")}
71+
/>
6172
<Route
6273
path="/user/dashboard"
6374
render={(props) => checkAuth(<UDashboard {...props} />, "user")}
@@ -78,6 +89,10 @@ function App() {
7889
path="/user/requests"
7990
render={(props) => checkAuth(<URequests {...props} />, "user")}
8091
/>
92+
<Route
93+
path="/user/recommendations"
94+
render={(props) => checkAuth(<Recommendations {...props} />, "user")}
95+
/>
8196
<Route path="/about" component={About} />
8297
<Route path="/latest-news" component={LatestNews} />
8398
<Route path="/" component={Home} />

src/assets/data/crop_data.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
{
3+
"crop_id": 100,
4+
"name": "Eggplant",
5+
"crop_category": "Vegetables",
6+
"timestamp": 1619533809
7+
},
8+
{
9+
"crop_id": 105,
10+
"name": "Spiny gourd",
11+
"crop_category": "Vegetables",
12+
"timestamp": 1619533809
13+
},
14+
{
15+
"crop_id": 107,
16+
"name": "King coconut",
17+
"crop_category": "Fruits",
18+
"timestamp": 1619533672
19+
},
20+
{
21+
"crop_id": 108,
22+
"name": "Coconut",
23+
"crop_category": "Fruits",
24+
"timestamp": 1619533809
25+
},
26+
{
27+
"crop_id": 110,
28+
"name": "Bitter gourd",
29+
"crop_category": "Vegetables",
30+
"timestamp": 1619533809
31+
}
32+
]

src/assets/data/divisions.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const divisions = [
2+
{
3+
key: "1",
4+
name: "Akuressa",
5+
code: "204",
6+
tel: "041-2283166",
7+
address: "59,Matara Road, Akuressa",
8+
district: "Matara",
9+
province: "Southern",
10+
},
11+
{
12+
key: "2",
13+
name: "Deiyandara",
14+
code: "203",
15+
tel: "041-2268228",
16+
address: "Hakmana Road, Deiyandara",
17+
district: "Matara",
18+
province: "Southern",
19+
},
20+
{
21+
key: "3",
22+
name: "Deniyaya",
23+
code: "226",
24+
tel: "041-2273378",
25+
address: "Main Street, Deniyaya",
26+
district: "Matara",
27+
province: "Southern",
28+
},
29+
{
30+
key: "4",
31+
name: "Devinuwara",
32+
code: "254",
33+
tel: "041-2283166",
34+
address: "59, Light House Street, Devinuwara",
35+
district: "Matara",
36+
province: "Southern",
37+
},
38+
{
39+
key: "5",
40+
name: "Dikwella",
41+
code: "247",
42+
tel: "041-2257597",
43+
address: "82, Mahawela Road, Dikwella",
44+
district: "Matara",
45+
province: "Southern",
46+
},
47+
{
48+
key: "6",
49+
name: "Gandara",
50+
code: "206",
51+
tel: "041-2259585",
52+
address: "Main Street, Gandara",
53+
district: "Matara",
54+
province: "Southern",
55+
},
56+
];
57+
58+
export default divisions;

src/assets/data/requests.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
const requests = [
2+
{
3+
key: "1",
4+
name: "R. W. Premarathne",
5+
id: "F005",
6+
date: "2021/05/18",
7+
landarea: 570,
8+
crop_cat: "Spice",
9+
crop_name: "Cinnamon",
10+
quantity: 1000,
11+
},
12+
{
13+
key: "2",
14+
name: "D. U. Amarasinghe",
15+
id: "F002",
16+
date: "2021/05/16",
17+
landarea: 300,
18+
crop_cat: "Vegetable",
19+
crop_name: "Egg plant",
20+
quantity: 500,
21+
},
22+
{
23+
key: "3",
24+
name: "B. K. Bandula",
25+
id: "F009",
26+
date: "2021/05/03",
27+
landarea: 300,
28+
crop_cat: "Vegetable",
29+
crop_name: "Okra",
30+
quantity: 800,
31+
},
32+
{
33+
key: "4",
34+
name: "Ananda Wijesinghe",
35+
id: "F003",
36+
date: "2021/05/02",
37+
landarea: 600,
38+
crop_cat: "Fruit",
39+
crop_name: "Lemon",
40+
quantity: 600,
41+
},
42+
{
43+
key: "5",
44+
name: "V. P. S. Wijayakumara",
45+
id: "F004",
46+
date: "2021/05/16",
47+
landarea: 800,
48+
crop_cat: "Fruit",
49+
crop_name: "Banana",
50+
quantity: 100,
51+
},
52+
{
53+
key: "6",
54+
name: "V. P. Piyarathne",
55+
id: "F008",
56+
date: "2021/05/11",
57+
landarea: 400,
58+
crop_cat: "Spice",
59+
crop_name: "Pepper",
60+
quantity: 250,
61+
},
62+
];
63+
64+
export default requests;

0 commit comments

Comments
 (0)