import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { getTutorials, resetTutorial } from '../../actions/tutorialActions'; import { clearMessages } from '../../actions/messageActions'; import clsx from 'clsx'; import Breadcrumbs from '../Breadcrumbs'; import { Link } from 'react-router-dom'; import { fade } from '@material-ui/core/styles/colorManipulator'; import { withStyles } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import Paper from '@material-ui/core/Paper'; import Typography from '@material-ui/core/Typography'; import { faCheck, faTimes } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; const styles = (theme) => ({ outerDiv: { position: 'absolute', right: '-30px', bottom: '-30px', width: '160px', height: '160px', color: fade(theme.palette.secondary.main, 0.6) }, outerDivError: { stroke: fade(theme.palette.error.dark, 0.6), color: fade(theme.palette.error.dark, 0.6) }, outerDivSuccess: { stroke: fade(theme.palette.primary.main, 0.6), color: fade(theme.palette.primary.main, 0.6) }, outerDivOther: { stroke: fade(theme.palette.secondary.main, 0.6) }, innerDiv: { width: 'inherit', height: 'inherit', display: 'table-cell', verticalAlign: 'middle', textAlign: 'center' } }); class TutorialHome extends Component { componentDidMount() { this.props.getTutorials(); } componentDidUpdate(props, state) { if(this.props.message.id === 'GET_TUTORIALS_FAIL'){ alert(this.props.message.msg); } } componentWillUnmount() { this.props.resetTutorial(); if(this.props.message.msg){ this.props.clearMessages(); } } render() { return ( this.props.isLoading ? null :