content: import React from 'react';
  import Helmet from 'react-helmet';
  import axios from 'axios';
  
  import {GridList, GridTile} from 'material-ui/GridList';
  import IconButton from 'material-ui/IconButton';
  import StarBorder from 'material-ui/svg-icons/toggle/star-border';
  
  import Img from '../../components/Img';
  import UserCard from '../../components/UserCard';
  import AddNewUser from '../../components/AddNewUser';
  import LoadingIndicator from 'components/LoadingIndicator';
  
  import checkUserBranch from '../../functions.js';
  
  const userData = JSON.parse(localStorage.getItem('userdata'));
  
  (userData.IsAdmin !== '1') ? window.location.href = '/' : '';
  
  export default class UsersPage extends React.Component {
  
  	constructor(props) {
  		super(props);
  		this.state = {
  			users: [],
  			loading: true
  		};
  	}
  
  	componentWillMount() {
  		axios.get('http://54.190.49.213/index.php/api/Users')
        .then(response => {
  	this.setState({users: response.data});
  	this.setState({loading: false});
  })
        .catch(error => {
  });
  	}
  
  	render() {
  		if (!this.state.loading) {
  			return (
          <div>
            <AddNewUser />
            <div>
              {this.state.users.map((item, index) => {
  	return (
                  <div>
                    <UserCard user={item} key={index} />
                  </div>
  	);
  })}
            </div>
          </div>
  			);
  		}
  
  		return (
          <LoadingIndicator />
  		);
  	}
  }
  