lillylabs / react-redux-gram

0 stars 1 forks source link

User should be able to select photo and see large version #7

Open raae opened 6 years ago

raae commented 6 years ago

Part of #1

raae commented 6 years ago

I do not like wesbos component name og single, should be photo.

olavea commented 6 years ago

From Wes Bos Video 13 I put this code up in github Client/Components/Single.js import React from 'react'; import Photo from './Photo'; // import Comments from './Comments';

const Single = React.createClass({ render() { const { postId } = this.props.params;

const i = this.props.posts.findIndex((post) => post.code === postId);
const post = this.props.posts[i];
console.log(i);

// const postComments = this.props.comments[postId] || [];

return (
  <div className="single-photo">
    <Photo i={i} post={post} {...this.props} />

  </div>
)

} });

export default Single;

olavea commented 6 years ago

Created posts.js in https://github.com/lillylabs/react-redux-gram/Client/data/

olavea commented 6 years ago

Created: App.js
Main.js Photo.js
PhotoGrid.js

From Wes Bos video Used wesbos component name of "Single", did not change to "photo"