Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed Component Props Mini Project #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cmhorsey
Copy link

Built a static blog site in React using components, JSX, and passed down data as props.

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Just make sure you take a minute once you're done coding to go back and clean up.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eeek yes for sure.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Comment on lines 1 to 18
import React from "react"
// import blogData from "../data/blog"


function About({image='https://via.placeholder.com/215', about
}) {

return (
<>
<aside>
<img src={image} alt='blog logo'></img>
<p>{about}</p>
</aside>
</>
)
}

export default About

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import React from "react"
// import blogData from "../data/blog"
function About({image='https://via.placeholder.com/215', about
}) {
return (
<>
<aside>
<img src={image} alt='blog logo'></img>
<p>{about}</p>
</aside>
</>
)
}
export default About
import React from "react"
function About({ image='https://via.placeholder.com/215', about }) {
return (
<aside>
<img src={image} alt='blog logo'></img>
<p>{about}</p>
</aside>
)
}
export default About

Comment on lines 1 to 19
import React from "react"



function Article({title, date ='January 1, 1970', preview}) {
return (
<>
<article>
<h3>{title}</h3>
<small>{date}</small>
<p>{preview}</p>
</article>
</>
)
}



export default Article

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When are fragments needed? Do you need one here?

Suggested change
import React from "react"
function Article({title, date ='January 1, 1970', preview}) {
return (
<>
<article>
<h3>{title}</h3>
<small>{date}</small>
<p>{preview}</p>
</article>
</>
)
}
export default Article
import React from "react"
function Article({ title, date ='January 1, 1970', preview }) {
return (
<article>
<h3>{title}</h3>
<small>{date}</small>
<p>{preview}</p>
</article>
)
}
export default Article

Comment on lines 1 to 24
import React from "react"
import Article from "./Article";

function ArticleList({posts}) {

return (
<>
<main>
{posts.map((post) => {
return (
<Article
key={post.id}
title={post.title}
date={post.date}
preview={post.preview}
/>
)
})}
</main>
</>
)
}

export default ArticleList

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import React from "react"
import Article from "./Article";
function ArticleList({posts}) {
return (
<>
<main>
{posts.map((post) => {
return (
<Article
key={post.id}
title={post.title}
date={post.date}
preview={post.preview}
/>
)
})}
</main>
</>
)
}
export default ArticleList
import React from "react"
import Article from "./Article";
function ArticleList({ posts }) {
return (
<main>
{posts.map((post) => {
return (
<Article
key={post.id}
title={post.title}
date={post.date}
preview={post.preview}
/>
)
})}
</main>
)
}
export default ArticleList

Comment on lines 1 to 15
import React from "react"
// import blogData from "../data/blog"


function Header({name}) {
return (
<header>
<h1>{name}</h1>
</header>
)
}



export default Header

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import React from "react"
// import blogData from "../data/blog"
function Header({name}) {
return (
<header>
<h1>{name}</h1>
</header>
)
}
export default Header
import React from "react"
function Header({name}) {
return (
<header>
<h1>{name}</h1>
</header>
)
}
export default Header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants