Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Pattyssilveira/carrousel component#33

Open
pattyssilveira wants to merge 3 commits intomasterfrom
pattyssilveira/carrousel-component
Open

Pattyssilveira/carrousel component#33
pattyssilveira wants to merge 3 commits intomasterfrom
pattyssilveira/carrousel-component

Conversation

@pattyssilveira
Copy link
Copy Markdown
Contributor

this PR:

  • Adds Carousel Component
  • Change CSS in node modules to be global

import { Carousel } from 'react-responsive-carousel'
import 'react-responsive-carousel/lib/styles/carousel.min.css'

class Carrousel extends PureComponent {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's not necessary to use PureComponent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PureComponent can improve our page performance, so we should use it when is possible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, I think this component should be stateless

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for sure @beatriz1304 !!!

@@ -0,0 +1,3 @@
:global {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You're not applying any style here, I think you should remove that

import { Carousel } from 'react-responsive-carousel'
import 'react-responsive-carousel/lib/styles/carousel.min.css'

class Carrousel extends PureComponent {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PureComponent can improve our page performance, so we should use it when is possible.

return (
<Carousel autoPlay width={size}>
{images.map(({ url, alt, legend }) => (
<div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you need a key here

{images.map(({ url, alt, legend }) => (
<div>
<img src={url} alt={alt} />
<p className="legend">{legend}</p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are you not using css modules here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants