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> | |
<AliceCarousel | |
items={this.state.galleryItems} | |
responsive={this.responsive} | |
autoPlayInterval={2000} | |
autoPlayDirection="rtl" | |
autoPlay={true} | |
fadeOutAnimation={true} | |
mouseTrackingEnabled={true} | |
disableAutoPlayOnAction={true} |
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 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); |
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
.alice-carousel ul li img{ | |
height: 400px; | |
width: 100%; | |
object-fit: cover; | |
} |
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 {createStore, applyMiddleware} from 'redux' | |
import thunk from 'redux-thunk' | |
import {composeWithDevTools} from 'redux-devtools-extension' | |
import rootReducer from './reducers' | |
const initalState = { | |
} |
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 { combineReducers } from 'redux' | |
import userReducer from './usersReducer' | |
export default combineReducers({ | |
users: userReducer | |
}) |
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
export const GET_USERS = 'GET_USERS'; | |
export const USERS_ERROR = 'USERS_ERROR' |
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 {GET_USERS} from '../types' | |
const initialState = { | |
users:[], | |
loading:true | |
} | |
export default function(state = initialState, action){ | |
switch(action.type){ |
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 {GET_USERS, USERS_ERROR} from '../types' | |
import axios from 'axios' | |
export const getUsers = () => async dispatch => { | |
try{ | |
const res = await axios.get(`http://jsonplaceholder.typicode.com/users`) | |
dispatch( { | |
type: GET_USERS, | |
payload: res.data |
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 ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
import store from './store/store' | |
import {Provider} from 'react-redux'; | |
ReactDOM.render( | |
<React.StrictMode> |
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 {connect} from 'react-redux' | |
import {getUsers} from '../store/actions/usersAction' | |
class users extends Component { | |
componentDidMount(){ | |
this.props.getUsers() | |
} | |
render() { |