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

changes for updating functional components #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vikaschd04
Copy link

@Vikaschd04 Vikaschd04 commented May 16, 2023

  • Please check if the PR fulfills these requirements
  • I have performed a self-review of my code
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
  • feature.
  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • class to functional components changes.
  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    -no

  • Other information:

@banurekhaMohan279 banurekhaMohan279 self-requested a review May 16, 2023 13:52
Copy link
Owner

@banurekhaMohan279 banurekhaMohan279 left a comment

Choose a reason for hiding this comment

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

Pls take a look at the comments related to formatting, naming, modularity, and comments

@@ -9,11 +9,11 @@
"@testing-library/user-event": "^7.2.1",

Choose a reason for hiding this comment

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

Let's try fixing all the vulnerabilities for the npm modules

}
});
});
function App() {

Choose a reason for hiding this comment

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

Let's try renaming the component naming to something meaningful

{ Negative: [] },
{ Neutral: [] },
]);
const [PoisitivePage, setPoisitivePage] = useState(1);

Choose a reason for hiding this comment

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

Please fix the spelling of the state variable here

const apiData = useSelector((state) => state.getDataReducer.apiData);
const dispatch = useDispatch();
useEffect(() => {
dispatch(getData());

/* Data format

Choose a reason for hiding this comment

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

Add comments at the top of the components for 3 formats:

  1. raw data from amazon format
  2. data passed through sentiment module format
  3. local state array format

let res = sentiment.analyze(
content.review_body + content.review_headline
);
let temp, category;

Choose a reason for hiding this comment

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

Pls try using better naming of variables in general

}
}

renderCardtext(contentVal, category) {

Choose a reason for hiding this comment

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

Can we pls move this rendering of child components to a new component?

@@ -118,95 +117,83 @@ class App extends React.Component {
});
}

renderPagenumbers(contentVal, category) {

Choose a reason for hiding this comment

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

Can we pls move this rendering of child components to a new component?

href="https://s3.amazonaws.com/amazon-reviews-pds/tsv/sample_us.tsv"
target="_blank" without rel="noreferrer"
>
{" "}

Choose a reason for hiding this comment

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

Pls find out what this empty string does and remove if unessential

let contentInner = content[category];
let imgname = Object.keys(content)[0].toLowerCase();
return (
<Card key={i} style={{ minWidth: "18rem" }}>

Choose a reason for hiding this comment

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

Pls move the styles here to css. Refrain from inline styles in general.

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