Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling/applications index #116

Merged
merged 12 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed cypress/downloads/downloads.html
Binary file not shown.
2 changes: 0 additions & 2 deletions cypress/e2e/jobsApplicationSpec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ describe("Job app page after logging in", () => {
cy.wait("@getJobApplications");

cy.get("h1").should("have.text", "Applications");

cy.get(".border.rounded-lg.overflow-hidden").should("exist");
});

it("Should display a spinner while loading and show data after loading completes", () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/loginSpec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ describe('testing for Login page', () => {
cy.get("#email").type("[email protected]")
cy.get("#password").type("jerseyMikesRox7")
cy.get('[data-testid="login-button"]').click();
cy.get("h1").should("have.text", "Welcome,Danny DeVito");
cy.get("h1").should("have.text", "Welcome, Danny DeVito");
cy.reload();
cy.get("h1").should("have.text", "Welcome,Danny DeVito");
cy.get("h1").should("have.text", "Welcome, Danny DeVito");
})
});
4 changes: 2 additions & 2 deletions cypress/e2e/newJobApplicationSpec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('Create New Job Application page after logging in', () => {
cy.wait('@postUserInfo');
cy.get('a[href="/job_applications"]').first().click();
cy.wait('@getJobApplications')
cy.get('.bg-teal-500').click();
cy.get('a > .bg-cyan-600').click();
})

describe("Happy Paths", () => {
Expand Down Expand Up @@ -192,7 +192,7 @@ describe('Create New Job Application page after logging in', () => {
cy.get('button[type="submit"]').click();
cy.url().should('include', '/job_applications');
cy.get(':nth-child(3) > :nth-child(2) > a').should('contain', 'Test Position');
cy.get(':nth-child(3) > :nth-child(3) > a > .py-1').should('contain', 'Offer');
cy.get(':nth-child(3) > :nth-child(3) > a > .py-2').should('contain', 'Offer');
});
})

Expand Down
16 changes: 8 additions & 8 deletions src/components/JobApplicationUtilities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export const statusMap: { [key: number]: string } = {
};

export const statusStyles: { [key: string]: string } = {
Submitted: 'bg-yellow-200 text-yellow-800',
Interviewing: 'bg-green-200 text-green-800',
Offer: 'bg-teal-300 text-teal-900',
Rejected: 'bg-red-200 text-red-800',
'Phone Screen': 'bg-yellow-300 text-yellow-900',
'Code Challenge': 'bg-blue-200 text-blue-800',
'Not Yet Applied': 'bg-orange-200 text-orange-800',
};
Submitted: 'bg-[#e7e07e] text-black',
Interviewing: 'bg-[#e1f3e4] text-black',
Offer: 'bg-[#10a689] text-white',
Rejected: 'bg-[#cd644f] text-white',
'Phone Screen': 'bg-[#fac712] text-black',
'Code Challenge': 'bg-blue-200 text-black',
'Not Yet Applied': 'bg-[#e6e6e6] text-black',
};
88 changes: 44 additions & 44 deletions src/components/JobApplications/JobApplications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,73 +33,73 @@ const ApplicationsGrid: React.FC = () => {
}

return (
<div className="p-6">
{isLoading ? (
<div className="flex justify-center items-center h-64">
<ClipLoader
color={"#3498db"}
loading={isLoading}
size={60}
aria-label="Loading Applications"
/>
</div>
) : (
<>
<h1 className="text-3xl font-bold text-gray-800 mb-4">Applications</h1>

<div className="flex justify-between items-center mb-4">
<div className="flex items-center">
<main className="flex">
<div className="w-[76vw] pl-[6vw]">
{isLoading ? (
<div className="flex justify-center items-center h-64">
<ClipLoader
color={"#3498db"}
loading={isLoading}
size={60}
aria-label="Loading Applications"
/>
</div>
) : (
<>
<h1 className="text-[5.5vh] font-bold text-cyan-600 tracking-wide mb-[2vh] mt-[8vh]">
Applications
</h1>

<div className="flex justify-between items-center">
<input
type="search"
placeholder="Search Company"
className="border rounded px-4 py-2 w-64"
placeholder="πŸ” Search Applications"
className="py-2 px-4 rounded w-[22vw] min-w-min border-2 border-slate-800"
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
/>
/>
<Link to="/jobapplications/new">
<button className="bg-cyan-600 hover:bg-cyan-500 text-white tracking-wide py-2 px-4 rounded max-w-max">
Add New +
</button>
</Link>
</div>
<Link to="/jobapplications/new">
<button className="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">
Add New +
</button>
</Link>
</div>

<div className="border rounded-lg overflow-hidden">
<table className="min-w-full bg-white border-collapse">
<thead>
<tr className="text-left bg-gray-50 border-b">
<th className="p-4 font-semibold text-gray-600">Company</th>
<th className="p-4 font-semibold text-gray-600">Title</th>
<th className="p-4 font-semibold text-gray-600">Status</th>
<th className="p-4 font-semibold text-gray-600">Last Updated</th>
<table className="w-[70vw] mt-[1.5vh]">
<thead className="border-t">
<tr>
<th className="text-left p-4 border-b">Company</th>
<th className="text-left p-4 border-b">Title</th>
<th className="text-left p-4 border-b">Status</th>
<th className="text-left p-4 border-b">Last Updated</th>
</tr>
</thead>
<tbody>
{filteredApplications.map((app) => (
<tr
key={app.id}
className="hover:bg-gray-50 border-b transition-colors duration-200"
className="hover:bg-gray-100 cursor-pointer"
>
<td className="p-4 text-gray-700">
<td className="p-4 border-b">
<Link to={`/job_applications/${app.id}`}>
{app.company_name || app.company_id}
</Link>
</td>
<td className="p-4 text-gray-700">
<td className="p-4 border-b">
<Link to={`/job_applications/${app.id}`}>
{app.position_title}
</Link>
</td>
<td className="p-4">
<td className="p-4 border-b">
<Link to={`/job_applications/${app.id}`}>
<span
className={`py-1 px-2 rounded-md text-sm font-medium ${statusStyles[statusMap[app.status]]}`}
className={`py-2 px-6 text-sm inline-block text-center w-[10vw] min-w-[80px] max-w-[200px]
truncate overflow-hidden whitespace-nowrap ${statusStyles[statusMap[app.status]]}`}
>
{statusMap[app.status]}
</span>
</Link>
</td>
<td className="p-4 text-gray-700">
<td className="p-4 border-b">
<Link to={`/job_applications/${app.id}`}>
{app.updated_at}
</Link>
Expand All @@ -115,10 +115,10 @@ const ApplicationsGrid: React.FC = () => {
)}
</tbody>
</table>
</div>
</>
)}
</div>
</>
)}
</div>
</main>
);

};
Expand Down