Open Abhishek00user opened 1 year ago
is this still open for contributions???
Button styling
<div className="container d-flex justify-content-between">
<button disabled={this.state.page <= 1} type="button" className="btn btn-dark" onClick={this.handlePrevClick} >« Previous</button>
<button disabled={this.state.page >= 5} type="button" className="btn btn-dark" onClick={this.handleNextClick} >Next » </button>
</div>
Function for previous button
const handlePrevClick = async () => {
setpage(page-1)
updateNews();
}
Function for Next button
const handleNextClick = async () => {
setpage(page+1)
updateNews();
}
I hope this may help you.
import NewsItem from './NewsItem'
export class News extends Component { articles = [ { "source": {"id": "news24", "name": "News24"}, "author": "Sibusiso Mjikeliso", "title": "Cricket SA wants to 'get to the bottom' of Nkwe resignation concerns, says CEO | Sport", "description": "Acting Cricket South Africa CEO Pholetsi Moseki says the board is concerned about the issues former Proteas assistant coach Enoch Nkwe raised in his resignation.", "url": "https://www.news24.com/sport/Cricket/Proteas/cricket-sa-wants-to-get-to-the-bottom-of-nkwe-resignation-concerns-says-ceo-20210826", "urlToImage": "https://cdn.24.co.za/files/Cms/General/d/10743/97d776dc91734e98906c0e1b7f3b1afa.jpg", "publishedAt": "2021-08-26T11:40:16+00:00", "content": "