import * as React from "react";
import * as System from "~/components/system";
import SystemPage from "~/components/system/SystemPage";
import ViewSourceLink from "~/components/system/ViewSourceLink";
const EXAMPLE_CODE = `import * as React from 'react';
import { CreateFilecoinStorageDeal } from 'slate-react-system';
class Example extends React.Component {
_handleSubmit = async ({ file }) => {
let data = new FormData();
data.append("image", file);
const options = {
method: "POST",
headers: {
Accept: "application/json",
},
body: data,
};
const response = await fetch('/your-storage-end-point', options);
const json = await response.json();
}
render() {
return (
);
}
}
`;
export default class SystemPageMakeStorageDeal extends React.Component {
_handleSubmit = async ({ file }) => {
// TODO(jim): Send file data to server.
alert(file);
};
render() {
return (
Make a Storage Deal{" "}
Here is a partial example of using{" "}
Textile's Powergate
{" "}
to make a data storage deal. This example only provides an example for
how to send your file to a server.
There will be an example of how to make a storage deal coming soon.
Code
{EXAMPLE_CODE}
);
}
}