mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
26 lines
459 B
JavaScript
26 lines
459 B
JavaScript
'use strict';
|
|
|
|
import { h, render, Component } from 'preact';
|
|
import Client from '../lib/client.js';
|
|
import { bind } from 'decko';
|
|
|
|
class LogoutButton extends Component {
|
|
|
|
@bind
|
|
handleSubmit(e) {
|
|
e.preventDefault();
|
|
|
|
Client.request('session', {
|
|
method: "DELETE",
|
|
}).then((r) => { this.props.onSuccess() })
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<a href="#" onClick={this.handleSubmit}>Sign out</a>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default LogoutButton
|