adds example

This commit is contained in:
@wwwjim 2020-08-06 13:52:47 -07:00
parent cdf814502a
commit 3539a9a863

View File

@ -14,6 +14,19 @@ const STYLES_FILE_HIDDEN = css`
`;
export default class SlateReactSystemPage extends React.Component {
async componentDidMount() {
const url = "/api/v1/get";
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: "Basic --",
},
});
const json = await response.json();
console.log(json);
}
_handleUpload = async (e) => {
e.persist();
@ -42,12 +55,24 @@ export default class SlateReactSystemPage extends React.Component {
<System.H1>Component Library Test</System.H1>
<br />
<br />
<System.P>If this works. That means the component library bundle is working correctly.</System.P>
<System.P>
If this works. That means the component library bundle is working
correctly.
</System.P>
<br />
<br />
<div style={{ marginTop: 24 }}>
<input css={STYLES_FILE_HIDDEN} type="file" id="file" onChange={this._handleUpload} />
<System.ButtonPrimary style={{ margin: "0 16px 16px 0" }} type="label" htmlFor="file">
<input
css={STYLES_FILE_HIDDEN}
type="file"
id="file"
onChange={this._handleUpload}
/>
<System.ButtonPrimary
style={{ margin: "0 16px 16px 0" }}
type="label"
htmlFor="file"
>
Upload File To Network With API
</System.ButtonPrimary>
<System.TooltipAnchor tooltip="Hello friends!!" />