Skip to content

Conversation

@github-classroom
Copy link

@github-classroom github-classroom bot commented Mar 22, 2021

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.

In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.

Click the Files changed or Commits tab to see all of the changes pushed to main since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to main since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to main. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.

For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @Abby-Lyttle @emlindly

github-classroom bot and others added 30 commits March 22, 2021 21:46
changed file paths to be in folders and added two functioning buttons…
changed source of homepage photos.
added icon, about functioning in Navbar and bootstrap layout for abou…
…s and properly linked, placeholder photos on all blog pages.
added about author image circles
aesthetics updated and added contact form.
added overlay text popouts to images. Added about author files.
Abby-Lyttle and others added 29 commits March 30, 2021 15:58
set up props to reveal three blogs each
fixed right nav bar and failed comment sectin attempt lol.
Copy link
Contributor

@lindlym lindlym left a comment

Choose a reason for hiding this comment

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

Provisional Grade: 70%

Keep in mind, 20% of your final grade is acquired from your partner survey and review results. The remaining 10% missing from your grade is due to lack of DRY in certain areas, and the big chunk is the missing singular blog component. Mostly just best practices and understanding of how React can work with singular components. Let me know if you have any questions!

Comment on lines +37 to +45
<Route path="/homebreak/blogs" render={(props) => (
<HomeBreakBlogs BlogPageInfo={BlogPageInfo} {...props} />
)} />
<Route path="/playbreak/blogs" render={(props) => (
<PlayBreakBlogs BlogPageInfo={BlogPageInfo} {...props} />
)} />
<Route path="/workbreak/blogs" render={(props) => (
<WorkBreakBlogs BlogPageInfo={BlogPageInfo} {...props} />
)} />
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be made more clean. If you include the path you're aiming for inside of your BlogPageInfo, then you can loop through and create these with a loop. It'd look something like...

BlogPageInfo.map((obj, index) => {
          <Route path={obj.routePath} render={(props) => (
            <HomeBreakBlogs BlogPageInfo={obj} {...props} />
          )} />
})

Of course, you'd have to update references and what not.

