Skip to content

Conversation

@eya26
Copy link

@eya26 eya26 commented Jan 20, 2022

No description provided.

Comment on lines 18 to 30
/*const fetchRepos = () => {
setRepo( "loading" )
axios.get("https://api.github.com/user/repos", {
params: this.state.filters
params: filters
})
.then((response) => {
this.setState({ repos: response.data })
setRepo(response.data )
})
.catch((error) => {
console.log(error)
this.setState({ repos: [] })
setRepo( [] )
})
}
}*/
Copy link
Contributor

Choose a reason for hiding this comment

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

This outdated code is better removed to not affect code readability

Comment on lines 81 to 95
{/*<div className="repositoies-list-navigation-buttons-container">
<button
onClick={this.handlePrevPage}
onClick={handlePrevPage}
className="repositoies-list-navigation-button"
disabled={this.state.filters.page === 1}
disabled={filters.page === 1}
>
{"<"}
</button>
<button
onClick={this.handleNextPage}
onClick={handleNextPage}
className="repositoies-list-navigation-button"
>
{">"}
</button>
</div>
</div>*/}
Copy link
Contributor

Choose a reason for hiding this comment

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

This code as well

@@ -0,0 +1,7 @@
import rootReducer from "./reducers"
//import { createStore } from "@reduxjs/toolkit"
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this comment


const initialState = {
reposList: [],
filters:{page:1,per_page:10,visibility:"public"}
Copy link
Contributor

Choose a reason for hiding this comment

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

filters can stay in the local state of the component since it is not shared with any other.
If, for some reason, we needed to have them in the store, you should dispatch new actions and handle them in the reducer to update the data from the component.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you Sir for your comments, I tried to solve the bugs and update profile and repositoriesList using redux

Copy link
Author

@eya26 eya26 left a comment

Choose a reason for hiding this comment

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

I tried to update profile and repositoriesList using redux and it's working

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