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

frontend-IOA #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
127 changes: 127 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"bootstrap": "^5.3.3",
"dotenv": "^16.4.5",
"react": "^18.3.1",
"react-beautiful-dnd": "^13.1.1",
"react-bootstrap": "^2.10.2",
"react-bootstrap-icons": "^1.11.4",
"react-datepicker": "^6.9.0",
Expand Down Expand Up @@ -45,5 +46,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react-beautiful-dnd": "^13.1.8"
}
}
4 changes: 3 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { BrowserRouter, Routes, Route } from 'react-router-dom';
import RecruiterDashboard from './components/RecruiterDashboard';
import AddCandidate from './components/AddCandidateForm';
import Positions from './components/Positions';
import PositionKanban from './components/PositionKanban/PositionKanban'; // Asegúrate de importar el componente adecuado

const App = () => {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<RecruiterDashboard />} />
<Route path="/add-candidate" element={<AddCandidate />} /> {/* Agrega esta línea */}
<Route path="/add-candidate" element={<AddCandidate />} />
<Route path="/positions" element={<Positions />} />
<Route path="/positions/:id/kanban" element={<PositionKanban />} /> {/* Nueva ruta para el Kanban board */}
</Routes>
</BrowserRouter>
);
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/components/BackButton/BackButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
import { Button } from 'react-bootstrap'; // Importa Button de react-bootstrap

const BackButton: React.FC = () => {
const navigate = useNavigate();

const handleBack = () => {
navigate(-1); // Navega una página hacia atrás en el historial del navegador
};

return (
<Button onClick={handleBack} variant="secondary">
Volver
</Button>
);
};

export default BackButton;
37 changes: 37 additions & 0 deletions frontend/src/components/KanbanCard/KanbanCard.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.kanbanCard {
background-color: white;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 10px;
}

.kanbanCard .card-header {
background-color: #f8f9fa;
font-weight: bold;
text-align: center;
}

.kanbanCard .card-body {
padding: 15px;
}

.kanbanCard .card-body .card-text {
display: flex;
align-items: center;
justify-content: space-between;
}

.candidateName {
font-size: 16px;
}

.candidateScore {
display: flex;
align-items: center;
}

.candidateScore span {
margin-left: 5px;
color: green;
}

40 changes: 40 additions & 0 deletions frontend/src/components/KanbanCard/KanbanCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import { Draggable, DraggableProvided } from 'react-beautiful-dnd';
import { Card } from 'react-bootstrap';
import styles from './KanbanCard.module.css';
import { Candidate } from '../../types/candidate.type';

interface KanbanCardProps {
candidate: Candidate;
index: number;
}

const KanbanCard: React.FC<KanbanCardProps> = ({ candidate, index }) => {

return (
<Draggable draggableId={`candidate-${candidate.id}`} index={index}>
{(provided: DraggableProvided) => (
<div
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Card className={styles.kanbanCard}>
<Card.Body>
<Card.Text className={styles.candidateName}>
{candidate.name}
<div className={styles.candidateScore}>
<span>
{'🟢'.repeat(Math.floor(candidate.score / 20))}
</span>
</div>
</Card.Text>
</Card.Body>
</Card>
</div>
)}
</Draggable>
);
};

export default KanbanCard;
4 changes: 4 additions & 0 deletions frontend/src/components/KanbanColumn/KanbanColumn.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.kanbanColumn {
padding: 10px;
}

Loading