Skip to content

Commit 7d754e4

Browse files
committed
fixbug
1 parent 961e7ce commit 7d754e4

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

src/components/LogoutButton.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ function LogoutButton() {
2626
}
2727
// Supprimer le token du local storage
2828
localStorage.removeItem('token');
29+
localStorage.setItem('activeItem', 'inventaire');
2930
sessionStorage.removeItem('user_id');
31+
3032
setUserId(-1);
3133
setIsAuthenticated(false);
3234
// window.location.href = '/login';

src/components/Matos.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {MenuItem, Menu, MenuMenu} from "semantic-ui-react";
77
import {useEffect, useState, useContext} from "react";
88
import HistoryTable from "./History";
99
import {AuthContext} from "../context/AuthContext";
10+
import item4 from "../ressources/item4.png";
11+
1012

1113

1214

@@ -28,10 +30,17 @@ function Matos(){
2830
setActiveItem(name);
2931
};
3032

33+
function handleClickMain(){
34+
window.location.href = '/';
35+
}
3136

3237
return(<>
3338
<div className={"header-inventory"}>
34-
<h1>Gestion du matériel</h1>
39+
<div className="top-left-wrapper">
40+
<img className={"image-flyht"} src={item4} onClick={handleClickMain} />
41+
<h1>Gestion du matériel</h1>
42+
</div>
43+
3544
{/* menu*/}
3645
<Menu secondary>
3746

src/components/TableData.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ const handleDeselectButton = () => {
635635
<TableCell>{item.brand}</TableCell>
636636
<TableCell>{options.find(option => option.value === item.type).text}</TableCell>
637637
<TableCell>{options2.find(option => option.value === item.state).text}</TableCell></>}
638-
<TableCell>{item.description}</TableCell>
638+
{isLargeScreen? <TableCell>{item.description}</TableCell> :null}
639639
<TableCell>{item.power}</TableCell>
640640
<TableCell>{item.price}</TableCell>
641641
<TableCell>{item.quantity}</TableCell>
@@ -650,7 +650,7 @@ const handleDeselectButton = () => {
650650
<TableCell>{convertDateFormat(item.modification_date)}</TableCell>
651651
</> : null
652652
}
653-
{!showDeleted && userId !==2 && isAuthenticated ?
653+
{!showDeleted && (userId !== 2) && isAuthenticated ?
654654
<>
655655
<TableCell>
656656
<ModalEdit submission={handleSubmissionEdit} item_id={item.id} reason={item.modification_reason} state={item.state} power={item.power} name={item.name} brand={item.brand} type={item.type} description={item.description} price={item.price} quantity={item.quantity} date={item.creation} />

src/pages/Inventory.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Matos from "../components/Matos";
33

44
function Inventory(){
55
return(<>
6+
67
<body id={"body-inv"}>
78
<div className={"matos-content"}>
89
<Matos/>

src/style/Matos.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
color: black;
44
}
55

6+
7+
68
p{
79
color: black;
810
}
@@ -115,6 +117,20 @@ p{
115117
padding: 2%;
116118
}
117119

120+
.image-flyht{
121+
width: 30%;
122+
height: auto;
123+
margin-right: 2%;
124+
cursor: pointer;
125+
}
126+
.top-left-wrapper{
127+
margin-left: -2%;
128+
height: auto;
129+
width: 40%;
130+
display: flex;
131+
flex-wrap: wrap;
132+
justify-content: flex-start;
133+
}
118134

119135

120136
@media only screen and (min-device-width : 0px) and (max-device-width : 1024px) {

0 commit comments

Comments
 (0)