Skip to content

Commit

Permalink
Merge pull request #1 from Prakhar-commits/refactored
Browse files Browse the repository at this point in the history
Merge refactored into component_addition
  • Loading branch information
Prakhar-commits authored Sep 27, 2023
2 parents 8e20310 + 2d4b254 commit 88b6f10
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 1 deletion.
70 changes: 70 additions & 0 deletions components/ScholarTable.js
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;
5 changes: 4 additions & 1 deletion public/data/scholarships/scholarship_data.json

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions styles/college_predictor.module.css
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);
}
}
41 changes: 41 additions & 0 deletions styles/index.module.css
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;
}
74 changes: 74 additions & 0 deletions styles/scholarship_finder.module.css
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);
}
}
54 changes: 54 additions & 0 deletions styles/scholarships.module.css
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;
}

0 comments on commit 88b6f10

Please sign in to comment.