Closed jthielman closed 4 years ago
Only pictures are reading from database, and styling looks whack. Create CRUD buttons, and make sure they only display when the user is logged in. Write some instructions at the top of the page, indicating that the user should click the picture of each weapon for more details.
User Story As a user, I should be able to view all the weapons.
AC
WHEN the user visits the Weapons page THEN I should be able to view all of the weapons AND there will be 3 in a row, and they will follow the mockups
Dev Notes
Create weaponsData.js in javascripts/helpers/data and create an axios call getWeapons promise to get the data imported and turn object of arrays to an array - see seed data ticket for example
Create weapons folder component within javascripts/components and include weapons.js and weapons.scss, be sure to link the js and scss
In weapons.js create a createWeaponCard function that calls the getWeapons and runs it through a forEach loop and create bootstrap cards; this will print out to the weapons div within the html - this will be printed to the DOM upon page load using printToDom
If the userobject is found with firebase.auth().currentUser, then add the edit and delete buttons to the domstring. use this snippet in createWeaponCard
const user = firebase.auth().currentUser; if (user != null) { // do stuff }