Skip to content

Commit 85e20d4

Browse files
Merge pull request #124 from JumboCode/holden
arrrrrrrrrrrrrgh
2 parents 64867f6 + a85ddfe commit 85e20d4

File tree

7 files changed

+79
-27
lines changed

7 files changed

+79
-27
lines changed

frontend/src/app/components/BorrowPopup.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,14 @@
126126

127127
.borrowed-item-box {
128128
background-color: #E3CECE;
129-
padding: 0.75rem 1rem;
129+
/* padding: 0.75rem 1rem; */
130+
border-radius: 4px;
131+
padding: 0.5rem .5rem;
130132
display: flex;
131133
align-items: center;
132134
justify-content: space-between;
133135
width: 100%;
134-
height: 12vh;
136+
height: 13vh;
135137
box-sizing: border-box;
136138
margin-bottom: 0.80rem;
137139
position: relative;
@@ -141,7 +143,8 @@
141143
.borrow-image {
142144
border: 2.5px solid #9b525f;
143145
position: relative;
144-
width: 20%;
146+
width: 15%;
147+
aspect-ratio: 1 / 1;
145148
}
146149

147150
.borrow-image::after {
@@ -191,7 +194,15 @@
191194
-webkit-appearance: none;
192195
-moz-appearance: none;
193196
appearance: none;
197+
transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
194198
}
199+
200+
.delete-button:hover {
201+
background-color: #E3CECE;
202+
color: #FFF;
203+
transform: scale(1.1);
204+
cursor: pointer;
205+
}
195206

196207
.form-row {
197208
display: flex;

frontend/src/app/components/BorrowPopup.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const BorrowPopup = ({ selectedItems = [], onClose, onSuccess }) => {
4949
return `${month}/${day}/${year}`;
5050
}
5151

52+
useEffect(() => {
53+
setIsFiltersHidden(false);
54+
}, [setIsFiltersHidden]);
55+
5256
useEffect(() => {
5357
if (user) {
5458
const name =

frontend/src/app/components/Filter/Filter.jsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import Calendar from '../../assets/Calendar.jsx';
55
import Reset from '../../assets/Reset.jsx';
66
import Dropdown from '../../assets/Dropdown.jsx';
77
import CalendarPicker from '../Calendar/CalendarPicker.jsx';
8+
import { useGlobalContext } from '../contexts/ToggleContext';
89

910
const FilterComponent = ({ isVisible, onClose, className }) => {
1011
const { selectedFilters, setSelectedFilters } = useFilterContext();
12+
1113
const fields = {
1214
Condition: {
1315
options: ["Good", "Great", "Needs washing", "Needs repair", "Needs dry cleaning", "Not usable"]
@@ -57,6 +59,7 @@ const FilterComponent = ({ isVisible, onClose, className }) => {
5759
const checkboxRefs = useRef({});
5860
const calendarRef = useRef(null);
5961
const calendarPickerContainerRef = useRef(null);
62+
const isFilterHidden = useGlobalContext();
6063

6164
// Keep selectedOptions in sync with selectedFilters
6265
useEffect(() => {
@@ -181,7 +184,20 @@ const FilterComponent = ({ isVisible, onClose, className }) => {
181184
});
182185
};
183186

184-
// Format date range display text
187+
// Ensure the filter popup is closed if not visible on the sidebar
188+
// const onCloseRef = useRef(onClose);
189+
// useEffect(() => {
190+
// onCloseRef.current = onClose;
191+
// }, [onClose]);
192+
193+
// const prevIsFilterHidden = useRef(isFilterHidden);
194+
// useEffect(() => {
195+
// if (!prevIsFilterHidden.current && isFilterHidden) {
196+
// onCloseRef.current && onCloseRef.current();
197+
// }
198+
// prevIsFilterHidden.current = isFilterHidden;
199+
// }, [isFilterHidden]);
200+
185201
const getDateRangeText = () => {
186202
if (dateRange.start && dateRange.end) {
187203
return `${dateRange.start} - ${dateRange.end}`;

frontend/src/app/components/ReturnButton.css

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
margin: 1vh 1vw;
4141
flex-direction: column;
4242
background-color: #E3CECE;
43-
border: 1px solid #9B525F;
43+
border: 1.5px solid #9B525F;
4444
padding: 1vh 1vw;
4545
width: 26vw;
4646
height: 50vh;
@@ -56,33 +56,40 @@
5656
.itemID {
5757
display: flex;
5858
flex-direction: row;
59-
justify-content: space-between;
6059
align-items: center;
60+
width: 100%;
6161
}
6262

6363
/* container for item name and id number -- middle element in .itemID */
6464
.itemInfo {
6565
display: flex;
6666
flex-direction: column;
67-
align-items: center;
67+
align-items: left;
68+
width: 40%;
69+
margin-left: 1vw;
6870
}
6971

7072
/* note: will need separate css class for handling exit button */
7173
.exitBtn {
74+
align-self: flex-start;
75+
text-align: right;
7276
padding: 0;
73-
background: none;
77+
background: none;
7478
border: none;
7579
color: #000000;
7680
box-shadow: none;
77-
padding-right: 1px;
81+
margin-right: 1px;
82+
width: 20%;
83+
}
84+
85+
.exitBtn {
86+
transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
7887
}
7988

8089
.exitBtn:hover {
81-
padding: 0;
82-
background: none;
83-
border: none;
84-
color: #000000;
85-
box-shadow: none;
90+
background-color: #E3CECE;
91+
color: #FFF;
92+
transform: scale(1.1);
8693
cursor: pointer;
8794
}
8895
/* note: image will need white border styling and sizing */
@@ -91,13 +98,20 @@
9198
height: 15vh;
9299
}
93100

94-
/* textbox for "notes" about return item */
95101
.notesTextbox {
96-
width: 100%;
97-
height: 11vh;
98-
flex: 0;
102+
border-radius: .2rem;
99103
border: 1px solid #9B525F;
100-
background-color: #F8F5F5;
104+
background: #FFF;
105+
box-shadow: 0px .1rem .2rem 0px rgba(0, 0, 0, 0.25);
106+
height: 11vh;
107+
width: stretch;
108+
resize: none;
109+
overflow: hidden;
110+
font-size: 1rem;
111+
padding: .35rem;
112+
outline: none;
113+
line-height: 3.5vh;
114+
text-wrap: wrap;
101115
}
102116

103117
.dropdown-component {
@@ -295,9 +309,10 @@
295309

296310
.return-image {
297311
border-radius: 4px;
298-
border: 1px solid #9b525f;
312+
border: 5px solid var(--white);
299313
position: relative;
300-
width: 6vw;
314+
/* width: 6vw; */
315+
width: 40%;
301316
}
302317

303318
.return-image::after {

frontend/src/app/components/ReturnItemBoxes.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export default function ItemBoxes({ unit, onNotesChange, itemId, onClose }) {
6060
)}
6161
</div>
6262
<div className="itemInfo">
63-
<p>{unit.name}</p>
64-
<p>ID #{unit.id}</p>
63+
<h2>{unit.name}</h2>
64+
<h2>ID #{unit.id}</h2>
6565
</div>
6666
<button className="exitBtn"
6767
onClick={onClose}>
@@ -71,10 +71,10 @@ export default function ItemBoxes({ unit, onNotesChange, itemId, onClose }) {
7171
</button>
7272
</div>
7373
<div className="notesWrapper">
74-
<p>Notes</p>
74+
<h3>Notes</h3>
7575
<form>
76-
<input type="text" className="notesTextbox" name="notes"
77-
value = {notes} onChange = {handleNotesChange}></input>
76+
<textarea className="notesTextbox" name="notes"
77+
value = {notes} onChange = {handleNotesChange}></textarea>
7878
</form>
7979
</div>
8080

frontend/src/app/components/ReturnPopup.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "./ReturnButton.css";
33
import { useState, useEffect } from "react";
44
import StylishButton from "./StylishButton.jsx";
55
import ItemBoxes from "./ReturnItemBoxes.jsx";
6+
import { useGlobalContext } from './contexts/ToggleContext';
67

78
const ReturnPopup = ({ units = [], onSuccess, onClose }) => {
89
const [currentPage, setCurrentPage] = useState(1);
@@ -12,6 +13,11 @@ const ReturnPopup = ({ units = [], onSuccess, onClose }) => {
1213
const [activeUnits, setActiveUnits] = useState(units || []);
1314
const totalPages = activeUnits && activeUnits.length ? Math.ceil(activeUnits.length / 3) : 1;
1415
const buttons = Array.from({ length: totalPages }, (_, index) => index + 1);
16+
const {setIsFiltersHidden} = useGlobalContext();
17+
18+
useEffect(() => {
19+
setIsFiltersHidden(false);
20+
}, [setIsFiltersHidden]);
1521

1622
useEffect(() => {
1723
// Update selectedUnits when activeUnits or currentPage changes

frontend/src/app/inventory/15Tablecomp/Popup.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export default function Popup( { onClose, onOptionSelect, unitList, unitIndex }
319319
src={`https://upload-r2-assets.somerville-museum1.workers.dev/${image_keys[selectedImage]}`}
320320
fill
321321
alt="No image found"
322-
style={{ objectFit: "cover" }} // Ensures the image covers the container
322+
style={{ objectFit: "contain" }} // Ensures the image fits the container
323323
/>
324324
</div>
325325
)}

0 commit comments

Comments
 (0)