Skip to content

Commit

Permalink
remove the submit btn of ward
Browse files Browse the repository at this point in the history
  • Loading branch information
muzammil-85 committed Nov 14, 2024
1 parent 9404f8b commit d6a2089
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 240 deletions.
35 changes: 17 additions & 18 deletions src/app/admin/activity/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ const AdminGrid = () => {

{selectedDistrict != "" ?

<div className="flex items-center mb-3 space-x-2">
<><div className="flex items-center mb-3 space-x-2">
<label htmlFor="groupFilter" className="text-sm font-medium">
Lsgd:
</label>
Expand All @@ -1206,23 +1206,22 @@ const AdminGrid = () => {
</option>
))}
</select>
</div>
// <div>
// <label>Ward No</label>
// <div className="flex mb-3">
// <input
// className="border px-2 h-10 text-sm border-gray-950 rounded-md shadow-sm focus:outline-none focus:ring-green-700 focus:border-green-700 "
// value={selectedWard}
// onChange={(e) => setSelectedWard(e.target.value)} // Update the state directly
// />
// <button
// className="text-white ml-2 text-sm py-2 px-4 bg-[#3C6E1F] rounded-xl shadow-lg"
// onClick={() => handleFilterChangeWard(selectedWard)}
// >
// Search
// </button>
// </div>
// </div>
</div><div>
<label>Ward No</label>
<div className="flex mb-3">
<input
className="border px-2 h-10 text-sm border-gray-950 rounded-md shadow-sm focus:outline-none focus:ring-green-700 focus:border-green-700 "
value={selectedWard}
onChange={(e) => setSelectedWard(e.target.value)} // Update the state directly
/>
{/* <button
className="text-white ml-2 text-sm py-2 px-4 bg-[#3C6E1F] rounded-xl shadow-lg"
onClick={() => handleFilterChangeWard(selectedWard)}
>
Search
</button> */}
</div>
</div></>
: ''}
</> : ''}
</> : ''}
Expand Down
238 changes: 129 additions & 109 deletions src/app/admin/challenges/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -991,115 +991,135 @@ const AdminGrid = () => {
</div> */}

{/* country section */}
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2">
{/* Country Field */}
<div className="flex flex-col mb-3 w-full">
<label htmlFor="groupFilter" className="text-sm font-medium">
Country:
</label>
<select
id="groupFilter"
value={selectedCntry}
onChange={handleFilterChangeCntry}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose Country</option>
{countries.map((country) => (
<option key={country.cntry_id} value={country.cntry_name}>
{country.cntry_name}
</option>
))}
</select>
</div>

{/* State Field (Visible if selected country is India) */}
{selectedCntry === "India" && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="stateFilter" className="text-sm font-medium">
State:
</label>
<select
id="stateFilter"
value={selectedState}
onChange={handleFilterChangeState}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose State</option>
{states.map((state) => (
<option key={state.st_id} value={state.st_name}>
{state.st_name}
</option>
))}
</select>
</div>
)}

{/* District Field (Visible if selected state is Kerala) */}
{selectedState === "Kerala" && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="districtFilter" className="text-sm font-medium">
District:
</label>
<select
id="districtFilter"
value={selectedDistrict}
onChange={handleFilterChangeDistrict}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose District</option>
{districts.map((district) => (
<option key={district.dis_id} value={district.dis_name}>
{district.dis_name}
</option>
))}
</select>
</div>
)}

{/* Corporation Field (Visible if a district is selected) */}
{selectedDistrict && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="corpFilter" className="text-sm font-medium">
Corporation:
</label>
<select
id="corpFilter"
value={selectedCorp}
onChange={handleFilterChangeCorp}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose Corporation</option>
{corporation.map((corp) => (
<option key={corp.cop_id} value={corp.cop_name}>
{corp.cop_name}
</option>
))}
</select>
</div>
)}

