design system: adds set token documentation

This commit is contained in:
@wwwjim 2020-07-10 16:28:25 -07:00
parent 0b580421e4
commit c23a4182cf
3 changed files with 6 additions and 1 deletions

View File

@ -11,8 +11,11 @@ import { createPow } from "@textile/powergate-client";
const PowerGate = createPow({ host: 'http://0.0.0.0:6002' });
const FFS = await PowerGate.ffs.create();
const token = FFS.token ? FFS.token : null;
PowerGate.setToken(token)
class Example extends React.Component {
// NOTE(jim):
// Requires token and authentication.
_handleCreateAddress = async ({ name, type, makeDefault }) => {
const response = await PowerGate.ffs.newAddr(
name,

View File

@ -20,7 +20,8 @@ class Example extends React.Component {
// Requires PowerGate to be running locally.
const PowerGate = createPow({ host: 'http://0.0.0.0:6002' });
const FFS = await PowerGate.ffs.create();
return FFS.token ? FFS.token : null;
const token = FFS.token ? FFS.token : null;
PowerGate.setToken(token);
}
render() {

View File

@ -11,6 +11,7 @@ import { createPow } from "@textile/powergate-client";
const PowerGate = createPow({ host: 'http://0.0.0.0:6002' });
const FFS = await PowerGate.ffs.create();
const token = FFS.token ? FFS.token : null;
PowerGate.setToken(token)
class Example extends React.Component {
_handleSend = async ({ source, target, amount }) => {