As a user, I should be able to view all Planetary Systems.
AC
WHEN the user visits the Planetary System tab in the Navbar
THEN they should see a div that displays the planetSystem.json data (same as linked in firebase) for all Planetary Systems available
Dev Notes
create a planetSystem component where you will create planetSystem.js and planetSystem.scss files
create planetSystemData.js file under your Data Folder in helpers, where you will import axios along with your apiKeys to pull the planetary system data, in a function similar to the following:
import axios from 'axios';
import apiKeys from '../apiKeys.json';
const baseUrl = apiKeys.firebaseKeys.databaseURL;
const getSystems = () => new Promise((resolve, reject) => {
axios.get(`${baseUrl}/planetSystem.json`)
.then((response) => {
const demSystems = response.data;
const systems = [];
Object.keys(demSystems).forEach((psId) => {
demSystems[psId].id = psId;
systems.push(demSystems[psId]);
});
resolve(systems);// Hard code to return systems
})
.catch((error) => reject(error));
});
export default { getSystems };
• in planetSystem.js create a planetary system card inside a <div id="planetarySystemModule></div" using object literals from your seed data, to be used in your index.html and styled in planetSystem.scss. The function should look like something along the lines of:
Then create another that will use the getSystems function imported from planetSystemData.js, as well as the singleSystemCard function above to create cards for each Planetary System. It should look similar to:
then import and call the createFoodCards function inside your authentication function in navbars.js, so that the cards will print (with or without the conditional CRUD elements) both after logging in and logging out
User Story
As a user, I should be able to view all Planetary Systems.
AC
WHEN the user visits the Planetary System tab in the Navbar THEN they should see a div that displays the planetSystem.json data (same as linked in firebase) for all Planetary Systems available
Dev Notes
getSystems
function imported from planetSystemData.js, as well as thesingleSystemCard
function above to create cards for each Planetary System. It should look similar to: