This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import Users from './components/users/users' | |
function App() { | |
return ( | |
<div className="App"> | |
<Users></Users> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import axios from '../../axios' | |
export default class users extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
Users: [] | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import axios from '../../axios' | |
export default class users extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
Users: [] | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
receivedData() { | |
axios | |
.get(`https://jsonplaceholder.typicode.com/photos`) | |
.then(res => { | |
const data = res.data; | |
const slice = data.slice(this.state.offset, this.state.offset + this.state.perPage) | |
const postData = slice.map(pd => <React.Fragment> | |
<p>{pd.title}</p> | |
<img src={pd.thumbnailUrl} alt=""/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handlePageClick = (e) => { | |
const selectedPage = e.selected; | |
const offset = selectedPage * this.state.perPage; | |
this.setState({ | |
currentPage: selectedPage, | |
offset: offset | |
}, () => { | |
this.receivedData() | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
{this.state.postData} | |
<ReactPaginate | |
previousLabel={"prev"} | |
nextLabel={"next"} | |
breakLabel={"..."} | |
breakClassName={"break-me"} | |
pageCount={this.state.pageCount} | |
marginPagesDisplayed={2} | |
pageRangeDisplayed={5} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import axios from 'axios' | |
import ReactPaginate from 'react-paginate'; | |
import './App.css' | |
export default class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
offset: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.pagination { | |
margin: 15px auto; | |
display: flex; | |
list-style: none; | |
outline: none; | |
} | |
.pagination > .active > a{ | |
background-color: #47ccde ; | |
border-color: #47ccde ; | |
color: #fff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<AliceCarousel autoPlay autoPlayInterval="3000"> | |
<img src={image1} className="sliderimg"/> | |
<img src={image2} className="sliderimg"/> | |
<img src={image3} className="sliderimg"/> | |
<img src={image4} className="sliderimg"/> | |
</AliceCarousel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor(props, context) { | |
super(props, context); | |
this.state = { | |
galleryItems: [], | |
}; | |
} | |
getData (){ | |
axios.get(`https://picsum.photos/v2/list?limit=6`, {}) | |
.then(res => { | |
const data = res.data |
OlderNewer