{/* Lsgd Field (Visible if a corporation is selected) */}
{selectedDistrict && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="lsgdFilter" className="text-sm font-medium">
Lsgd:
</label>
<select
id="lsgdFilter"
value={selectedLsgd}
onChange={handleFilterChangeLsgd}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose Lsgd</option>
{lsgd && lsgd.map((lsg) => (
<option key={lsg.lsg_id} value={lsg.lsg_name}>
{lsg.lsg_name}
</option>
))}
</select>
</div>
)}
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{/* Country Field */}
<div className="flex flex-col mb-3 w-full">
<label htmlFor="groupFilter" className="text-sm font-medium">
Country:
</label>
<select
id="groupFilter"
value={selectedCntry}
onChange={handleFilterChangeCntry}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose Country</option>
{countries.map((country) => (
<option key={country.cntry_id} value={country.cntry_name}>
{country.cntry_name}
</option>
))}
</select>
</div>

{/* State Field (Visible if selected country is India) */}
{selectedCntry === "India" && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="stateFilter" className="text-sm font-medium">
State:
</label>
<select
id="stateFilter"
value={selectedState}
onChange={handleFilterChangeState}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose State</option>
{states.map((state) => (
<option key={state.st_id} value={state.st_name}>
{state.st_name}
</option>
))}
</select>
</div>
)}

{/* District Field (Visible if selected state is Kerala) */}
{selectedState === "Kerala" && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="districtFilter" className="text-sm font-medium">
District:
</label>
<select
id="districtFilter"
value={selectedDistrict}
onChange={handleFilterChangeDistrict}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose District</option>
{districts.map((district) => (
<option key={district.dis_id} value={district.dis_name}>
{district.dis_name}
</option>
))}
</select>
</div>
)}

{/* Corporation Field (Visible if a district is selected) */}
{selectedDistrict && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="corpFilter" className="text-sm font-medium">
Corporation:
</label>
<select
id="corpFilter"
value={selectedCorp}
onChange={handleFilterChangeCorp}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose Corporation</option>
{corporation.map((corp) => (
<option key={corp.cop_id} value={corp.cop_name}>
{corp.cop_name}
</option>
))}
</select>
</div>
)}

{/* Lsgd Field (Visible if a corporation is selected) */}
{selectedDistrict && (
<div className="flex flex-col mb-3 w-full">
<label htmlFor="lsgdFilter" className="text-sm font-medium">
Lsgd:
</label>
<select
id="lsgdFilter"
value={selectedLsgd}
onChange={handleFilterChangeLsgd}
className="border border-gray-300 rounded p-1 w-full"
>
<option value="">Choose Lsgd</option>
{lsgd && lsgd.map((lsg) => (
<option key={lsg.lsg_id} value={lsg.lsg_name}>
{lsg.lsg_name}
</option>
))}
</select>
</div>
)}

{/* Ward Field (Visible if an Lsgd is selected) */}
{selectedDistrict && (
<div className="flex flex-col mb-3 w-full">
<label className="text-sm font-medium">Ward No</label>
<div className="flex space-x-2">
<input
className="border px-2 h-10 text-sm border-gray-950 rounded-md shadow-sm focus:outline-none focus:ring-green-700 focus:border-green-700 w-full"
value={selectedWard}
onChange={(e) => setSelectedWard(e.target.value)}
/>
{/* <button
className="text-white text-sm py-2 px-4 bg-[#3C6E1F] rounded-xl shadow-lg"
onClick={() => handleFilterChangeWard(selectedWard)}
>
Search
</button> */}
</div>
</div>
)}
</div>
<div className="flex items-center mb-3 space-x-2">
<label htmlFor="groupFilter" className="text-sm font-medium">
Group Type:
Expand Down
4 changes: 2 additions & 2 deletions src/app/admin/coordinators/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1105,12 +1105,12 @@ setTotalcount("0");
value={selectedWard}
onChange={(e) => setSelectedWard(e.target.value)}
/>
<button
{/* <button
className="text-white text-sm py-2 px-4 bg-[#3C6E1F] rounded-xl shadow-lg"
onClick={() => handleFilterChangeWard(selectedWard)}
>
Search
</button>
</button> */}
</div>
</div>
)}
Expand Down
Loading

0 comments on commit d6a2089

Please sign in to comment.