/* Usage: <%= react_component("PageCollectionCreationForm", {}) %> */ import React from "react" import PropTypes from "prop-types" import Stepper from '@material-ui/core/Stepper'; import Step from '@material-ui/core/Step'; import StepLabel from '@material-ui/core/StepLabel'; import StepContent from '@material-ui/core/StepContent'; import Button from '@material-ui/core/Button'; import Paper from '@material-ui/core/Paper'; import Typography from '@material-ui/core/Typography'; class PageCollectionCreationForm extends React.Component { constructor(props) { super(props); this.state = { active_step: 0 } this.handleNext = this.handleNext.bind(this); this.handleBack = this.handleBack.bind(this); this.handleReset = this.handleReset.bind(this); } handleNext() { this.setState({ active_step: this.state.active_step + 1 }); }; handleBack() { this.setState({ active_step: this.state.active_step - 1 }); }; handleReset() { this.setState({ active_step: 0 }); }; classIcon(class_name) { return window.ContentTypeData[class_name].icon; } classColor(class_name) { return window.ContentTypeData[class_name].color; } steps() { return ['Basic information', 'Acceptable pages', 'Privacy settings']; } getStepContent(step) { switch (step) { case 0: return(
Let's get started with some basic information.

Header image (optional)

Upload
Supported file types: .png, .jpg, .jpeg, .gif


); case 1: return (
Please check the types of pages you would like to allow in this collection. A small number of page types is recommended.
{this.props.all_content_types.map(function(type) { return(

); })}
); case 2: return (
By default, all Collections are private. However, you can choose to make your Collection public at any time, and you can also choose to accept submissions from other users!
); default: return 'Unknown step'; } } render () { return (
{this.steps().map((label, index) => ( {label} {this.getStepContent(index)}
))}
{this.state.active_step === this.steps().length && ( All steps completed - you're finished! )}
); } } PageCollectionCreationForm.propTypes = { document_id: PropTypes.number }; export default PageCollectionCreationForm;