import React, { Component } from 'react'; import {Button, TextField} from 'react-md'; import '../css/Common.css'; import '../css/components/LaunchRequest.css'; import { INVOCATION_NAME_MAX_LENGTH, INVOCATION_ANSWER_MAX_LENGTH } from '../config/constants'; class LaunchRequest extends Component { constructor(props){ super(props); this.state = {invocationName: props.invocationName, invocationAnswer: props.invocationAnswer}; this.handleNameEdit = this.handleNameEdit.bind(this); this.handleAnswerEdit = this.handleAnswerEdit.bind(this); } componentWillReceiveProps(props){ this.setState({invocationName: props.invocationName, invocationAnswer: props.invocationAnswer}); } render() { return (
Invocation name customers use to activate the skill. For example "Open Saburly" or "Talk to Saburly"


Answer customers get from Alexa when they activate the skill.




); } handleNameEdit(e){ if (e.length === INVOCATION_NAME_MAX_LENGTH || !(/^[a-z,.' ]*$/i.test(e))) return; this.setState({invocationName: e}); } handleAnswerEdit(e){ if (e.length === INVOCATION_ANSWER_MAX_LENGTH || !(/^[a-z,.' ]*$/i.test(e))) return; this.setState({invocationAnswer: e}); } } export default LaunchRequest;