-
Show reasonably sized photos, currently the photos are too large
-
Use Grid CSS
-
Tile the shown photos
-
Make images a bit more cohesive, the photos shouldn't have weird spacing but should be more closely fitted
-
Use
grid-row-end:rule but first need to specify thegrid-row-endvalue depending on height of each individual photo -
Create new React Component for rendering one photo at a time
-
Which will figure out the size of the image and adjust the
grid-row-end -
Create ref inside PhotoCard Component
-
Reach into DOM and figure out the height of individual photo
-
Calculate how many
grid-row-endunits, set it on the State, feed it into the style ofimgtag
-
SearchBar: Event Handlers
- With an event handler, take an input/form tag
- Pass a callback() to a specifically named props(<form onSubmit={this.onFormSubmit}, etc)
- When that tag/element emits event, that callback() will be called
- Rule to keep in mind: anytime there is a cb(), be safe to use ES6 =>() syntax, which will bind the function and have the appropriate value of
this - With Props system, only communicate from Parent down to Child(later an issue)
- To communicate from Child to Parent, pass a cb() from Parent to Child, then Child will call the cb()
-
PhotoList: Render photos, a list of photos
- Map function, whenever rendering a list, probably will reach for Map function
- Any time a list is made, define a
keyon the root element of that list that is consistent and unchanging
-
PhotoCard: React Ref system
- Intro to Ref system
- Ref used to reach into DOM and interact with some element
- Create Ref inside constructor and wire it up to an element by passing it as a ref property
- Later on access that ref and get a handle on the DOM node
-
Grid CSS System
- Grid CSS is not completely required
- Extremely new and still undergoing changes
- Good excuse on how to figure out how to use Ref system