Skip to content

Instantly share code, notes, and snippets.

View Manntrix's full-sized avatar
🏠
Working from home

React Developer Manntrix

🏠
Working from home
View GitHub Profile
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>
import React, {Component} from 'react'
import axios from '../../axios'
export default class users extends Component {
constructor(props) {
super(props);
this.state = {
Users: []
};
}
<div>
{this.state.postData}
<ReactPaginate
previousLabel={"prev"}
nextLabel={"next"}
breakLabel={"..."}
breakClassName={"break-me"}
pageCount={this.state.pageCount}
marginPagesDisplayed={2}
pageRangeDisplayed={5}
.pagination {
margin: 15px auto;
display: flex;
list-style: none;
outline: none;
}
.pagination > .active > a{
background-color: #47ccde ;
border-color: #47ccde ;
color: #fff;
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=""/>
<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>
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
@Manntrix
Manntrix / app.js
Created May 1, 2020 05:04
render return
<div>
<AliceCarousel
items={this.state.galleryItems}
responsive={this.responsive}
autoPlayInterval={2000}
autoPlayDirection="rtl"
autoPlay={true}
fadeOutAnimation={true}
mouseTrackingEnabled={true}
disableAutoPlayOnAction={true}
import React, {Component} from 'react';
import axios from 'axios'
import AliceCarousel from 'react-alice-carousel';
import "react-alice-carousel/lib/alice-carousel.css";
import './App.css';
export default class App extends Component {
constructor(props, context) {
super(props, context);
.alice-carousel ul li img{
height: 400px;
width: 100%;
object-fit: cover;
}