-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Prakhar-commits/refactored
Merge refactored into component_addition
- Loading branch information
Showing
6 changed files
with
315 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React from "react"; | ||
import styles from "./scholarship_finder.module.css"; | ||
|
||
const ScholarshipTable = ({ | ||
filteredData, | ||
toggleRowExpansion, | ||
expandedRows, | ||
}) => { | ||
return ( | ||
<table className={styles.table}> | ||
<thead> | ||
<tr className={styles.header_row}> | ||
<th>Scholarship Name</th> | ||
<th>Status</th> | ||
<th>Gender</th> | ||
<th>Category</th> | ||
<th>Application Link</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{filteredData.map((item, index) => ( | ||
<React.Fragment key={index}> | ||
<tr | ||
onClick={() => toggleRowExpansion(index)} | ||
className={index % 2 === 0 ? styles.even_row : styles.odd_row} | ||
> | ||
<td className={styles.cell}>{item["Scholarship Name"]}</td> | ||
<td className={styles.cell}>{item.Status}</td> | ||
<td className={styles.cell}>{item.Gender}</td> | ||
<td className={styles.cell}>{item.Category}</td> | ||
<td className={styles.cell}> | ||
<a | ||
href={item["Application Link"]} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{item["Application Link"]} | ||
</a> | ||
</td> | ||
</tr> | ||
{expandedRows[index] && ( | ||
<tr | ||
className={index % 2 === 0 ? styles.even_row : styles.odd_row} | ||
> | ||
<td colSpan="5"> | ||
<div> | ||
<b>Eligibility</b>: {item.Eligibility} <br /> | ||
<b>Benefits</b>: {item.Benefits} <br /> | ||
<b>Doc Required</b>: {item["Doc Required"]} <br /> | ||
<b>Can Class 11 Apply</b>: {item["Class 11 can Apply"]}{" "} | ||
<br /> | ||
<b>Can Class 12 Apply</b>: {item["Class 12 can Apply"]}{" "} | ||
<br /> | ||
<b>Family Income (in LPA)</b>:{" "} | ||
{item["Family Income (in LPA)"]} <br /> | ||
<b>Last Date</b>: {item["Last Date"]} <br /> | ||
<b>Open for Stream</b>: {item["Open for Stream"]} <br /> | ||
<b>Special Criteria</b>: {item["Special Criteria"]} <br /> | ||
</div> | ||
</td> | ||
</tr> | ||
)} | ||
</React.Fragment> | ||
))} | ||
</tbody> | ||
</table> | ||
); | ||
}; | ||
|
||
export default ScholarshipTable; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.container { | ||
margin: auto; | ||
max-width: 600px; | ||
padding: 20px; | ||
height: 100vh; | ||
} | ||
|
||
.content { | ||
max-width: 600px; | ||
padding: 20px; | ||
text-align: center; | ||
font-size: 11pt; | ||
} | ||
|
||
.paragraph { | ||
line-height: 5pt; | ||
margin-bottom: 10px; /* between paragraphs */ | ||
padding: 0px; | ||
} | ||
|
||
.table { | ||
width: 40rem; | ||
border-collapse: collapse; | ||
margin: auto; | ||
} | ||
|
||
.header_row { | ||
background-color: #acacac; | ||
font-weight: bold; | ||
padding: 10px; | ||
text-align: center; | ||
} | ||
|
||
.cell { | ||
padding: 20px; | ||
border-bottom: 1px solid #ddd; | ||
text-align: center; | ||
} | ||
|
||
.even_row { | ||
background-color: #f9f9f9; | ||
} | ||
|
||
.odd_row { | ||
background-color: #e9e9e9; | ||
} | ||
|
||
.loading { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
margin-top: 2rem; | ||
} | ||
|
||
.spinner { | ||
border: 4px solid #f3f3f3; | ||
border-top: 4px solid #3498db; | ||
border-radius: 50%; | ||
width: 30px; | ||
height: 30px; | ||
animation: spin 1s linear infinite; | ||
} | ||
|
||
@keyframes spin { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.content { | ||
max-width: 600px; | ||
text-align: center; | ||
} | ||
|
||
.input { | ||
padding: 8px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
width: 100%; | ||
} | ||
|
||
.button { | ||
margin-top: 10px; | ||
padding: 10px 20px; | ||
background-color: #0070f3; | ||
color: white; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
.button:hover { | ||
background-color: #0052cc; | ||
} | ||
|
||
.button:active { | ||
background-color: #003f99; | ||
} | ||
|
||
.button:disabled { | ||
background-color: #ddd; | ||
cursor: not-allowed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.container { | ||
margin: auto; | ||
max-width: 600px; | ||
padding: 20px; | ||
height: 100vh; | ||
} | ||
|
||
.content { | ||
max-width: 600px; | ||
padding: 20px; | ||
text-align: center; | ||
font-size: 11pt; | ||
} | ||
|
||
.paragraph { | ||
line-height: 5pt; | ||
margin-bottom: 10px; /* between paragraphs */ | ||
padding: 0px; | ||
} | ||
|
||
.table { | ||
width: 40rem; | ||
border-collapse: collapse; | ||
margin: auto; | ||
} | ||
|
||
.header_row { | ||
background-color: #acacac; | ||
font-weight: bold; | ||
padding: 10px; | ||
text-align: center; | ||
} | ||
|
||
.cell { | ||
padding: 20px; | ||
border-bottom: 1px solid #ddd; | ||
text-align: center; | ||
max-width: 280px; | ||
word-wrap: break-word; | ||
} | ||
|
||
.even_row { | ||
background-color: #f9f9f9; | ||
} | ||
|
||
.odd_row { | ||
background-color: #e9e9e9; | ||
} | ||
|
||
.loading { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
margin-top: 2rem; | ||
} | ||
|
||
.spinner { | ||
border: 4px solid #f3f3f3; | ||
border-top: 4px solid #3498db; | ||
border-radius: 50%; | ||
width: 30px; | ||
height: 30px; | ||
animation: spin 1s linear infinite; | ||
} | ||
|
||
@keyframes spin { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
.container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.content { | ||
max-width: 600px; | ||
text-align: center; | ||
} | ||
|
||
.input { | ||
padding: 8px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
width: 100%; | ||
} | ||
|
||
.button { | ||
margin-top: 10px; | ||
padding: 10px 20px; | ||
background-color: #0070f3; | ||
color: white; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
.button:hover { | ||
background-color: #0052cc; | ||
} | ||
|
||
.button:active { | ||
background-color: #003f99; | ||
} | ||
|
||
.button:disabled { | ||
background-color: #ddd; | ||
cursor: not-allowed; | ||
} | ||
|
||
.expandable-row { | ||
display: none; | ||
} | ||
|
||
.expanded-row { | ||
display: table-row; | ||
} | ||
|
||
.expanded-row td { | ||
text-align: left; | ||
align-items: left; | ||
} |