Skip to content

Commit

Permalink
Merge pull request #77 from Nexusrex18/Lavi
Browse files Browse the repository at this point in the history
....
  • Loading branch information
Nexusrex18 authored Sep 14, 2024
2 parents ce64c2e + a54b561 commit 0accf03
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 27 deletions.
17 changes: 11 additions & 6 deletions client/src/components/Farmer/FDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import { useState, useEffect } from 'react';
import { collection, getDocs } from 'firebase/firestore';
import { db } from '../../../firebase'; // Import your firebase configuration
import Navbar from './FarmNav';

import { useAuth } from '../context/auth_context';
import { useNavigate } from 'react-router-dom';



function Box({ data, showSecondaryBox }) {
return (
<div className={styles['box-primary']}>
<div className={styles['primary-details']}>
<p>Name: {data.profile?.displayName || 'N/A'} {data.profile?.lname || ''}</p>
<p>Contact Name: {data.displayName || 'N/A'} </p>
<p>{data.profile?.displayName || 'N/A'} {data.profile?.lname || ''}</p>
<p>Phone: {data.profile?.phone || 'N/A'}</p>
<p className={styles.emu}>Email : {data.profile?.email || 'N/A'}</p>
<p>State: {data.address?.state || 'N/A'}</p>
</div>
<div className={styles['primary-btn']}>
Expand All @@ -25,6 +26,10 @@ function Box({ data, showSecondaryBox }) {


function Secondarybox({ data, hideSecondaryBox }) {

const {currentUser} = useAuth();
const navigate = useNavigate();

return (
<div className={styles['box-sec']}>
<h3>Details:</h3>
Expand All @@ -46,7 +51,7 @@ function Secondarybox({ data, hideSecondaryBox }) {
<p>Bank: {data.bank?.bank_name || 'N/A'}</p>

<div className={styles.contractBtn}>
<button>Make a Deal</button>
<button onClick={() => navigate('/chat', { state: { uid: data.profile?.uid, userType: 'farmer' } })}>Negotiate</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -173,11 +178,11 @@ function FDashboard() {
const [searchQuery,setSearchQuery] = useState('');

return (
<>
<div className={styles.dashbody}>
<Navbar />
<Search handleSearch={(e) => setSearchQuery(e.target.value)} />
<MainBox searchQuery={searchQuery} />
</>
</div>
);
}

Expand Down
12 changes: 10 additions & 2 deletions client/src/components/Farmer/FDashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
body {
/* overflow-x: hidden; */
}
.dashbody{
background-color: white;
}
.headerfd {
height: 17vh;
background-color: green;
Expand Down Expand Up @@ -110,6 +113,7 @@ body {
justify-content: center;
gap: 250px;
border: 0.5px solid rgb(159, 159, 159);
background-color: white;
}
.search-box-div {
display: flex;
Expand Down Expand Up @@ -218,7 +222,7 @@ body {
}
.primary-details {
width: 70%;
font-size: 16px;
font-size: 22px;
/* padding: 30px;
line-height: 25px; */
display: flex;
Expand All @@ -229,6 +233,7 @@ body {
gap: 10px;
/* border: 1px solid; */
/* line-height: 20px; */
text-transform: capitalize;
}
.primary-btn {
display: flex;
Expand All @@ -250,7 +255,7 @@ body {
box-shadow: none;
}
.primary-btn button:hover {
background-color: white;
background: white;
color: #00b207;
}
::-webkit-scrollbar {
Expand Down Expand Up @@ -442,4 +447,7 @@ body {
border-radius: 7rem;
border: 0.5px solid #ccc;
filter: opacity(0.8);
}
.emu{
overflow: hidden;
}
6 changes: 6 additions & 0 deletions client/src/components/Farmer/FarmNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ function Navbar() {
>
Notifications
</li>
<li
className={activeItem === '/chat' ? styles.activeNavItem : ''}
onClick={() => navigate('/chat', { state: { userType:'farmer'} })}
>
Chats
</li>
{/* <li
className={activeItem === '/contact' ? styles.activeNavItem : ''}
onClick={() => handleNavClick('/contact')}
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Farmer/FarmSell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function FarmSell() {
};

return (
<>
<div className={styles.divbody}>
<Navbar />
<Search
searchQuery={searchQuery}
Expand All @@ -312,7 +312,7 @@ function FarmSell() {
</button>
</div>
<ToastContainer />
</>
</div>
);
}

Expand Down
16 changes: 11 additions & 5 deletions client/src/components/Farmer/FarmSell.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
body {
/* overflow-x: hidden; */
}
.divbody{
background-color: white;
}
.headfs {
height: 17vh;
height: 140px;
background-color: green;
border: 1px solid #ccc;
}
Expand Down Expand Up @@ -102,6 +105,7 @@ body {
font-weight: 600;
text-align: center;
}

.navs ul li:hover{
/* background-color: #1fe726;
border :1px solid #1fe726; */
Expand Down Expand Up @@ -130,6 +134,7 @@ body {
justify-content: center;
gap: 250px;
border: 0.5px solid rgb(159, 159, 159);
background-color: white;
}
.search-box-div {
display: flex;
Expand Down Expand Up @@ -210,7 +215,7 @@ body {
height: 75vh;
background-color: white;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
/* margin: 15px; */
padding-top: 15px;
justify-items: center;
Expand All @@ -233,7 +238,7 @@ body {
box-shadow: 2px 2px 2px rgba(8, 0, 0, 0.4);
}
.box-crop img {
width: 90%;
width: 100%;
height: 80%;
/* justify-self: center; */
border-radius: 0.3rem;
Expand All @@ -254,8 +259,9 @@ body {
}

.box-crop input[type='radio']:checked {
background-color: #00b207;
border-color: #00b207;
background: linear-gradient(to left top, #a25fff, #7b9afe, #11cbbb, #25fc4c);
border-color: yellowgreen;

}
/* ````````````````````````````````````````````````` */
.formbox {
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/LandingPage/LandingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export default function LandingPage() {


<div className="left">
<h1>{slide.caption}</h1>
<p>{slide.description}</p>
<h1 className='h1cap'>{slide.caption}</h1>
<p className='pcap'>{slide.description}</p>
<button className="btnii" onClick={()=>{navigate(slide.link)}}>{slide.button}</button>
</div>

Expand Down Expand Up @@ -145,6 +145,7 @@ export default function LandingPage() {
</section>

{/* How It Works Section */}
<div className="howCta">
<section className="how-it-works">
<h2>How KrishiSeva Works: A Simple 3-Step Process</h2>
<ol>
Expand All @@ -160,6 +161,7 @@ export default function LandingPage() {
<p>Already trusted by hundreds of farmers and buyers across the region, KrishiSeva is transforming the agricultural landscape.</p>
<a href="#" className="button">Start Your Journey with KrishiSeva Today</a>
</section>
</div>

{/* Footer */}
<footer>
Expand Down
62 changes: 52 additions & 10 deletions client/src/components/LandingPage/landing.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
line-height: 1.6;
/* line-height: 1.6; */
color: #333;
background-color: #f7f5eb;

Expand Down Expand Up @@ -45,13 +45,14 @@ body {

.right img{
height:225px;
width:200px;
/* width:200px; */

}

.left {
width:50%;
padding-top:100px;
width: 50%;
padding-top: 45px;
padding-left: 40px;
}

.right{
Expand All @@ -64,8 +65,17 @@ body {
}

.btnii{
margin-top: 20px;
background-color:#006400;
color:white;
padding: 20px 10px;
width: 200px;
font-size: 20px;
border-radius: 0.5rem;
}

.btnii:hover{
background-color: #097c09;
}


Expand Down Expand Up @@ -116,7 +126,8 @@ body {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
width: 55px
;
padding: 16px;
margin-top: -22px;
color: white;
Expand Down Expand Up @@ -217,7 +228,7 @@ body {

.central-section {
padding: 4rem 2rem;
background: rgb(217, 241, 217);
background: #eef3d2;
text-align: center;

}
Expand Down Expand Up @@ -249,14 +260,27 @@ body {
}

.how-it-works, .cta-section {
padding: 4rem 2rem;
padding: 4rem 1rem;
text-align: center;
}
/* .how-it-works{
margin-top: 100px;
} */
.cta-section{
/* margin-bottom: 2rem; */
margin: 0;
padding: 0;
padding-bottom: 20px;
}

.how-it-works h2, .cta-section h2 {
font-size: 2rem;
.how-it-works h2{
font-size: 32px;
margin-bottom: 2rem;
}
.cta-section h2 {
font-size: 32px;
margin-bottom: 2rem;
}

.how-it-works ol {
list-style: decimal inside;
Expand All @@ -267,11 +291,29 @@ body {

.how-it-works li {
margin-bottom: 1rem;
font-size: 18px;
}
.cta-section p{
font-size: 18px;
}
.howCta{
/* display: flex;
flex-direction: column;
gap: 10px; */
}

footer {
background: #006400;
color: #fff;
padding: 1rem;
text-align: center;
}

/* ````````````````````````````````````````````````` */

.h1cap{
font-size: 35px;
font-weight: 600;
}
.pcap{
font-size: 22px;
}

0 comments on commit 0accf03

Please sign in to comment.