<WorkBreakBlogs BlogPageInfo={BlogPageInfo} {...props} />
)} />
<Route path="/about" render={(props) => (
<AboutPage AuthorInfo={AuthorInfo} {...props} />
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, you should always pass properties in camelCase format. This means AuthorInfo here becomes authorInfo if written correctly. You have to update the reference in the file as well (so in this instance, the AboutPage component file will need to change from props.AuthorInfo to props.authorInfo.

Comment on lines +52 to +53
<i class="fab fa-facebook"></i>
<Footer />
Copy link
Contributor

Choose a reason for hiding this comment

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

I saw this during the presentation, you had a random thing of links at the bottom, and a random social media icon. Just remove these and keep the FooterNavbar, and throw the links into the FooterNavbar component.

Comment on lines +2 to +5
import Carousel from "react-bootstrap/Carousel";
import PhotoOne from "../images/carousel/Pink.jpeg";
import PhotoTwo from "../images/carousel/Blue.jpeg";
import PhotoThree from "../images/carousel/Orange.jpeg";
Copy link
Contributor

Choose a reason for hiding this comment

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

As a general rule, import components in PascalCase, and properties and other references in camelCase. So you'd keep Carousel as it is, but change the others to photoOne, photoTwo, etc.

Comment on lines +13 to +21
<Carousel.Item>
<img className="d-block w-100" src={PhotoOne} alt="First slide" />
</Carousel.Item>
<Carousel.Item>
<img className="d-block w-100" src={PhotoTwo} alt="Second slide" />
</Carousel.Item>
<Carousel.Item>
<img className="d-block w-100" src={PhotoThree} alt="Third slide" />
</Carousel.Item>
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't super DRY, try something like this:

[photoOne, photoTwo, photoThree].map((photoSrc, index) => {
    <Carousel.Item>
        <img className="d-block w-100" src={photoSrc} alt="Slide image..." />
    </Carousel.Item>
})

This way we clean up a good amount of that code. You may have to fiddle with that code a bit to get it to work!

Comment on lines +6 to +35
function ContactModal() {
const [show, setShow] = useState();

const handleClose = () => setShow(false);
const handleShow = () => setShow(true);

return (
<>
<Button variant="outline-secondary" onClick={() => handleShow()}>
Send
</Button>

<Modal show={show} onHide={() => handleClose()}>
<Modal.Header closeButton>
<Modal.Title>
<Mailbox /> <Heart />
</Modal.Title>
</Modal.Header>
<Modal.Body>
Signed, sealed, delivered. We will be in touch soon!
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={handleClose}>
<HandThumbsUp />
</Button>
</Modal.Footer>
</Modal>
</>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Modal is not erasing information after being submitted. It should wipe all fields after hitting the submit button.

Comment on lines +36 to +44
<Col>
<Image className="author" id="fadein" src={props.AuthorInfo[0].photo} roundedCircle onClick={() => setAuthorClicked(0)} />
</Col>
<Col >
<Image className="author" id="fadein" src={props.AuthorInfo[1].photo} roundedCircle onClick={() => setAuthorClicked(1)} />
</Col>
<Col >
<Image className="author" id="fadein" src={props.AuthorInfo[2].photo} roundedCircle onClick={() => setAuthorClicked(2)} />
</Col>
Copy link
Contributor

Choose a reason for hiding this comment

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

Not DRY. Use a map over the props.AuthorInfo array here in order to fix this.

Comment on lines +31 to +53
<Container className="blog-content">
<h1 className="blog-title">{props.BlogPageInfo[blogClicked].title}</h1>
<Container className="subtitle-container">
<h3 className="blog-subtitle">{props.BlogPageInfo[blogClicked].subtitle}</h3>
</Container>
<br />
<Image className="homebreak-author-avatar" src={props.BlogPageInfo[blogClicked].authoravatar} alt="" />
<h6 className="blog-author">Authored By {props.BlogPageInfo[blogClicked].author} &nbsp;<Badge pill variant="dark">Follow</Badge></h6>
<br /><h6 className="blog-date-time"><Calendar /> {props.BlogPageInfo[blogClicked].date}</h6>
<p className="socials"> <Facebook /> <Twitter /> <Instagram /> <Bookmark /> <ThreeDotsVertical /></p>
<img className="blog-image" src={props.BlogPageInfo[blogClicked].image} alt="" />
<p className="photo-credit">{props.BlogPageInfo[blogClicked].photocredit}</p>
<p className="blog-quote">{props.BlogPageInfo[blogClicked].quote}</p>
<hr className="line-break" />
<p className="blog-intro-text">{props.BlogPageInfo[blogClicked].introtext}</p>
<hr className="line-break" />
<p className="blog-text">{props.BlogPageInfo[blogClicked].contentblockone}</p>
<p className="blog-header">{props.BlogPageInfo[blogClicked].headerblocktwo}</p>
<p className="blog-text">{props.BlogPageInfo[blogClicked].contentblocktwo}</p>
<p className="blog-header">{props.BlogPageInfo[blogClicked].headerblockthree}</p>
<p className="blog-text">{props.BlogPageInfo[blogClicked].contentblockthree}</p>
<hr className="line-break" />
</Container>
Copy link
Contributor

Choose a reason for hiding this comment

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

It's tough to not make this messy, but you probably should have looked into some libraries that allow you to save HTML elements inside of a string and compile it using React. This would have been much better with your blog format... here's a library I'd think of Interweave...

@@ -0,0 +1,57 @@
/* Imported React and Hook */
Copy link
Contributor

Choose a reason for hiding this comment

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

It's hard to describe, but your blog pages in general are not DRY. You should have one single blog component that can handle all of the various information you're using from your Array of blogs. Right now, you have three separate blog components which are being utilized. Cleaning it up with Interweave, and figuring out how to properly use state (since the component is re-rendering, using state here would be simple), you can figure out how to use one blog page.

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.

4 participants