ReadyPlayer2 / nasa-playgrounds

React application to call the NASA APOD API and display returned images and videos
MIT License
2 stars 0 forks source link

Create and store an object for the details returned from apod API #8

Closed ReadyPlayer2 closed 5 years ago

ReadyPlayer2 commented 5 years ago

We get back a lot of data in the JSON, we should store it all and make it available via UI. e.g.

{"copyright":"Juan Carlos Casado","date":"2019-03-21","explanation":"Stars trail and the Sun rises in this night and day composite panorama made on March 19. The view looks toward the eastern horizon from La Nava de Santiago, Spain. To create it, a continuous series of digital frames was recorded for about two hours and combined to trace the concentric motion of the stars through the night sky. A reflection of the Earth's rotation, star trails curve around the north celestial pole toward upper left and the south celestial pole toward the lower right. Of course on that day the Sun was near the celestial equator, a diagonal straight line in the wide-angle projection. A dense dimming filter was used to capture the Sun's image every two minutes. Superimposed on the star trails it rose due east in the morning sky. In the scene, foreground landscape and a local prehistoric monument were illuminated by full moonlight, though. The monument's corridor faces nearly to the east and the equinox sunrise.","hdurl":"https://apod.nasa.gov/apod/image/1903/lacara_equinocc19_jcc.jpg","media_type":"image","service_version":"v1","title":"Star Trails and the Equinox Sunrise","url":"https://apod.nasa.gov/apod/image/1903/lacara_equinocc19_jcc1024.jpg"}
ReadyPlayer2 commented 5 years ago

Rather than storing an object, it would be better to just initialise a new React component e.g. Tile.js and pass it all the details. Then we can render using something like <Tile data={this.state} />

ReadyPlayer2 commented 5 years ago

Closing as image details are already being stored since making this issue.