import React from 'react' //----------------------------------------------// const initialState = { password: '', hash: '', } class RetrieveStoryForm extends React.Component { constructor() { super() this.state = initialState this.handleSubmit = this.handleSubmit.bind(this) this.handleChange = this.handleChange.bind(this) } handleChange(e) { this.setState({ [e.target.name]: e.target.value }) } handleSubmit(e) { e.preventDefault() try { const encryptedStory = this.props.fetchStory( this.state.password, this.state.hash ) this.props.navigate('read') } catch (e) { console.log(e) } } render() { return (

Retrieve A Story

Enter your secret key and your hash below.

) } } //----------------------------------------------// export default RetrieveStoryForm