For this assignment, build and image gallery view that has:
- Three different possible components views for a list of images
- A wrapper component that switches between the views
- Add and remove functionality for the list of images:
- Actions
- Add a new image
- Remove an existing image
- Use immutability
- Use action functions to modify state
- Actions
The image data looks like:
{
title: 'Cute Bunny',
description: 'Isn\'t it fuzzy-wuzzy cutest thing you\'ve ever seen?',
url: 'http://f.cl.ly/items/3g3J1G0w122M360w380O/3726490195_f7cc75d377_o.jpg'
}
You can use your own URL, or work with these cute bunnies:
- http://f.cl.ly/items/3g3J1G0w122M360w380O/3726490195_f7cc75d377_o.jpg
- http://static.boredpanda.com/blog/wp-content/uploads/2015/09/cute-bunnies-25__605.jpg
- http://static.boredpanda.com/blog/wp-content/uploads/2015/09/cute-bunnies-110__605.jpg
For now, hard code an initial list of images and store as component state.
The three image viewer component(s) you should build are:
- "list"
- tabular list - show the list like a table
- list item - display the title of the image, the link (not the actual image), and description.
- "thumbnail" -
- float or inline-block list - show "cards" for each image
- each image card shows a "thumbnail" (~ 100x100 pixel scale) and the title (above or below).
- "gallery" -
- display one image at a time, have left and right arrows to advance/go back
- Display the title, description and the full-size image.
- (Note: Gallery has own state for which image index it is on)
Then you need a view selector wrapper component that has state and has buttons or some selection mechanism for which view to show.
The image "state" can live in top level App component.
Include PropTypes for all components (that take props)
You also need to snapshot test:
- your imaging viewing components
- the wrapper component (in each view state) Unit test:
- Data edit actions
- "list" component 2pt
- "thumbnail" component 2pt
- "gallery" component 2pt
- view selector component 1pts
- Tests 2pts
- Code quality 1pt