import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { Link } from 'react-router' import ReactGA from 'react-ga' import Modal from './Modal'; import Icon from '../../components/Icon'; import * as coreActions from '../../services/core/actions' import * as uiActions from '../../services/ui/actions' import * as helpers from '../../helpers'; class CreatePlaylist extends React.Component{ constructor(props){ super(props) this.state = { name: '', description: '', scheme: 'spotify', is_public: true, is_collaborative: false } } createPlaylist(e){ e.preventDefault(); if (!this.state.name || this.state.name == ''){ this.setState({error: 'Name is required'}) return false } else { this.props.coreActions.createPlaylist( this.state.scheme, this.state.name, this.state.description, this.state.is_public, this.state.is_collaborative ); window.history.back(); } return false } renderFields(){ switch (this.state.scheme){ case 'spotify': return (