diff --git a/client/src/app.js b/client/src/app.js index 9b6da66..425f571 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -3,6 +3,7 @@ import axios from 'axios'; import Box from './box'; import api from './api'; import Modal from './modal'; +import Color from './color'; import './styles/app.css'; function App() { @@ -12,7 +13,7 @@ function App() { const [boxID, setBoxID] = useState(undefined); const [boxName, setBoxName] = useState(''); const [boxDescription, setBoxDescription] = useState(''); - const [boxColor, setBoxColor] = useState(0); + const [boxColor, setBoxColor] = useState('WHITE'); const [showModalBox, setShowModalBox] = useState(false); const [showModalItem, setShowModalItem] = useState(false); @@ -25,7 +26,7 @@ function App() { const [itemName, setItemName] = useState(''); const [itemDescription, setItemDescription] = useState(''); const [itemQuantity, setItemQuantity] = useState(1); - + const [filter, setFilter] = useState(''); const [filteredData, setFilteredData] = useState([]); @@ -118,7 +119,7 @@ function App() { } const handleColorBox = (event) => { - setBoxColor(parseInt(event.target.value)); + setBoxColor(event.target.value); } const handleSubmitBox = (event) => { @@ -193,7 +194,7 @@ function App() { setMoveItemBoxID(null); setMoveItemID(null); setIsMoving(false); - await moveItem(moveItemID,boxData._id); + await moveItem(moveItemID, boxData._id); } const boxHandler = { @@ -219,7 +220,7 @@ function App() { const response = await axios.post(`${api.baseApiUrl}/item/${itemID}/${boxIDTarget}`); setData(response.data); } - catch(error) { + catch (error) { console.log(error); } } @@ -353,19 +354,25 @@ function App() { setFilter(''); } - const colors = { - default: 0, - red: 1, - green: 2, - }; + //these colors are all wrong + const colors = [ + { + title: 'WHITE', + defaultStyle: { backgroundColor: 'white' }, + hoverStyle: { backgroundColor: '#EBEBEB' } + }, + { + title: 'BLUE', + defaultStyle: { backgroundColor: '#084B83' }, + hoverStyle: { backgroundColor: '#0B64AD' } + } + ]; + const colorSelector =