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

add create offer road #43

Merged
merged 2 commits into from
Dec 19, 2023
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
8 changes: 6 additions & 2 deletions frontend/src/components/Boutons/ButtonMini.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import PropTypes from "prop-types";
import "./button-mini.css";

function ButtonMini({ textBtn }) {
function ButtonMini({ textBtn, onClick }) {
return (
<div>
<button className="submit-btn-mini" type="submit">
<button className="submit-btn-mini" type="submit" onClick={onClick}>
{textBtn}
</button>
</div>
);
}
ButtonMini.propTypes = {
textBtn: PropTypes.string.isRequired,
onClick: PropTypes.func,
};
ButtonMini.defaultProps = {
onClick: () => {},
};
export default ButtonMini;
59 changes: 59 additions & 0 deletions frontend/src/components/Dashboards/RowDash2.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import ButtonMini from "../Boutons/ButtonMini";
import "./RowDash.css";

const UserDash = [
{
id: 1,
lastname: "Gondry",
firstname: "Henri",
tel: "0611589643",
email: "[email protected]",
},
{
id: 2,
lastname: "Gondry",
firstname: "Henri",
tel: "0611589643",
email: "[email protected]",
},
{
id: 3,
lastname: "Gondry",
firstname: "Henri",
tel: "0611589643",
email: "[email protected]",
},
{
id: 4,
lastname: "Gondry",
firstname: "Henri",
tel: "0611589643",
email: "[email protected]",
},
{
id: 5,
lastname: "Gondry",
firstname: "Henri",
tel: "0611589643",
email: "[email protected]",
},
];

function RowDash2() {
return (
<div className="rowDash-container">
{UserDash.map((user) => (
<div key={user.tel} className="offerDash-item">
<p className="array-box">{user.id}</p>
<p className="array-box">{user.lastname}</p>
<p className="array-box">{user.firstname}</p>
<p className="array-box">{user.tel}</p>
<p className="bigArray-box">{user.email}</p>
<ButtonMini textBtn="Envoyer" />
</div>
))}
</div>
);
}

export default RowDash2;
10 changes: 7 additions & 3 deletions frontend/src/pages/Dashboard/Dashboard1.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { Outlet } from "react-router-dom";
import { Outlet, useNavigate } from "react-router-dom";
import RowDash from "../../components/Dashboards/RowDash";
import TitleDashboard from "../../components/Dashboards/TitleDashboard";
import ButtonMini from "../../components/Boutons/ButtonMini";

function Dashboard1() {
const navigate = useNavigate();
const handleAddOffer = () => {
navigate("/offer");
};
return window.location.pathname === "/dashboard" ||
window.location.pathname === "/dashboard/" ? (
<div>
<div className="title-btn">
<h3 className="tab">Tableau de bord</h3>
<ButtonMini textBtn="Ajouter une offre" />
<h4 className="tab">Tableau de bord</h4>
<ButtonMini textBtn="Ajouter une offre" onClick={handleAddOffer} />
</div>
<TitleDashboard
labelDash="ID Offres"
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/pages/Dashboard/Dashboard2.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import PropTypes from "prop-types";
import RowDash from "../../components/Dashboards/RowDash";
import TitleDashboard from "../../components/Dashboards/TitleDashboard";
import ButtonMini from "../../components/Boutons/ButtonMini";
import RowDash2 from "../../components/Dashboards/RowDash2";

function Dashboard2({ refAnnonce }) {
return (
<div>
<div className="title-btn">
<h3 className="tab">Tableau de bord</h3>
<h2 className="tab">Tableau de bord</h2>
</div>
<h3 className="ref"> REF OFFRE : {refAnnonce} </h3>
<h3>CANDIDATS</h3>
<h4>CANDIDATS</h4>
<div>
<ButtonMini textBtn="Envoyer" />
<TitleDashboard
labelDash="ID"
labelDash2="Noms"
Expand All @@ -22,7 +20,7 @@ function Dashboard2({ refAnnonce }) {
labelDash6="CV"
/>
</div>
<RowDash />
<RowDash2 />
</div>
);
}
Expand Down