You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
747 B
37 lines
747 B
5 years ago
|
import React from 'react';
|
||
|
|
||
|
export default class Channels extends React.Component {
|
||
|
constructor(props) {
|
||
|
super(props)
|
||
|
this.state = {
|
||
|
channels: [],
|
||
|
}
|
||
|
}
|
||
|
|
||
|
componentDidMount() {
|
||
|
this.getChannels()
|
||
|
}
|
||
|
|
||
|
getChannels() {
|
||
|
fetch('/channels').then(r => r.json()).then(body => {
|
||
|
const { channels } = body.response
|
||
|
this.setState({ channels })
|
||
|
})
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
const { channels } = this.state
|
||
|
|
||
|
return (
|
||
|
<ul>
|
||
|
{channels.map(channel =>
|
||
|
<li>
|
||
|
<a onClick={() => this.setState({dest: channel.remote_pubkey})} style={{color:'blue'}}>{channel.remote_pubkey}</a>
|
||
|
<pre>{JSON.stringify(channel, null, 2)}</pre>
|
||
|
</li>
|
||
|
)}
|
||
|
</ul>
|
||
|
)
|
||
|
}
|
||
|
}
|