dangelo-jan / mi-proyecto-v1 Goto Github PK
View Code? Open in Web Editor NEWProyecto de practica
License: MIT License
Proyecto de practica
License: MIT License
useSelector()
Redux Hook to select the state slices and render lists of dragons in corresponding routes. i.e.:// get rockets data from the store
const rockets = useSelector(state => state.rockets);
You can style the whole application "by hand" or you could use React Bootstrap, a UI library that could speed up the process. This is a popular library and working with its components would be good practice.
Render a list of dragons (as per design). For the image of a dragon use the first image in the array of flickr_images
.
Fetch data from the Dragons endpoint (https://api.spacexdata.com/v3/dragons) when a user navigates to the Dragons section.
Once the data are fetched, dispatch an action to store the selected data in Redux store:
NOTE: Make sure you only dispatch those actions once and do not add data to store on every re-render (i.e. when changing views / using navigation).
Render a list of all reserved dragons (use filter()
) on the "My profile" page.
Render a list of all reserved rockets (use filter()
) on the "My profile" page.
<NavLink />
for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).Fetch data from the Missions endpoint (https://api.spacexdata.com/v3/missions) when a user navigates to the Missions section.
Once the data are fetched, dispatch an action to store the selected data in Redux store:
NOTE: Make sure you only dispatch those actions once and do not add data to store on every re-render (i.e. when changing views / using navigation).
reserved
with its value set to true
. You could use a JS filter()
or map()
to set the value of the new state - i.e.:const newState = state.map(rocket => {
if(rocket.id !== id)
return rocket;
return { ...rocket, reserved: true };
});
reserved
key to false
.reserved
key to false
.<NavLink />
for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).<NavLink />
for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).Missions that the user has joined already should show a badge "Active Member" instead of the default "NOT A MEMBER" and a button "Leave Mission" instead of the "Join Mission" button (as per design).
Use the React conditional rendering syntax:
{rocket.reserved && (
// render Cancel Rocket button
)}
reserved
with its value set to true
. You could use a JS filter()
or map()
to set the value of the new state - i.e.:const newState = state.map(rocket => {
if(dragon.id !== id)
return dragon;
return { ...dragon, reserved: true };
});
Render a list of all joined missions (use filter()
) on the "My profile" page.
useSelector()
Redux Hook to select the state slices and render lists of rockets in corresponding routes. i.e.:// get rockets data from the store
const rockets = useSelector(state => state.rockets);
flickr_images
.Dragons that have already been reserved should show a "Reserved" badge and "Cancel reservation" button instead of the default "Reserve dragon" (as per design).
Use the React conditional rendering syntax:
{rocket.reserved && (
// render Cancel Rocket button
)}
reserved
key to false
.reserved
with its value set to true
. You could use a JS filter()
or map()
to set the value of the new state - i.e.:const newState = state.map(rocket => {
if(mission.id !== id)
return mission;
return { ...mission, reserved: true };
});
Fetch data from the Rockets endpoint (https://api.spacexdata.com/v3/rockets) when the application starts (as Rockets is the default view).
Once the data are fetched, dispatch an action to store the selected data in Redux store:
NOTE: Make sure you only dispatch those actions once and do not add data to store on every re-render (i.e. when changing views / using navigation).
<NavLink />
for the page navigation links and style active class to indicate which section/page the user is currently on (underline active navigation link).useSelector()
Redux Hook to select the state slices and render lists of missions in corresponding routes. i.e.:// get rockets data from the store
const rockets = useSelector(state => state.rockets);
Rockets that have already been reserved should show a "Reserved" badge and "Cancel reservation" button instead of the default "Reserve rocket" (as per design)
Use the React conditional rendering syntax:
{rocket.reserved && (
// render Cancel Rocket button
)}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.