import React from 'react'; import $ from 'jquery'; import {Button} from 'react-bootstrap'; class Proposal extends React.Component { constructor(props) { super(props); this.state = { url: web3.utils.toAscii(props.data.topic), content: '' }; } componentDidMount(){ fetch(this.state.url) .then((res) => { return res.text(); }) .then((data) => { data = data.replace(//, ''); this.setState({'content': data}); }); } render(){ let $content = $(this.state.content); const title = $('h1.post-title', $content).text(); const summary = $('h2#summary', $content).next().text(); return (

{ title }

{ this.state.url }

{summary}

); } } export default Proposal;